com.format.xml
API has been deprecated. Instead, use the com.format.xml.bind
API.public class TLcdXMLEncoder extends Object implements ILcdOutputStreamFactoryCapable
ILcdXMLElementAdapter
's, provided by an ILcdXMLElementAdapterProvider
.
The encoder will retrieve a element adapter for the root object, query its XML name and attributes
and write them away. Subsequently, it will request the XML child contents via the adapter, and,
for each child, retrieve the corresponding child adapter. This way, the whole XML document
is traversed recursively, for each element writing the name, elements and child elements to
the outputstream.Constructor and Description |
---|
TLcdXMLEncoder()
Deprecated.
Creates a new
TLcdXMLEncoder instance. |
Modifier and Type | Method and Description |
---|---|
void |
encodeXML(Object aObject,
String aDestination)
Deprecated.
Encodes the given object to the given destination.
|
String |
getDefaultNamespace()
Deprecated.
Returns the default namespace used for encoding.
|
ILcdXMLElementAdapterProvider |
getElementAdapterProvider()
Deprecated.
Returns the currently used
ILcdXMLElementAdapterProvider instance. |
ILcdXMLElementNameProvider |
getElementNameProvider()
Deprecated.
an element name provider is no longer used by the encoder.
|
ILcdOutputStreamFactory |
getOutputStreamFactory()
Deprecated.
Returns the output stream factory that is currently used for creating output streams given source
names.
|
ILcdXMLPrefixMap |
getPrefixMap()
Deprecated.
Returns the prefix map used by this encoder.
|
ILcdXMLSchemaLocationsMap |
getSchemaLocationsMap()
Deprecated.
Returns the schema locations used for encoding.
|
void |
setDefaultNamespace(String aDefaultNamespace)
Deprecated.
Sets the default namespace to be used during the encoding.
|
void |
setElementAdapterProvider(ILcdXMLElementAdapterProvider aElementAdapterProvider)
Deprecated.
Sets the
ILcdXMLElementAdapterProvider instance to be used. |
void |
setElementNameProvider(ILcdXMLElementNameProvider aElementNameProvider)
Deprecated.
an element name provider is no longer used by the encoder.
|
void |
setOutputStreamFactory(ILcdOutputStreamFactory aOutputStreamFactory)
Deprecated.
Sets the output stream factory that will be used for creating output streams given source names.
|
void |
setPrefixMap(ILcdXMLPrefixMap aPrefixMap)
Deprecated.
Sets the mapping from namespace to prefix to be used in the encoding.
|
void |
setSchemaLocationsMap(ILcdXMLSchemaLocationsMap aSchemaLocationsMap)
Deprecated.
Sets the locations of the schemas that are used in the XML document.
|
public TLcdXMLEncoder()
TLcdXMLEncoder
instance.public ILcdXMLElementNameProvider getElementNameProvider()
ILcdXMLElementNameProvider
instance.ILcdXMLElementNameProvider
instance.public void setElementNameProvider(ILcdXMLElementNameProvider aElementNameProvider)
ILcdXMLElementNameProvider
instance to be used.aElementNameProvider
- the ILcdXMLElementNameProvider
instance to be used.public ILcdXMLElementAdapterProvider getElementAdapterProvider()
ILcdXMLElementAdapterProvider
instance.ILcdXMLElementAdapterProvider
instance.public void setElementAdapterProvider(ILcdXMLElementAdapterProvider aElementAdapterProvider)
ILcdXMLElementAdapterProvider
instance to be used.aElementAdapterProvider
- the ILcdXMLElementAdapterProvider
instance to be used.public void setOutputStreamFactory(ILcdOutputStreamFactory aOutputStreamFactory)
setOutputStreamFactory
in interface ILcdOutputStreamFactoryCapable
aOutputStreamFactory
- the output stream factory to be used.NullPointerException
- if aOutputStreamFactory == null
.public ILcdOutputStreamFactory getOutputStreamFactory()
getOutputStreamFactory
in interface ILcdOutputStreamFactoryCapable
setDefaultNamespace(String)
public void setPrefixMap(ILcdXMLPrefixMap aPrefixMap)
<prefix:localname>
).
The prefix mappings will be declared via the xmlns:prefix="namespace"
attributes
in the root element of each XML document.
All previously set mappings will be cleared.aPrefixMap
- the mapping to be used by this encoder.public ILcdXMLPrefixMap getPrefixMap()
setPrefixMap(com.luciad.format.xml.ILcdXMLPrefixMap)
public void setSchemaLocationsMap(ILcdXMLSchemaLocationsMap aSchemaLocationsMap)
xsi:schemaLocations="namespace schemaLocation ..."
attribute of the root element.
All previously set locations will be cleared.aSchemaLocationsMap
- the schema locations map to be used by this encoder.public ILcdXMLSchemaLocationsMap getSchemaLocationsMap()
setSchemaLocationsMap(com.luciad.format.xml.schema.ILcdXMLSchemaLocationsMap)
public void setDefaultNamespace(String aDefaultNamespace)
xmlns="defaultNamespace"
.aDefaultNamespace
- the default namespace to be used, or null
if there
is none.public String getDefaultNamespace()
setDefaultNamespace(String)
public void encodeXML(Object aObject, String aDestination) throws IOException
aDestination
- the full path to the source where the object should be writtten.IOException
- thrown if an error occurs during the write process.NullPointerException
- thrown if the object to be encoded is null
.