public class XMLConversionManager extends ConversionManager implements TimeZoneHolder
Purpose: Primarily used to convert objects from a given XML Schema type to a different type in Java. Uses a singleton instance
Constructor and Description |
---|
XMLConversionManager() |
Modifier and Type | Method and Description |
---|---|
String |
buildBase64StringFromBytes(byte[] bytes) |
String |
buildBase64StringFromObjectBytes(Byte[] bytes) |
QName |
buildQNameFromString(String stringValue,
AbstractUnmarshalRecord record) |
Object |
clone()
INTERNAL:
|
String |
collapseStringValue(String value)
Removes all leading and trailing whitespaces, and replaces any sequences of whitespaces
that occur in the string with a single ' ' character.
|
Object |
convertHexBinaryListToByteArrayList(Object sourceObject,
CoreContainerPolicy containerPolicy,
CoreAbstractSession session) |
String |
convertListToString(Object sourceObject,
QName schemaType) |
Object |
convertObject(Object sourceObject,
Class javaClass)
Convert the given object to the appropriate type by invoking the appropriate
ConversionManager method.
|
Object |
convertObject(Object sourceObject,
Class javaClass,
QName schemaTypeQName)
Convert the given object to the appropriate type by invoking the appropriate
ConversionManager method.
|
Object |
convertSchemaBase64ListToByteArrayList(Object sourceObject,
CoreContainerPolicy containerPolicy,
CoreAbstractSession session) |
byte[] |
convertSchemaBase64ToByteArray(Object sourceObject)
INTERNAL:
Converts a String which is in Base64 format to a Byte[]
|
Calendar |
convertStringToCalendar(String sourceString,
QName schemaTypeQName) |
Date |
convertStringToDate(String sourceString,
QName schemaType) |
Duration |
convertStringToDuration(String sourceString)
Return a Duration created with a given date string.
|
Object |
convertStringToList(Object sourceObject,
Class elementType,
ContainerPolicy containerPolicy,
QName schemaType)
Convert the given sourceObject (String) to the appropriate collection type specified by the
containerPolicy, using the elementType to properly convert each element of the list.
|
Timestamp |
convertStringToTimestamp(String sourceString,
QName schemaType) |
XMLGregorianCalendar |
convertStringToXMLGregorianCalendar(String sourceString)
Return an XMLGregorianCalander created with a given date string
|
XMLGregorianCalendar |
convertStringToXMLGregorianCalendar(String sourceString,
QName schemaTypeQName) |
static HashMap |
getDefaultJavaTypes() |
static XMLConversionManager |
getDefaultXMLManager() |
static HashMap |
getDefaultXMLTypes() |
TimeZone |
getTimeZone()
Return the specified TimeZone used for all String to date object
conversions.
|
boolean |
isTimeZoneQualified() |
String |
normalizeStringValue(String value)
Replaces any CR, Tab or LF characters in the string with a single ' ' character.
|
void |
setTimeZone(TimeZone timeZone)
The specified TimeZone will be used for all String to date object
conversions.
|
void |
setTimeZoneQualified(boolean timeZoneQualified)
Specify if
Specify if when date objects are converted to Strings in the XML Schema
time or dateTime format
|
String |
stringFromCalendar(Calendar sourceCalendar,
QName schemaTypeQName) |
String |
stringFromDate(Date sourceDate,
QName schemaType)
This method returns a string representing a given java.util.Date
based on a given schema type QName.
|
convertClassNameToClass, getDataTypesConvertedFrom, getDataTypesConvertedTo, getDefaultLoader, getDefaultManager, getDefaultNullValue, getDefaultNullValues, getLoader, getObjectClass, getPrimitiveClass, hasDefaultNullValues, loadClass, setDefaultLoader, setDefaultManager, setDefaultNullValue, setDefaultNullValues, setLoader, setShouldUseClassLoaderFromCurrentThread, shouldUseClassLoaderFromCurrentThread
public static XMLConversionManager getDefaultXMLManager()
public TimeZone getTimeZone()
getTimeZone
in interface TimeZoneHolder
public void setTimeZone(TimeZone timeZone)
public boolean isTimeZoneQualified()
public void setTimeZoneQualified(boolean timeZoneQualified)
public Object convertObject(Object sourceObject, Class javaClass) throws ConversionException
convertObject
in class ConversionManager
sourceObject
- - will always be a string if read from XMLjavaClass
- - the class that the object must be converted toConversionException
public Object convertObject(Object sourceObject, Class javaClass, QName schemaTypeQName) throws ConversionException
sourceObject
- - will always be a string if read from XMLjavaClass
- - the class that the object must be converted toschemaTypeQName
- - the XML schema that the object is being converted fromConversionException
public XMLGregorianCalendar convertStringToXMLGregorianCalendar(String sourceString, QName schemaTypeQName)
public XMLGregorianCalendar convertStringToXMLGregorianCalendar(String sourceString)
dateString
- public Duration convertStringToDuration(String sourceString)
dateString
- public Calendar convertStringToCalendar(String sourceString, QName schemaTypeQName)
public Timestamp convertStringToTimestamp(String sourceString, QName schemaType)
public String stringFromDate(Date sourceDate, QName schemaType)
sourceDate
- schemaType
- public byte[] convertSchemaBase64ToByteArray(Object sourceObject) throws ConversionException
ConversionException
public Object convertSchemaBase64ListToByteArrayList(Object sourceObject, CoreContainerPolicy containerPolicy, CoreAbstractSession session) throws ConversionException
ConversionException
public String buildBase64StringFromBytes(byte[] bytes)
public Object convertStringToList(Object sourceObject, Class elementType, ContainerPolicy containerPolicy, QName schemaType) throws ConversionException
sourceObject
- - will always be a string if read from XMLelementType
- - the type of the elements contained in the listConversionException
public String convertListToString(Object sourceObject, QName schemaType) throws ConversionException
ConversionException
public static HashMap getDefaultXMLTypes()
public static HashMap getDefaultJavaTypes()
public Object clone()
clone
in class ConversionManager
public QName buildQNameFromString(String stringValue, AbstractUnmarshalRecord record)
public String normalizeStringValue(String value)
public String collapseStringValue(String value)
public Object convertHexBinaryListToByteArrayList(Object sourceObject, CoreContainerPolicy containerPolicy, CoreAbstractSession session)
EclipseLink 2.5.2, "build v20140319-9ad6abd" API Reference