ilog.rules.xml

Class IlrXmlObjectAsserter



  • public class IlrXmlObjectAsserter
    extends IlrXmlObjectExplorer
    This class explores an XML object tree in order to assert some selected objects in a context. It is usually instantiated to explore an XML root object created from an XML document by an IlrXmlDataDriver. The selection and exploration policy is defined by registering the IlrClass of the asserted instances. By default, there is no class registered as selected or explored. Hence, a convenient registration is activated by the registerAllXmlClasses() method. In this case, all the instances of IlrXmlObject are asserted and recursively explored.
    See Also:
    IlrXmlObjectExplorer, IlrXmlObject
    • Constructor Detail

      • IlrXmlObjectAsserter

        public IlrXmlObjectAsserter(IlrContext context)
        Builds an asserter linked to a context.
        Parameters:
        context - The context where the XML objects are inserted.
      • IlrXmlObjectAsserter

        public IlrXmlObjectAsserter(IlrContext context,
                            boolean collectionExplored)
        Builds an asserter linked to a context.
        Parameters:
        context - The context where the XML objects are inserted.
        collectionExplored - Indicates if the collection element of IlrXmlObject are explored, that is, whether the Vector class belongs to the explored classes set.
    • Method Detail

      • registerClass

        public void registerClass(IlrClass clazz)
        Register an IlrClass as an asserted and an explored class.
        Parameters:
        clazz - The class to be asserted or explored.
      • registerClass

        public void registerClass(java.lang.String className)
                           throws IlrXmlErrorException
        Register a class known by its name.
        Throws:
        IlrXmlErrorException - if the class does not exist in the reflect model.
        Parameters:
        className - The class to be asserted or explored.
      • registerAllXmlClasses

        public void registerAllXmlClasses()
                                   throws IlrXmlErrorException
        Register all XML classes (java.util.Vector and ilog.rules.factory.IlrXmlObject) of a reflect instance.
        Throws:
        IlrXmlErrorException - if the default class does not exist in the reflect model.
      • registerCollectionExploration

        public void registerCollectionExploration()
        Register that the collection element of an IlrXmObject is implicitly explored, that is, the Vector class is a member of the explored classes set.
      • registerTreeExploration

        public void registerTreeExploration()
        Register that all the XML tree is explored, that is, the object class is a member of the explored classes set.
      • registerAssertedClass

        public void registerAssertedClass(IlrClass clazz)
        Register a class to activate the assertion of its instances.
        Parameters:
        clazz - The registered dynamic class.
      • registerExploredClass

        public void registerExploredClass(IlrClass clazz)
        Register a class to activate the exploration of its instances.
        Parameters:
        clazz - The registered dynamic class.

© Copyright IBM Corp. 1987, 2019