public class TLcdXMLDataObjectEncoderLibrary extends Object implements ILcdXMLSchemaBasedEncoderLibrary
Implementation of ILcdXMLSchemaBasedEncoderLibrary
that provides support for marshalling
ILcdDataObject
instances to XML data for a given data model.
Note that this class is typically NOT used to configure an encoder. Configuring an
encoder for a data model is done using the
TLcdXMLSchemaBasedEncoder.configure(TLcdDataModel)
.
This class is used in cases where a custom encoder library needs to be created as an extension
to the default.
This library assumes that the data model is annotated with an appropriate TLcdXMLSchemaTypeMappingAnnotation
.
This library will read the specified XML Schema, create and register
com.luciad.format.xml.bind.schema.ILcdXMLTypeMarshaller
and/or com.luciad.format.xml.bind.schema.ILcdXMLSchemaDatatypeMarshaller
instances on the encoder for each
of the types declared in the XML Schema.
All marshallers created by this encoder library expect the objects to be marshalled to
adhere to the dataobject-XML schema mapping as described by the TLcdXMLDataModelBuilder
.
Constructor and Description |
---|
TLcdXMLDataObjectEncoderLibrary(TLcdDataModel aDataModel,
String aPrefix)
Creates a new encoder library for the specified data model.
|
TLcdXMLDataObjectEncoderLibrary(TLcdDataModel aDataModel,
String aPrefix,
String aPublicSchemaLocation)
Creates a new encoder library for the specified data model.
|
Modifier and Type | Method and Description |
---|---|
void |
configureEncoder(TLcdXMLSchemaBasedEncoder aEncoder)
Checks if the given encoder is already configured for the data model.
|
protected void |
doConfigureEncoder(TLcdXMLSchemaBasedEncoder aEncoder)
Configures the encoder for the data model using the data model's XML schema
and the default mapping rules.
|
public TLcdXMLDataObjectEncoderLibrary(TLcdDataModel aDataModel, String aPrefix)
aDataModel
- the data model for which to create a libraryaPrefix
- the prefix for the given name space to use while encodingpublic TLcdXMLDataObjectEncoderLibrary(TLcdDataModel aDataModel, String aPrefix, String aPublicSchemaLocation)
aDataModel
- the data model for which to create a libraryaPrefix
- the prefix for the given name space to use while encodingaPublicSchemaLocation
- the schema location that is to be written in XML documents (can be null
if no schema location is to be written for this data model)public void configureEncoder(TLcdXMLSchemaBasedEncoder aEncoder)
doConfigureEncoder(TLcdXMLSchemaBasedEncoder)
.configureEncoder
in interface ILcdXMLSchemaBasedEncoderLibrary
aEncoder
- the encoder to configureprotected void doConfigureEncoder(TLcdXMLSchemaBasedEncoder aEncoder)
aEncoder
- the encoder to configure