Top Description Fields Constructors Methods
org.eclipse.persistence.oxm.mappings.converters

public Class XMLListConverter

extends Object
implements Converter
Class Inheritance
All Implemented Interfaces
org.eclipse.persistence.mappings.converters.Converter, java.io.Serializable, org.eclipse.persistence.core.mappings.converters.CoreConverter
Imports
java.security.AccessController, .PrivilegedActionException, org.eclipse.persistence.exceptions.ValidationException, org.eclipse.persistence.internal.oxm.XMLConversionManager, org.eclipse.persistence.internal.oxm.mappings.Field, org.eclipse.persistence.internal.security.PrivilegedClassForName, org.eclipse.persistence.mappings.DatabaseMapping, org.eclipse.persistence.mappings.converters.Converter, org.eclipse.persistence.oxm.mappings.XMLCompositeDirectCollectionMapping, org.eclipse.persistence.sessions.Session

Purpose: Provides an implementation of Converter that can be used to convert a collection of Objects into a space separated list of Strings and back. Used with XMLCompositeDirectCollectionMapping to implement the behaviour of the XmlList annotation

See Also
XMLCompositeDirectCollectionMapping, XMLConverter, Converter

Field Summary

Modifier and TypeField and Description
private XMLConversionManager
private XMLCompositeDirectCollectionMapping
private Class<?>
private String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Object
convertDataValueToObjectValue(Object dataValue, Session session)

Implements org.eclipse.persistence.mappings.converters.Converter.convertDataValueToObjectValue.

PUBLIC: Convert the databases' data representation of the value to the object's representation.
public Object
convertObjectValueToDataValue(Object objectValue, Session session)

Implements org.eclipse.persistence.mappings.converters.Converter.convertObjectValueToDataValue.

PUBLIC: Convert the object's representation of the value to the databases' data representation.
public Class<?>

Returns:

Class the Class of the elements of this collection's "sub-collection"
getObjectClass
()

Get the Class of the elements of this collection's "sub-collection".

public String

Returns:

String the name of the Class of the elements of this collection's "sub-collection"
getObjectClassName
()

Get the Class name of the elements of this collection's "sub-collection".

public void
initialize(DatabaseMapping mapping, Session session)

Implements org.eclipse.persistence.mappings.converters.Converter.initialize.

PUBLIC: Allow for any initialization.
public boolean
isMutable()

Implements org.eclipse.persistence.mappings.converters.Converter.isMutable.

PUBLIC: If the converter converts the value to a mutable value, i.e. a value that can have its' parts changed without being replaced, then it must return true.
public void
setObjectClass(Class<?>
the Class of the elements of this collection's "sub-collection"
aClass
)

Set the Class of the elements of this collection's "sub-collection".

public void
setObjectClassName(String
the name of the Class of the elements of this collection's "sub-collection"
aClassName
)

Set the Class name of the elements of this collection's "sub-collection".

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

conversionManagerback to summary
private XMLConversionManager conversionManager
mappingback to summary
private XMLCompositeDirectCollectionMapping mapping
objectClassback to summary
private Class<?> objectClass
objectClassNameback to summary
private String objectClassName

Constructor Detail

XMLListConverterback to summary
public XMLListConverter()

Method Detail

convertDataValueToObjectValueback to summary
public Object convertDataValueToObjectValue(Object dataValue, Session session)

Implements org.eclipse.persistence.mappings.converters.Converter.convertDataValueToObjectValue.

Doc from org.eclipse.persistence.mappings.converters.Converter.convertDataValueToObjectValue.

PUBLIC: Convert the databases' data representation of the value to the object's representation. For example this could convert between an sql.Time datatype and the Java Calendar type.

Annotations
@Override
convertObjectValueToDataValueback to summary
public Object convertObjectValueToDataValue(Object objectValue, Session session)

Implements org.eclipse.persistence.mappings.converters.Converter.convertObjectValueToDataValue.

Doc from org.eclipse.persistence.mappings.converters.Converter.convertObjectValueToDataValue.

PUBLIC: Convert the object's representation of the value to the databases' data representation. For example this could convert between a Calendar Java type and the sql.Time datatype.

Annotations
@Override
getObjectClassback to summary
public Class<?> getObjectClass()

Get the Class of the elements of this collection's "sub-collection". Only applicable for DirectCollections of Lists (for example, for an ArrayList<ArrayList<Double>>, FieldSubElementClass would be java.lang.Double.class).

Returns:Class<?>

Class the Class of the elements of this collection's "sub-collection"

getObjectClassNameback to summary
public String getObjectClassName()

Get the Class name of the elements of this collection's "sub-collection". Only applicable for DirectCollections of Lists (for example, for an ArrayList<ArrayList<Double>>, FieldSubElementClassName would be "java.lang.Double").

Returns:String

String the name of the Class of the elements of this collection's "sub-collection"

initializeback to summary
public void initialize(DatabaseMapping mapping, Session session)

Implements org.eclipse.persistence.mappings.converters.Converter.initialize.

Doc from org.eclipse.persistence.mappings.converters.Converter.initialize.

PUBLIC: Allow for any initialization.

Annotations
@Override
isMutableback to summary
public boolean isMutable()

Implements org.eclipse.persistence.mappings.converters.Converter.isMutable.

Doc from org.eclipse.persistence.mappings.converters.Converter.isMutable.

PUBLIC: If the converter converts the value to a mutable value, i.e. a value that can have its' parts changed without being replaced, then it must return true. If the value is not mutable, cannot be changed without replacing the whole value then false must be returned. This is used within the UnitOfWork to determine how to clone.

Annotations
@Override
setObjectClassback to summary
public void setObjectClass(Class<?> aClass)

Set the Class of the elements of this collection's "sub-collection". Only applicable for DirectCollections of Lists (for example, for an ArrayList<ArrayList<Double>>, FieldSubElementClass would be java.lang.Double.class).

Parameters
aClass:Class<?>

the Class of the elements of this collection's "sub-collection"

setObjectClassNameback to summary
public void setObjectClassName(String aClassName)

Set the Class name of the elements of this collection's "sub-collection". Only applicable for DirectCollections of Lists (for example, for an ArrayList<ArrayList<Double>>, FieldSubElementClassName would be "java.lang.Double").

Parameters
aClassName:String

the name of the Class of the elements of this collection's "sub-collection"