Class ComponentDefaultProviderImpl
java.lang.Object
org.apache.tapestry5.internal.services.ComponentDefaultProviderImpl
- All Implemented Interfaces:
ComponentDefaultProvider
-
Constructor Summary
ConstructorsConstructorDescriptionComponentDefaultProviderImpl(PropertyAccess propertyAccess, BindingSource bindingSource, ValueEncoderSource valueEncoderSource, FieldTranslatorSource fieldTranslatorSource, FieldValidatorDefaultSource fieldValidatorDefaultSource) -
Method Summary
Modifier and TypeMethodDescriptiondefaultBinding(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.defaultLabel(ComponentResources resources) Computes the default label for the component (which will generally be aField).defaultTranslator(String parameterName, ComponentResources resources) Provides a translator based on the bound parameter type, if possible.defaultTranslatorBinding(String parameterName, ComponentResources resources) Provides a binding that itself provides the field translator.defaultValidator(String parameterName, ComponentResources resources) Provides a validator based on the bound parameter type.defaultValidatorBinding(String parameterName, ComponentResources resources) Provides a binding that itself provides the field translator.defaultValueEncoder(String parameterName, ComponentResources resources) Gets or creates a value encoder based on the type of the named parameter.
-
Constructor Details
-
ComponentDefaultProviderImpl
public ComponentDefaultProviderImpl(PropertyAccess propertyAccess, BindingSource bindingSource, ValueEncoderSource valueEncoderSource, FieldTranslatorSource fieldTranslatorSource, FieldValidatorDefaultSource fieldValidatorDefaultSource)
-
-
Method Details
-
defaultLabel
Description copied from interface:ComponentDefaultProviderComputes the default label for the component (which will generally be aField).- Specified by:
defaultLabelin interfaceComponentDefaultProvider- Returns:
- the label, either extracted from the component's container's message catalog, or derived from the
component's
ComponentResourcesCommon.getId().
-
defaultBinding
Description copied from interface:ComponentDefaultProviderChecks 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).- Specified by:
defaultBindingin interfaceComponentDefaultProvider- Parameters:
parameterName- the name of the parameterresources- 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
-
defaultValueEncoder
Description copied from interface:ComponentDefaultProviderGets or creates a value encoder based on the type of the named parameter. ValueEncoders are cached based on type.- Specified by:
defaultValueEncoderin interfaceComponentDefaultProvider- Parameters:
parameterName- the name of the parameter whose type is used to locate aValueEncoderFactoryresources- 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
-
defaultTranslator
Description copied from interface:ComponentDefaultProviderProvides a translator based on the bound parameter type, if possible.- Specified by:
defaultTranslatorin interfaceComponentDefaultProvider- Returns:
- the translator, or null
-
defaultTranslatorBinding
Description copied from interface:ComponentDefaultProviderProvides a binding that itself provides the field translator.- Specified by:
defaultTranslatorBindingin interfaceComponentDefaultProvider- Returns:
- binding that provides the
FieldTranslator
-
defaultValidator
Description copied from interface:ComponentDefaultProviderProvides 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.- Specified by:
defaultValidatorin interfaceComponentDefaultProvider- Returns:
- the validator, possibly a no-op validator
-
defaultValidatorBinding
Description copied from interface:ComponentDefaultProviderProvides a binding that itself provides the field translator.- Specified by:
defaultValidatorBindingin interfaceComponentDefaultProvider- Returns:
- binding that provides the
FieldTranslator
-