Package org.apache.tapestry5.services
Interface ComponentDefaultProvider
- 
- All Known Implementing Classes:
- ComponentDefaultProviderImpl
 
 public interface ComponentDefaultProvider A service that can be injected into a component to provide common defaults for various types of parameters.
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description BindingdefaultBinding(String parameterName, ComponentResources resources)Checks to see if the container of the component (identified by its resources) contains a property matching the component's id.StringdefaultLabel(ComponentResources resources)Computes the default label for the component (which will generally be aField).FieldTranslatordefaultTranslator(String parameterName, ComponentResources resources)Deprecated.BindingdefaultTranslatorBinding(String parameterName, ComponentResources resources)Provides a binding that itself provides the field translator.FieldValidatordefaultValidator(String parameterName, ComponentResources resources)Deprecated.BindingdefaultValidatorBinding(String parameterName, ComponentResources resources)Provides a binding that itself provides the field translator.ValueEncoderdefaultValueEncoder(String parameterName, ComponentResources resources)Gets or creates a value encoder based on the type of the named parameter.
 
- 
- 
- 
Method Detail- 
defaultLabelString defaultLabel(ComponentResources resources) Computes the default label for the component (which will generally be aField).- Parameters:
- resources-
- Returns:
- the label, either extracted from the component's container's message catalog, or derived from the
         component's ComponentResourcesCommon.getId().
 
 - 
defaultBindingBinding defaultBinding(String parameterName, ComponentResources resources) Checks to see if the container of the component (identified by its resources) contains a property matching the component's id. If so, a binding for that property is returned. This is usually the default for aField's value parameter (or equivalent).- Parameters:
- parameterName- the name of the parameter
- resources- the resources of the component for which a binding is needed
- Returns:
- the binding, or null if the container does not have a matching property
 
 - 
defaultValueEncoderValueEncoder defaultValueEncoder(String parameterName, ComponentResources resources) Gets or creates a value encoder based on the type of the named parameter. ValueEncoders are cached based on type.- Parameters:
- parameterName- the name of the parameter whose type is used to locate a- ValueEncoderFactory
- resources- the resources of the component, from which parameter and its type are extracted
- Returns:
- the value encoder, or null if the type of the parameter is not known
 
 - 
defaultTranslatorFieldTranslator defaultTranslator(String parameterName, ComponentResources resources) Deprecated.Provides a translator based on the bound parameter type, if possible.- Parameters:
- parameterName-
- resources-
- Returns:
- the translator, or null
 
 - 
defaultTranslatorBindingBinding defaultTranslatorBinding(String parameterName, ComponentResources resources) Provides a binding that itself provides the field translator.- Parameters:
- parameterName-
- resources-
- Returns:
- binding that provides the FieldTranslator
 
 - 
defaultValidatorFieldValidator defaultValidator(String parameterName, ComponentResources resources) Deprecated.Provides a validator based on the bound parameter type. If the property type of the parameter is not known, then a no-op validator is returned.- Parameters:
- parameterName-
- resources-
- Returns:
- the validator, possibly a no-op validator
 
 - 
defaultValidatorBindingBinding defaultValidatorBinding(String parameterName, ComponentResources resources) Provides a binding that itself provides the field translator.- Parameters:
- parameterName-
- resources-
- Returns:
- binding that provides the FieldTranslator
 
 
- 
 
-