Package org.eclipse.persistence.jaxb
Class JAXBEnumTypeConverter
- java.lang.Object
-
- org.eclipse.persistence.mappings.converters.ObjectTypeConverter
-
- org.eclipse.persistence.jaxb.JAXBEnumTypeConverter
-
- All Implemented Interfaces:
java.io.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
-
-
Field Summary
-
Fields inherited from class org.eclipse.persistence.mappings.converters.ObjectTypeConverter
addToAttributeOnlyConversionValueStrings, attributeToFieldValues, conversionValueStrings, converterName, dataType, dataTypeName, defaultAttributeValue, defaultAttributeValueString, fieldClassification, fieldClassificationName, fieldToAttributeValues, mapping, objectType, objectTypeName
-
-
Constructor Summary
Constructors Constructor Description JAXBEnumTypeConverter(org.eclipse.persistence.internal.oxm.mappings.Mapping mapping, java.lang.String enumClassName, boolean usesOrdinalValues)
PUBLIC:
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
convertClassNamesToClasses(java.lang.ClassLoader classLoader)
INTERNAL: Convert all the class-name-based settings in this converter to actual class-based settings.java.lang.Object
convertDataValueToObjectValue(java.lang.Object fieldValue, Session session)
INTERNAL: Returns the corresponding attribute value for the specified field value.void
initialize(DatabaseMapping mapping, Session session)
INTERNAL:boolean
usesOrdinalValues()
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, getMapping, initializeFieldClassification, isMutable, loadClass, mapBooleans, mapGenders, mapResponses, setAttributeToFieldValues, setConverterName, setDataTypeName, setDefaultAttributeValue, setDefaultAttributeValueString, setFieldClassification, setFieldClassificationName, setFieldToAttributeValueAssociations, setFieldToAttributeValues, setMapping, setObjectTypeName, throwInitObjectException
-
-
-
-
Method Detail
-
convertClassNamesToClasses
public void convertClassNamesToClasses(java.lang.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:
convertClassNamesToClasses
in interfaceorg.eclipse.persistence.internal.descriptors.ClassNameConversionRequired
- Overrides:
convertClassNamesToClasses
in classObjectTypeConverter
- Parameters:
classLoader
-
-
initialize
public void initialize(DatabaseMapping mapping, Session session)
INTERNAL:- Specified by:
initialize
in interfaceConverter
- Specified by:
initialize
in interfaceCoreConverter<DatabaseMapping,Session>
- Overrides:
initialize
in classObjectTypeConverter
-
usesOrdinalValues
public boolean usesOrdinalValues()
PUBLIC: Returns true if this converter uses ordinal values for the enum conversion.
-
convertDataValueToObjectValue
public java.lang.Object convertDataValueToObjectValue(java.lang.Object fieldValue, Session session)
Description copied from class:ObjectTypeConverter
INTERNAL: Returns the corresponding attribute value for the specified field value.- Specified by:
convertDataValueToObjectValue
in interfaceConverter
- Specified by:
convertDataValueToObjectValue
in interfaceCoreConverter<DatabaseMapping,Session>
- Overrides:
convertDataValueToObjectValue
in classObjectTypeConverter
-
-