|
EclipseLink 2.2.0, build 'v20110202-r8913' API Reference | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.persistence.jaxb.JAXBTypesafeEnumConverter
public class JAXBTypesafeEnumConverter
Purpose: JAXBTypesafeEnumConverter is used to allow mapping to type safe enums according to the JAXB 1.0 spec. Object values are not modified by the converter when writing data values. Data values are read in and the "fromString" method on the enumeration class is invoked with the data value as a parameter. The return value from the "fromString" method will be an instance of the enum class specified on the mapping.
Constructor Summary | |
---|---|
JAXBTypesafeEnumConverter()
PUBLIC: Default constructor. |
Method Summary | |
---|---|
java.lang.Object |
convertDataValueToObjectValue(java.lang.Object dataValue,
Session session)
INTERNAL: The fromString value on the enum class must be invoked with the field value specified as an argument. |
java.lang.Object |
convertObjectValueToDataValue(java.lang.Object objectValue,
Session session)
INTERNAL: Return the attribute value. |
java.lang.Class |
getEnumClass()
PUBLIC: Get the class which was set as the enum class which contains the fromValue method. |
java.lang.String |
getEnumClassName()
PUBLIC: Get the name of the enum class which contains the fromValue method. |
void |
initialize(DatabaseMapping mapping,
Session session)
INTERNAL: Set the enum class. |
boolean |
isMutable()
PUBLIC: If the converter converts the value to a mutable value, i.e. |
void |
setEnumClass(java.lang.Class enumClass)
PUBLIC: Set the enum class to know which class to invoke the fromValue method on. |
void |
setEnumClassName(java.lang.String newClassName)
PUBLIC: Set the name of the enum class to know which class to invoke the fromValue method on. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JAXBTypesafeEnumConverter()
Method Detail |
---|
public java.lang.Object convertObjectValueToDataValue(java.lang.Object objectValue, Session session)
convertObjectValueToDataValue
in interface Converter
public java.lang.Object convertDataValueToObjectValue(java.lang.Object dataValue, Session session)
convertDataValueToObjectValue
in interface Converter
public boolean isMutable()
Converter
isMutable
in interface Converter
public void initialize(DatabaseMapping mapping, Session session)
initialize
in interface Converter
public java.lang.String getEnumClassName()
public void setEnumClassName(java.lang.String newClassName)
public void setEnumClass(java.lang.Class enumClass)
public java.lang.Class getEnumClass()
|
EclipseLink 2.2.0, build 'v20110202-r8913' API Reference | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |