Class FieldTranslatorSourceImpl
- java.lang.Object
-
- org.apache.tapestry5.internal.services.FieldTranslatorSourceImpl
-
- All Implemented Interfaces:
FieldTranslatorSource
public class FieldTranslatorSourceImpl extends java.lang.Object implements FieldTranslatorSource
-
-
Constructor Summary
Constructors Constructor Description FieldTranslatorSourceImpl(TranslatorSource translatorSource, Messages globalMessages, FormSupport formSupport)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FieldTranslator
createDefaultTranslator(ComponentResources resources, java.lang.String parameterName)
FieldTranslator
createDefaultTranslator(Field field, java.lang.String overrideId, Messages overrideMessages, java.util.Locale locale, java.lang.Class propertyType, AnnotationProvider propertyAnnotations)
Creates aFieldTranslator
for the given property, or returns null if one can't be constructed.FieldTranslator
createTranslator(ComponentResources resources, java.lang.String translatorName)
Creates a translator (used by thetranslate: binding prefix
).FieldTranslator
createTranslator(Field field, java.lang.String overrideId, Messages overrideMessages, java.util.Locale locale, Translator translator)
Wraps aTranslator
as a FieldTranslator.
-
-
-
Constructor Detail
-
FieldTranslatorSourceImpl
public FieldTranslatorSourceImpl(TranslatorSource translatorSource, Messages globalMessages, FormSupport formSupport)
-
-
Method Detail
-
createDefaultTranslator
public FieldTranslator createDefaultTranslator(ComponentResources resources, java.lang.String parameterName)
Description copied from interface:FieldTranslatorSource
Common shorthand forFieldTranslatorSource.createDefaultTranslator(org.apache.tapestry5.Field, String, org.apache.tapestry5.commons.Messages, java.util.Locale, Class, org.apache.tapestry5.commons.AnnotationProvider)
.- Specified by:
createDefaultTranslator
in interfaceFieldTranslatorSource
- Parameters:
resources
- of component who owns the parameterparameterName
- name of parameter used to determine the property type- Returns:
- field translator, or null
-
createDefaultTranslator
public FieldTranslator createDefaultTranslator(Field field, java.lang.String overrideId, Messages overrideMessages, java.util.Locale locale, java.lang.Class propertyType, AnnotationProvider propertyAnnotations)
Description copied from interface:FieldTranslatorSource
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.- Specified by:
createDefaultTranslator
in interfaceFieldTranslatorSource
- 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
public FieldTranslator createTranslator(Field field, java.lang.String overrideId, Messages overrideMessages, java.util.Locale locale, Translator translator)
Description copied from interface:FieldTranslatorSource
Wraps aTranslator
as a FieldTranslator.- Specified by:
createTranslator
in interfaceFieldTranslatorSource
locale
- no longer used in 5.3, may be null
-
createTranslator
public FieldTranslator createTranslator(ComponentResources resources, java.lang.String translatorName)
Description copied from interface:FieldTranslatorSource
Creates a translator (used by thetranslate: binding prefix
).- Specified by:
createTranslator
in interfaceFieldTranslatorSource
-
-