public class FieldTranslatorSourceImpl extends Object implements FieldTranslatorSource
Constructor and Description |
---|
FieldTranslatorSourceImpl(TranslatorSource translatorSource,
Messages globalMessages,
FormSupport formSupport) |
Modifier and Type | Method and Description |
---|---|
FieldTranslator |
createDefaultTranslator(ComponentResources resources,
String parameterName)
|
FieldTranslator |
createDefaultTranslator(Field field,
String overrideId,
Messages overrideMessages,
Locale locale,
Class propertyType,
AnnotationProvider propertyAnnotations)
Creates a
FieldTranslator for the given property, or returns null if one can't be
constructed. |
FieldTranslator |
createTranslator(ComponentResources resources,
String translatorName)
Creates a translator (used by the
translate: binding
prefix ). |
FieldTranslator |
createTranslator(Field field,
String overrideId,
Messages overrideMessages,
Locale locale,
Translator translator)
Wraps a
Translator as a FieldTranslator. |
public FieldTranslatorSourceImpl(TranslatorSource translatorSource, Messages globalMessages, FormSupport formSupport)
public FieldTranslator createDefaultTranslator(ComponentResources resources, String parameterName)
FieldTranslatorSource
FieldTranslatorSource.createDefaultTranslator(org.apache.tapestry5.Field, String,
org.apache.tapestry5.ioc.Messages, java.util.Locale, Class, org.apache.tapestry5.ioc.AnnotationProvider)
.createDefaultTranslator
in interface FieldTranslatorSource
resources
- of component who owns the parameterparameterName
- name of parameter used to determine the property typepublic FieldTranslator createDefaultTranslator(Field field, String overrideId, Messages overrideMessages, Locale locale, Class propertyType, AnnotationProvider propertyAnnotations)
FieldTranslatorSource
FieldTranslator
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 no Translator
available from the TranslatorSource
that
is appropriate for the property type.createDefaultTranslator
in interface FieldTranslatorSource
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)public FieldTranslator createTranslator(Field field, String overrideId, Messages overrideMessages, Locale locale, Translator translator)
FieldTranslatorSource
Translator
as a FieldTranslator.createTranslator
in interface FieldTranslatorSource
locale
- no longer used in 5.3, may be nullpublic FieldTranslator createTranslator(ComponentResources resources, String translatorName)
FieldTranslatorSource
translate: binding
prefix
).createTranslator
in interface FieldTranslatorSource
5.6.3 - Copyright © 2003-2021 The Apache Software Foundation.