public class EnumSetTranslator extends Object implements DataTranslator
NULL_OBJECT, PRIORITY_NORMAL_SUPPORT, PRIORITY_NOT_SUPPORTED| Constructor and Description |
|---|
EnumSetTranslator() |
| Modifier and Type | Method and Description |
|---|---|
String |
getId()
Gets an identifier of this translator.
|
int |
getTargetClassSupportPriority(Class<?> targetClass,
DataTranslatorContext context)
Determines whether the argument represents a class supported by this
translator.
|
String |
toString() |
Object |
translateToClass(Object source,
Class<?> targetClass,
DataTranslatorContext context)
Attempts to translate an arbitrary object into an instance of
targetClass. |
public String getId()
DataTranslatorgetId in interface DataTranslatorpublic int getTargetClassSupportPriority(Class<?> targetClass, DataTranslatorContext context)
DataTranslatorDataTranslator.PRIORITY_NOT_SUPPORTED constant.
The translator that reports the highest priority will be used for the actual translation. If there are multiple translators with the same maximum priority, the choice will be arbitrary.
getTargetClassSupportPriority in interface DataTranslatortargetClass - class of the expected result of translationcontext - context of the translationtargetClass; zero or negative value if the class is not
supportedpublic Object translateToClass(Object source, Class<?> targetClass, DataTranslatorContext context)
DataTranslatortargetClass.
If the translation couldn't be performed, null is returned.
As the translation happens while preparing configuration data, the translator receives information about the context of translation.
translateToClass in interface DataTranslatorsource - non-null object that is to be translatedtargetClass - requested target classcontext - context of the translationtargetClass; null if the translation cannot
be performed; DataTranslator.NULL_OBJECT if the result should be true null valueCopyright © 2015 Boleslav Bobcik - Auderis. All rights reserved.