public class TLcdXMLSchemaBasedMapping extends Object implements ILcdInputStreamFactoryCapable
this package's documentation
and the
com.luciad.format.xml.bind package documentation
for a general
overview of the XML Binding Framework.Constructor and Description |
---|
TLcdXMLSchemaBasedMapping()
Creates a new, empty
com.luciad.format.xml.bind.schema.TLcdXMLSchemaMapping . |
TLcdXMLSchemaBasedMapping(ILcdXMLSchemaBasedMappingLibrary... aLibrary)
Creates a new
com.luciad.format.xml.bind.schema.TLcdXMLSchemaMapping for the specified mapping
libraries. |
TLcdXMLSchemaBasedMapping(ILcdXMLSchemaBasedMappingLibrary aLibrary)
Creates a new
com.luciad.format.xml.bind.schema.TLcdXMLSchemaMapping for the specified mapping
library. |
TLcdXMLSchemaBasedMapping(List<ILcdXMLSchemaBasedMappingLibrary> aLibrary)
Creates a new
com.luciad.format.xml.bind.schema.TLcdXMLSchemaMapping for the specified mapping
libraries. |
Modifier and Type | Method and Description |
---|---|
void |
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).
|
EntityResolver2 |
getDefaultEntityResolver()
Returns the default entity resolver to be used for resolving XML Schemas.
|
ILcdInputStreamFactory |
getInputStreamFactory()
Returns the
ILcdInputStreamFactory that is used to create input streams
for schemas that are not handled by the default entity resolver. |
TLcdXMLJavaClassResolver |
getJavaClassResolver()
Returns the
TLcdXMLJavaClassResolver used by this mapping. |
Set<String> |
getNamespaceURIs()
Returns the set of namespaces which are supported by this mapping.
|
Object |
getProperty(String aName)
Returns the custom property with the specified name.
|
Map<String,String> |
getSchemaLocations()
Returns a map containing as keys the namespaces of all mapped XML Schemas, and as values their
corresponding schema locations.
|
TLcdXMLSchemaSet |
getSchemaSet()
Returns the
TLcdXMLSchemaSet object containing all XML Schema information used by this
mapping. |
TLcdXMLTypeObjectFactoryProvider |
getTypeObjectFactoryProvider()
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 the
ILcdInputStreamFactory 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.
|
public TLcdXMLSchemaBasedMapping()
com.luciad.format.xml.bind.schema.TLcdXMLSchemaMapping
.public TLcdXMLSchemaBasedMapping(ILcdXMLSchemaBasedMappingLibrary aLibrary)
com.luciad.format.xml.bind.schema.TLcdXMLSchemaMapping
for the specified mapping
library.aLibrary
- the mapping library for which to create a mapping.public TLcdXMLSchemaBasedMapping(List<ILcdXMLSchemaBasedMappingLibrary> aLibrary)
com.luciad.format.xml.bind.schema.TLcdXMLSchemaMapping
for the specified mapping
libraries.aLibrary
- the mapping libraries for which to create a mapping.public TLcdXMLSchemaBasedMapping(ILcdXMLSchemaBasedMappingLibrary... aLibrary)
com.luciad.format.xml.bind.schema.TLcdXMLSchemaMapping
for the specified mapping
libraries.aLibrary
- the mapping libraries for which to create a mapping.public <T> T createObject(TLcdXMLSchemaTypeIdentifier aTypeId, Class<T> aClass, ILcdXMLDocumentContext aDocumentContext)
createObject()
method of this factory.T
- the class the created object should be assignable to.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.public TLcdXMLSchemaSet getSchemaSet()
TLcdXMLSchemaSet
object containing all XML Schema information used by this
mapping.TLcdXMLSchemaSet
object containing all XML Schema information used by this
mapping.public TLcdXMLTypeObjectFactoryProvider getTypeObjectFactoryProvider()
public Set<String> getNamespaceURIs()
public void registerNamespaceURI(String aNamespaceURI)
aNamespaceURI
- the namespace for which object factories and additional information are registered on
this mapping.public TLcdXMLJavaClassResolver getJavaClassResolver()
TLcdXMLJavaClassResolver
used by this mapping. See TLcdXMLJavaClassResolver
for more information.TLcdXMLJavaClassResolver
used by this mapping.public Object getProperty(String aName)
aName
- the name of the custom property to be returned.public void setProperty(String aName, Object aValue)
aName
- the name of the custom property to be set.aValue
- the property to be set.public EntityResolver2 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
returns null
), the getInputStreamFactory()
is used to
create an appropriate input stream for the given system id of the schema.
setDefaultEntityResolver(EntityResolver2)
public void setDefaultEntityResolver(EntityResolver2 aEntityResolver)
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
returns null
), the getInputStreamFactory()
is used to
create an appropriate input stream for the given system id of the schema.
aEntityResolver
- the default entity resolver to be used for resolving XML Schemas.getDefaultEntityResolver()
public Map<String,String> 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.
public void configure(TLcdDataModel aDataModel)
Configures this mapping for the given data model and all its
dependencies. Configuration is done using all ILcdXMLSchemaBasedMappingLibrary
instances that are annotated (see TLcdXMLSchemaMappingAnnotation
)
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.
aDataModel
- the data model for which this mapping is to be configuredpublic void setInputStreamFactory(ILcdInputStreamFactory aInputStreamFactory)
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.
setInputStreamFactory
in interface ILcdInputStreamFactoryCapable
aInputStreamFactory
- the input stream factory that will be used to resolve schemasgetInputStreamFactory()
public ILcdInputStreamFactory getInputStreamFactory()
ILcdInputStreamFactory
that is used to create input streams
for schemas that are not handled by the default entity resolver.getInputStreamFactory
in interface ILcdInputStreamFactoryCapable
setInputStreamFactory(ILcdInputStreamFactory)