Package org.apache.tapestry5.services
Interface FieldTranslatorSource
-
- All Known Implementing Classes:
FieldTranslatorSourceImpl
public interface FieldTranslatorSource
For a particular field, generates the defaultFieldTranslator
for the field.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description FieldTranslator
createDefaultTranslator(ComponentResources resources, String parameterName)
FieldTranslator
createDefaultTranslator(Field field, String overrideId, Messages overrideMessages, Locale locale, Class propertyType, AnnotationProvider propertyAnnotations)
Creates aFieldTranslator
for the given property, or returns null if one can't be constructed.FieldTranslator
createTranslator(ComponentResources componentResources, String translatorName)
Creates a translator (used by thetranslate: binding prefix
).FieldTranslator
createTranslator(Field field, String overrideId, Messages overrideMessages, Locale locale, Translator translator)
Wraps aTranslator
as a FieldTranslator.
-
-
-
Method Detail
-
createDefaultTranslator
FieldTranslator createDefaultTranslator(ComponentResources resources, String parameterName)
Common shorthand forcreateDefaultTranslator(org.apache.tapestry5.Field, String, org.apache.tapestry5.commons.Messages, java.util.Locale, Class, org.apache.tapestry5.commons.AnnotationProvider)
.- Parameters:
resources
- of component who owns the parameterparameterName
- name of parameter used to determine the property type- Returns:
- field translator, or null
-
createDefaultTranslator
FieldTranslator createDefaultTranslator(Field field, String overrideId, Messages overrideMessages, Locale locale, Class propertyType, AnnotationProvider propertyAnnotations)
Creates aFieldTranslator
for the given property, or returns null if one can't be constructed. The return value is null if the property type is not known, or if there is noTranslator
available from theTranslatorSource
that is appropriate for the property type.- Parameters:
field
- for which a translator is neededoverrideId
- id used when looking in the overrideMessages for a message overrideoverrideMessages
- location to look for overriding messageslocale
- no longer used in 5.3, may be nullpropertyType
- type of property editted by the field, used to select the TranslatorpropertyAnnotations
- annotations on the property (not currently used)- Returns:
- the field translator, or null
-
createTranslator
FieldTranslator createTranslator(Field field, String overrideId, Messages overrideMessages, Locale locale, Translator translator)
Wraps aTranslator
as a FieldTranslator.- Parameters:
locale
- no longer used in 5.3, may be null
-
createTranslator
FieldTranslator createTranslator(ComponentResources componentResources, String translatorName)
Creates a translator (used by thetranslate: binding prefix
).
-
-