Package org.eclipse.persistence.jaxb
Class JAXBEnumTypeConverter
- java.lang.Object
-
- org.eclipse.persistence.mappings.converters.ObjectTypeConverter
-
- org.eclipse.persistence.jaxb.JAXBEnumTypeConverter
-
- All Implemented Interfaces:
Serializable,CoreConverter<DatabaseMapping,Session>,org.eclipse.persistence.internal.descriptors.ClassNameConversionRequired,Converter
public class JAXBEnumTypeConverter extends ObjectTypeConverter
INTERNAL:Purpose:Provide a means to Convert an Enumeration type to/from either a string representation of the enum facet or a user defined value.
Responsibilities:
- Initialize the conversion values to be the Enum facets
- Don't overwrite any existing, user defined conversion value
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description JAXBEnumTypeConverter(org.eclipse.persistence.internal.oxm.mappings.Mapping mapping, String enumClassName, boolean usesOrdinalValues)PUBLIC:
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconvertClassNamesToClasses(ClassLoader classLoader)INTERNAL: Convert all the class-name-based settings in this converter to actual class-based settings.ObjectconvertDataValueToObjectValue(Object fieldValue, Session session)INTERNAL: Returns the corresponding attribute value for the specified field value.voidinitialize(DatabaseMapping mapping, Session session)INTERNAL:booleanusesOrdinalValues()PUBLIC: Returns true if this converter uses ordinal values for the enum conversion.-
Methods inherited from class org.eclipse.persistence.mappings.converters.ObjectTypeConverter
addConversionValue, addConversionValueStrings, addToAttributeOnlyConversionValue, addToAttributeOnlyConversionValueStrings, convertObjectValueToDataValue, getAttributeToFieldValues, getDefaultAttributeValue, getFieldClassification, getFieldClassification, getFieldClassificationName, getFieldToAttributeValueAssociations, getFieldToAttributeValues, initializeFieldClassification, isMutable, mapBooleans, mapGenders, mapResponses, setAttributeToFieldValues, setConverterName, setDataTypeName, setDefaultAttributeValue, setDefaultAttributeValueString, setFieldClassification, setFieldClassificationName, setFieldToAttributeValueAssociations, setFieldToAttributeValues, setObjectTypeName
-
-
-
-
Constructor Detail
-
JAXBEnumTypeConverter
public JAXBEnumTypeConverter(org.eclipse.persistence.internal.oxm.mappings.Mapping mapping, String enumClassName, boolean usesOrdinalValues)PUBLIC:
-
-
Method Detail
-
convertClassNamesToClasses
public void convertClassNamesToClasses(ClassLoader classLoader)
INTERNAL: Convert all the class-name-based settings in this converter to actual class-based settings. This method is used when converting a project that has been built with class names to a project with classes.- Specified by:
convertClassNamesToClassesin interfaceorg.eclipse.persistence.internal.descriptors.ClassNameConversionRequired- Overrides:
convertClassNamesToClassesin classObjectTypeConverter- Parameters:
classLoader-
-
initialize
public void initialize(DatabaseMapping mapping, Session session)
INTERNAL:- Specified by:
initializein interfaceConverter- Specified by:
initializein interfaceCoreConverter<DatabaseMapping,Session>- Overrides:
initializein classObjectTypeConverter
-
usesOrdinalValues
public boolean usesOrdinalValues()
PUBLIC: Returns true if this converter uses ordinal values for the enum conversion.
-
convertDataValueToObjectValue
public Object convertDataValueToObjectValue(Object fieldValue, Session session)
Description copied from class:ObjectTypeConverterINTERNAL: Returns the corresponding attribute value for the specified field value.- Specified by:
convertDataValueToObjectValuein interfaceConverter- Specified by:
convertDataValueToObjectValuein interfaceCoreConverter<DatabaseMapping,Session>- Overrides:
convertDataValueToObjectValuein classObjectTypeConverter
-
-