Class TLcdXMLDataObjectEncoderLibrary
- All Implemented Interfaces:
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
.
- Since:
- 10.0
-
Constructor Summary
ConstructorDescriptionTLcdXMLDataObjectEncoderLibrary
(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. -
Method Summary
Modifier and TypeMethodDescriptionvoid
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.
-
Constructor Details
-
TLcdXMLDataObjectEncoderLibrary
Creates a new encoder library for the specified data model.- Parameters:
aDataModel
- the data model for which to create a libraryaPrefix
- the prefix for the given name space to use while encoding
-
TLcdXMLDataObjectEncoderLibrary
public TLcdXMLDataObjectEncoderLibrary(TLcdDataModel aDataModel, String aPrefix, String aPublicSchemaLocation) Creates a new encoder library for the specified data model.- Parameters:
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 benull
if no schema location is to be written for this data model)
-
-
Method Details
-
configureEncoder
Checks if the given encoder is already configured for the data model. If not, callsdoConfigureEncoder(TLcdXMLSchemaBasedEncoder)
.- Specified by:
configureEncoder
in interfaceILcdXMLSchemaBasedEncoderLibrary
- Parameters:
aEncoder
- the encoder to configure
-
doConfigureEncoder
Configures the encoder for the data model using the data model's XML schema and the default mapping rules. This method should be overridden when additional configuration is required.- Parameters:
aEncoder
- the encoder to configure
-