Class TLcdXMLSchemaBasedMapping
- All Implemented Interfaces:
ILcdInputStreamFactoryCapable
- information about the elements and types defined in the XML Schemas, supported by XML decoder/encoder.
- object factories for all types declared in these XML Schemas.
- Locations where the XML Schemas can be found.
this package's documentation
and the
com.luciad.format.xml.bind package documentation
for a general
overview of the XML Binding Framework.- Since:
- 9.0
-
Constructor Summary
ConstructorDescriptionCreates a new, emptycom.luciad.format.xml.bind.schema.TLcdXMLSchemaMapping
.Creates a newcom.luciad.format.xml.bind.schema.TLcdXMLSchemaMapping
for the specified mapping library.Creates a newcom.luciad.format.xml.bind.schema.TLcdXMLSchemaMapping
for the specified mapping libraries.Creates a newcom.luciad.format.xml.bind.schema.TLcdXMLSchemaMapping
for the specified mapping libraries. -
Method Summary
Modifier and TypeMethodDescriptionvoid
configure
(TLcdDataModel aDataModel) Configures this mapping for the given data model and all its dependencies.<T> T
createObject
(TLcdXMLSchemaTypeIdentifier aTypeId, Class<T> aClass, ILcdXMLDocumentContext aDocumentContext) Creates a new object instance for the specified XML Schema type, of the specified class (or subclass).Returns the default entity resolver to be used for resolving XML Schemas.Returns theILcdInputStreamFactory
that is used to create input streams for schemas that are not handled by the default entity resolver.Returns theTLcdXMLJavaClassResolver
used by this mapping.Returns the set of namespaces which are supported by this mapping.getProperty
(String aName) Returns the custom property with the specified name.Returns a map containing as keys the namespaces of all mapped XML Schemas, and as values their corresponding schema locations.Returns theTLcdXMLSchemaSet
object containing all XML Schema information used by this mapping.Returns the schema object factory provider of this mapping.void
registerNamespaceURI
(String aNamespaceURI) Registers the specified namespace on this mapping.void
setDefaultEntityResolver
(EntityResolver2 aEntityResolver) Sets the default entity resolver to be used for resolving XML Schemas.void
setInputStreamFactory
(ILcdInputStreamFactory aInputStreamFactory) Sets theILcdInputStreamFactory
that is used to create input streams for schemas that are not handled by the default entity resolver.void
setProperty
(String aName, Object aValue) Sets the specified custom property on this, to be shared among users of this mapping.
-
Constructor Details
-
TLcdXMLSchemaBasedMapping
public TLcdXMLSchemaBasedMapping()Creates a new, emptycom.luciad.format.xml.bind.schema.TLcdXMLSchemaMapping
. -
TLcdXMLSchemaBasedMapping
Creates a newcom.luciad.format.xml.bind.schema.TLcdXMLSchemaMapping
for the specified mapping library.- Parameters:
aLibrary
- the mapping library for which to create a mapping.
-
TLcdXMLSchemaBasedMapping
Creates a newcom.luciad.format.xml.bind.schema.TLcdXMLSchemaMapping
for the specified mapping libraries.- Parameters:
aLibrary
- the mapping libraries for which to create a mapping.
-
TLcdXMLSchemaBasedMapping
Creates a newcom.luciad.format.xml.bind.schema.TLcdXMLSchemaMapping
for the specified mapping libraries.- Parameters:
aLibrary
- the mapping libraries for which to create a mapping.
-
-
Method Details
-
createObject
public <T> T createObject(TLcdXMLSchemaTypeIdentifier aTypeId, Class<T> aClass, ILcdXMLDocumentContext aDocumentContext) Creates a new object instance for the specified XML Schema type, of the specified class (or subclass). This method will retrieve the object factory for the specified [XML Schema type, Java class] pair and call thecreateObject()
method of this factory.- Type Parameters:
T
- the class the created object should be assignable to.- Parameters:
aTypeId
- the XML Schema type for which to create an object.aClass
- the Java class the created object should be assignable to.aDocumentContext
- the document context providing additional information about the document in which the object will be included.- Returns:
- a new object instance for the specified XML Schema type and Java class.
-
getSchemaSet
Returns theTLcdXMLSchemaSet
object containing all XML Schema information used by this mapping.- Returns:
- the
TLcdXMLSchemaSet
object containing all XML Schema information used by this mapping.
-
getTypeObjectFactoryProvider
Returns the schema object factory provider of this mapping.- Returns:
- the schema object factory provider of this mapping.
-
getNamespaceURIs
Returns the set of namespaces which are supported by this mapping.- Returns:
- the set of namespaces which are supported by this mapping.
-
registerNamespaceURI
Registers the specified namespace on this mapping. Namespaces should be registered to indicate that they are supported by this mapping.- Parameters:
aNamespaceURI
- the namespace for which object factories and additional information are registered on this mapping.
-
getJavaClassResolver
Returns theTLcdXMLJavaClassResolver
used by this mapping. SeeTLcdXMLJavaClassResolver
for more information.- Returns:
- the
TLcdXMLJavaClassResolver
used by this mapping.
-
getProperty
Returns the custom property with the specified name.- Parameters:
aName
- the name of the custom property to be returned.- Returns:
- the custom property registered with the specified name.
-
setProperty
Sets the specified custom property on this, to be shared among users of this mapping.- Parameters:
aName
- the name of the custom property to be set.aValue
- the property to be set.
-
getDefaultEntityResolver
Returns the default entity resolver to be used for resolving XML Schemas. The default entity resolver configured on this instance will use the schema locations map of this mapping to search for schema locations.
When the default entity resolver is unable to find a schema (i.e. the
resolveEntity
method returnsnull
), thegetInputStreamFactory()
is used to create an appropriate input stream for the given system id of the schema.- Returns:
- the default entity resolver to be used for resolving XML Schemas.
- See Also:
-
setDefaultEntityResolver
Sets the default entity resolver to be used for resolving XML Schemas.
When the default entity resolver is unable to find a schema (i.e. the
resolveEntity
method returnsnull
), thegetInputStreamFactory()
is used to create an appropriate input stream for the given system id of the schema.- Parameters:
aEntityResolver
- the default entity resolver to be used for resolving XML Schemas.- See Also:
-
getSchemaLocations
Returns a map containing as keys the namespaces of all mapped XML Schemas, and as values their corresponding schema locations.
Note that the values for the schema locations should be valid URI's and as such contain no spaces and other control characters.
- Returns:
- a map with a [namespace, schema location] pair for each mapped XML Schema.
-
configure
Configures this mapping for the given data model and all its dependencies. Configuration is done using all
ILcdXMLSchemaBasedMappingLibrary
instances that are annotated (seeTLcdXMLSchemaMappingAnnotation
) on the given data model and its dependencies.Note that creating a new mapping and configuring it with a data model is equivalent to creating a mapping with the mapping libraries of the data model and all its dependencies as constructor parameters.
- Parameters:
aDataModel
- the data model for which this mapping is to be configured
-
setInputStreamFactory
Sets the
ILcdInputStreamFactory
that is used to create input streams for schemas that are not handled by the default entity resolver.If the default entity resolver is
ILcdInputStreamFactoryCapable
then the input stream of the entity resolver is also set to this input stream.- Specified by:
setInputStreamFactory
in interfaceILcdInputStreamFactoryCapable
- Parameters:
aInputStreamFactory
- the input stream factory that will be used to resolve schemas- See Also:
-
getInputStreamFactory
Returns theILcdInputStreamFactory
that is used to create input streams for schemas that are not handled by the default entity resolver.- Specified by:
getInputStreamFactory
in interfaceILcdInputStreamFactoryCapable
- Returns:
- aInputStreamFactory the input stream factory that will be used to resolve schemas
- See Also:
-