ilog.rules.xml.binding

Class IlrXmlDefaultSchemaDriver

  • java.lang.Object
    • ilog.rules.xml.binding.IlrXmlDefaultSchemaDriver
  • All Implemented Interfaces:
    IlrXmlSchemaDriver
    Direct Known Subclasses:
    IlrXmlDefaultDataDriver


    public class IlrXmlDefaultSchemaDriver
    extends java.lang.Object
    implements IlrXmlSchemaDriver
    This class is the default implementation of the IlrXmlSchemaDriver interface. It translates an XML Schema to an Execution Object Model (XOM).

    The XML schema driver creation may be parameterized 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.

    See Also:
    IlrXmlErrorException, IlrReflect
    • Constructor Detail

      • IlrXmlDefaultSchemaDriver

        public IlrXmlDefaultSchemaDriver(IlrReflect model,
                                 IlrResources resources)
                                  throws IlrXmlErrorException
        Build an instance with an object model and a resource file.
        Throws:
        IlrXmlErrorException - if the building fails.
        Parameters:
        model - The XOM.
        resources - Used to initialize the driver.
      • IlrXmlDefaultSchemaDriver

        public IlrXmlDefaultSchemaDriver(IlrResources resources)
                                  throws IlrXmlErrorException
        Build an instance with an empty default object model.
        Throws:
        IlrXmlErrorException - if the building fails.
        Parameters:
        resources - Used to initialize the driver.
      • IlrXmlDefaultSchemaDriver

        public IlrXmlDefaultSchemaDriver(IlrReflect model)
                                  throws IlrXmlErrorException
        Build an instance based on an external object model. The model resources, if they exist, are processed to set-up the driver.
        Throws:
        IlrXmlErrorException - if the building fails.
        Parameters:
        model - The object model to be used by the driver.
      • IlrXmlDefaultSchemaDriver

        public IlrXmlDefaultSchemaDriver()
                                  throws IlrXmlErrorException
        Build an instance with an empty default object model.
        Throws:
        IlrXmlErrorException - when the building is impossible.
    • Method Detail

      • getWarnings

        public IlrXmlError[] getWarnings()
        Get the warnings generated during the last model loading operation.
        Specified by:
        getWarnings in interface IlrXmlSchemaDriver
        Returns:
        a list of warnings.
      • getErrors

        public IlrXmlError[] getErrors()
        Get the errors generated during the last model loading operation.
        Specified by:
        getErrors in interface IlrXmlSchemaDriver
        Returns:
        a list of errors.
      • loadModel

        public IlrReflect loadModel(java.io.Reader reader,
                           java.lang.String packageName)
                             throws IlrXmlErrorException
        Load an XML Schema and convert it into an IlrReflect model. An IlrXmlErrorException is thrown when the parsing or the model conversion fails.
        Specified by:
        loadModel in interface IlrXmlSchemaDriver
        Throws:
        IlrXmlErrorException
        Parameters:
        reader - The reader of the XML information.
        packageName - The package name of the converted classes.
        Returns:
        the XOM.
      • loadModel

        public IlrReflect loadModel(org.xml.sax.InputSource schemaSrc,
                           IlrXmlNsResolver nsToPackage)
                             throws IlrXmlErrorException
        Load an XML Schema and convert it into an IlrReflect model. An IlrXmlErrorException is thrown when the parsing or the model conversion fails.
        Specified by:
        loadModel in interface IlrXmlSchemaDriver
        Throws:
        IlrXmlErrorException
        Parameters:
        schemaSrc - The location of the schema to be loaded. To obtain better error localization and schema importation, the system and public identification should be set.
        nsToPackage - The package resolver that converts a namespace into a package name. If null, the loaded classes are put in the default package.
        Returns:
        the XOM.
      • loadModels

        public IlrReflect loadModels(org.xml.sax.InputSource[] schemaSrcs,
                            IlrXmlNsResolver nsToPackage)
                              throws IlrXmlErrorException
        Load a set of XML Schema and convert it into an IlrReflect model. An IlrXmlErrorException is thrown when the parsing or the model conversion fails.
        Specified by:
        loadModels in interface IlrXmlSchemaDriver
        Throws:
        IlrXmlErrorException
        Parameters:
        schemaSrcs - The location of the schemas to be loaded. To obtain better error localization and schema importation, the system and public identification should be set.
        nsToPackage - The package resolver that converts a namespace into a package name. If null, the loaded classes are put in the default package.
        Returns:
        the XOM.
      • end

        public void end()
        Dispose properly the allocated memory.
        Specified by:
        end in interface IlrXmlSchemaDriver

© Copyright IBM Corp. 1987, 2017