ilog.rules.vocabulary.model.bom.io

Class IlrBOMVocabularyXMLReader

  • java.lang.Object
    • ilog.rules.vocabulary.model.bom.io.IlrBOMVocabularyXMLReader


  • public class IlrBOMVocabularyXMLReader
    extends java.lang.Object
    IlrBOMVocabularyXMLReader implements an XML reader that loads BOM vocabularies represented as Vocx schema compliant XML documents. Call readVocabulary() or readVocabularies() to create one or more more vocabularies. The readVocabularies methods create a set of vocabularies for different locales associated to the same BOM.

    Note: processing errors can be raised while reading the XML documents. For more information, see reportError().

    • Method Summary

      Methods 
      Modifier and Type Method and Description
      IlrVocabulary[] readVocabularies(org.w3c.dom.Element[] roots)
      Creates a set of vocabularies by reading the XML documents represented by an array of DOM root nodes.
      IlrVocabulary[] readVocabularies(java.io.Reader[] readers)
      Creates a set of vocabularies by reading the XML documents represented by the given readers.
      IlrVocabulary readVocabulary(org.w3c.dom.Element root)
      Creates a vocabulary by reading the XML document represented by the given DOM root node.
      IlrVocabulary readVocabulary(java.io.Reader reader)
      Creates a Vocabulary by reading the XML document stored in a reader.
      protected void reportError(java.lang.String errorKey, java.lang.Object[] args)
      Called when a error is encountered while processing the XML documents used to create vocabularies.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • IlrBOMVocabularyXMLReader

        public IlrBOMVocabularyXMLReader()
        Creates a Vocabulary XML Reader.
    • Method Detail

      • readVocabulary

        public IlrVocabulary readVocabulary(java.io.Reader reader)
        Creates a Vocabulary by reading the XML document stored in a reader.
        Parameters:
        reader - A java.io.Reader that holds the XML document.
        Returns:
        A vocabulary populated from the reader content.
      • readVocabulary

        public IlrVocabulary readVocabulary(org.w3c.dom.Element root)
        Creates a vocabulary by reading the XML document represented by the given DOM root node.
        Parameters:
        root - The Vocabulary DOM root node.
        Returns:
        A vocabulary populated from the DOM document content, starting at the given root node.
      • readVocabularies

        public IlrVocabulary[] readVocabularies(java.io.Reader[] readers)
        Creates a set of vocabularies by reading the XML documents represented by the given readers.
        Parameters:
        readers - An array of Reader objects.
        Returns:
        An array of vocabularies populated from the DOM documents content read from the corresponding readers. The number of returned vocabularies is equal to the number of readers.
      • readVocabularies

        public IlrVocabulary[] readVocabularies(org.w3c.dom.Element[] roots)
        Creates a set of vocabularies by reading the XML documents represented by an array of DOM root nodes.
        Parameters:
        roots - An array of Vocabulary DOM root nodes.
        Returns:
        An array of vocabularies populated from the DOM document content that starts at the given root nodes. The number of returned vocabularies is equal to the number of DOM root nodes.
      • reportError

        protected void reportError(java.lang.String errorKey,
                       java.lang.Object[] args)
        Called when a error is encountered while processing the XML documents used to create vocabularies. This default implementation throws a RuntimeException. The message contained in the exception explains the cause of the error.

        Override this method in order to process errors differently.

© Copyright IBM Corp. 1987, 2017