public class IlrXmlDefaultDataDriver extends IlrXmlDefaultSchemaDriver implements IlrXmlDataDriver
IlrXmlDataDriver
interface. It translates an XML Schema to an eXecution Object Model (XOM). It
then loads an XML data file and represents it as an IlrXmlObject.
It also saves an IlrXmlObject as an XML data file.
The XML driver creation may be parametrized by a configuration resource file. The resource file can set the XML parser, the list of XML directories scanned by the parser, and the inner class policy.
IlrXmlObject,
IlrXmlModel,
IlrXmlErrorException,
IlrReflect| Constructor and Description |
|---|
IlrXmlDefaultDataDriver()
Builds an instance with an empty default object model.
|
IlrXmlDefaultDataDriver(IlrReflect model)
Builds an instance based on an external object model.
|
IlrXmlDefaultDataDriver(IlrReflect model,
IlrResources resources)
Builds an instance with an object model and a resource file.
|
IlrXmlDefaultDataDriver(IlrResources resources)
Builds an instance with an empty default object model.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
assertObjects(IlrXmlObject object,
IlrContext context,
java.lang.String[] classNames)
Asserts XML Objects of a tree in a context.
|
void |
end()
Disposes properly the allocated memory.
|
IlrXmlModel |
getXmlModel()
Gets the reflection model over dynamic class and instances.
|
IlrXmlObject |
readObject(java.io.InputStream objectIs)
Reads an XML document to create an
IlrXmlObject Java
instance given the mapping contained in the driver model. |
IlrXmlObject |
readObject(java.io.Reader objectReader)
Reads an XML document to create an
IlrXmlObject Java
instance given the mapping contained in the driver model. |
void |
setModel(IlrReflect model,
boolean resetErrors)
Sets a new object model for the driver.
|
void |
writeObject(IlrXmlObject object,
java.io.Writer objectWriter)
Writes an
IlrXmlObject instance as an XML document given
the Java/XML mapping defined in the driver object model. |
createDocumentDriver, getErrors, getModel, getWarnings, loadModel, loadModel, loadModels, setModelclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateDocumentDriver, getErrors, getModel, getWarnings, loadModel, loadModel, loadModels, setModelgetErrors, getModel, getWarnings, readObjectpublic IlrXmlDefaultDataDriver()
throws IlrXmlErrorException
IlrXmlErrorException - when the building is impossible.public IlrXmlDefaultDataDriver(IlrResources resources) throws IlrXmlErrorException
IlrXmlErrorException - if the building fails.resources - Used to initialize the driver.public IlrXmlDefaultDataDriver(IlrReflect model) throws IlrXmlErrorException
IlrXmlErrorException - if the building fails.model - The object model to be used by the driver.public IlrXmlDefaultDataDriver(IlrReflect model, IlrResources resources) throws IlrXmlErrorException
IlrXmlErrorException - if the building fails.model - The XOM.resources - Used to initialize the driver.public void setModel(IlrReflect model, boolean resetErrors) throws IlrXmlErrorException
IlrXmlErrorException - thrown when the model is invalidmodel - the new driver object model.public IlrXmlObject readObject(java.io.Reader objectReader) throws IlrXmlErrorException
IlrXmlObject Java
instance given the mapping contained in the driver model.readObject in interface IlrXmlDocumentDriverIlrXmlErrorException - thrown when the reading fails.objectReader - The reader containing the XML document.public IlrXmlObject readObject(java.io.InputStream objectIs) throws IlrXmlErrorException
IlrXmlObject Java
instance given the mapping contained in the driver model.readObject in interface IlrXmlDocumentDriverIlrXmlErrorException - thrown when the reading fails.objectIs - The input stream containing the XML document.public void writeObject(IlrXmlObject object, java.io.Writer objectWriter) throws IlrXmlErrorException
IlrXmlObject instance as an XML document given
the Java/XML mapping defined in the driver object model.writeObject in interface IlrXmlDocumentDriverIlrXmlErrorException - thrown when the writing fails.object - The default object to be written.objectWriter - The XML document writer.public static void assertObjects(IlrXmlObject object, IlrContext context, java.lang.String[] classNames) throws IlrXmlErrorException
IlrXmlErrorException - when a class does not belong to the context model.object - The object root.context - The context where the objects are asserted.classNames - The class name to be explored or asserted. If null, the
default class is explored and asserted.IlrXmlObjectAsserterpublic void end()
end in interface IlrXmlDocumentDriverend in interface IlrXmlSchemaDriverend in class IlrXmlDefaultSchemaDriverpublic IlrXmlModel getXmlModel()
getXmlModel in interface IlrXmlDocumentDrivergetXmlModel in interface IlrXmlSchemaDrivergetXmlModel in class IlrXmlDefaultSchemaDriver© Copyright IBM Corp. 1987, 2017