|
Rule Execution Server API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ilog.rules.xml.binding.IlrXmlDefaultSchemaDriver ilog.rules.xml.binding.IlrXmlDefaultDataDriver
public class IlrXmlDefaultDataDriver
This class is the default implementation of the 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 Summary | |
---|---|
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. |
Method Summary | |
---|---|
static void |
assertObjects(IlrXmlObject object,
IlrContext context,
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(InputStream objectIs)
Reads an XML document to create an IlrXmlObject Java
instance given the mapping contained in the driver model. |
IlrXmlObject |
readObject(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,
Writer objectWriter)
Writes an IlrXmlObject instance as an XML document given
the Java/XML mapping defined in the driver object model. |
Methods inherited from class ilog.rules.xml.binding.IlrXmlDefaultSchemaDriver |
---|
createDocumentDriver, getErrors, getModel, getWarnings, loadModel, loadModel, loadModels, setModel |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface ilog.rules.xml.IlrXmlSchemaDriver |
---|
createDocumentDriver, getErrors, getModel, getWarnings, loadModel, loadModel, loadModels, setModel |
Methods inherited from interface ilog.rules.xml.IlrXmlDocumentDriver |
---|
getErrors, getModel, getWarnings, readObject |
Constructor Detail |
---|
public 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.Method Detail |
---|
public void setModel(IlrReflect model, boolean resetErrors) throws IlrXmlErrorException
IlrXmlErrorException
- thrown when the model is invalidmodel
- the new driver object model.public IlrXmlObject readObject(Reader objectReader) throws IlrXmlErrorException
IlrXmlObject
Java
instance given the mapping contained in the driver model.
readObject
in interface IlrXmlDocumentDriver
IlrXmlErrorException
- thrown when the reading fails.objectReader
- The reader containing the XML document.
public IlrXmlObject readObject(InputStream objectIs) throws IlrXmlErrorException
IlrXmlObject
Java
instance given the mapping contained in the driver model.
readObject
in interface IlrXmlDocumentDriver
IlrXmlErrorException
- thrown when the reading fails.objectIs
- The input stream containing the XML document.
public void writeObject(IlrXmlObject object, Writer objectWriter) throws IlrXmlErrorException
IlrXmlObject
instance as an XML document given
the Java/XML mapping defined in the driver object model.
writeObject
in interface IlrXmlDocumentDriver
IlrXmlErrorException
- 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, 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.IlrXmlObjectAsserter
public void end()
end
in interface IlrXmlDocumentDriver
end
in interface IlrXmlSchemaDriver
end
in class IlrXmlDefaultSchemaDriver
public IlrXmlModel getXmlModel()
getXmlModel
in interface IlrXmlDocumentDriver
getXmlModel
in interface IlrXmlSchemaDriver
getXmlModel
in class IlrXmlDefaultSchemaDriver
|
Rule Execution Server API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |