ilog.rules.vocabulary.model.bom.io

Class IlrBOMVocabularyIOHelper

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


  • public class IlrBOMVocabularyIOHelper
    extends java.lang.Object
    Use IlrBOMVocabularyIOHelper to read and write BOM and Vocabularies in various formats. The BOM is written and read in a Java-like format, vocabularies in XML and Properties format. XML read by readBOMVocabulary must be compliant to the Vocx XML schema. In Properties format, vocabulary elements are saved as key,value pairs in a UTF-8 stream.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      static IlrBOMVocabulary readBOMVocabulary(java.io.Reader vocXmlReader, boolean includeBoot)
      Creates a vocabulary from a vocabulary reader.
      static IlrBOMVocabulary readBOMVocabulary(java.io.Reader bomReader, java.io.Reader vocReader, java.util.Locale locale, boolean includeBoot)
      Creates a vocabulary from a BOM and a vocabulary reader.
      static void writeBOMVocabulary(IlrBOMVocabulary vocabulary, java.io.Writer vocWriter, boolean xml)
      Writes a vocabulary to a writer output either in XML or Properties format.
      static void writeBOMVocabulary(IlrBOMVocabulary vocabulary, java.io.Writer bomWriter, java.io.Writer vocWriter, boolean xml)
      Writes a vocabulary to different outputs.
      • Methods inherited from class java.lang.Object

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

      • IlrBOMVocabularyIOHelper

        public IlrBOMVocabularyIOHelper()
    • Method Detail

      • writeBOMVocabulary

        public static void writeBOMVocabulary(IlrBOMVocabulary vocabulary,
                              java.io.Writer vocWriter,
                              boolean xml)
                                       throws java.io.IOException,
                                              javax.xml.parsers.ParserConfigurationException
        Writes a vocabulary to a writer output either in XML or Properties format.
        Throws:
        java.io.IOException - when a write action to one of the writers fails.
        javax.xml.parsers.ParserConfigurationException - when writing the XML representation of the vocabulary fails.
        Parameters:
        vocabulary - The vocabulary to write.
        vocWriter - A writer used to write an XML or Properties representation of vocabulary. If null, no vocabulary is written.
        xml - Set to true to generate an XML representation of the vocabulary. Set to false for a Properties representation.
      • writeBOMVocabulary

        public static void writeBOMVocabulary(IlrBOMVocabulary vocabulary,
                              java.io.Writer bomWriter,
                              java.io.Writer vocWriter,
                              boolean xml)
                                       throws java.io.IOException,
                                              javax.xml.parsers.ParserConfigurationException
        Writes a vocabulary to different outputs.
        Throws:
        java.io.IOException - when a write action to one of the writers fails.
        javax.xml.parsers.ParserConfigurationException - when writing the XML representation of the vocabulary fails.
        Parameters:
        vocabulary - The vocabulary to write.
        bomWriter - A writer used to write a Java-like representation of the underlying object model. If null, no BOM is written.
        vocWriter - A writer used to write an XML or Properties representation of vocabulary. If null, no vocabulary is written.
        xml - Set to true to generate an XML representation of the vocabulary. Set to false for a Properties representation.
      • readBOMVocabulary

        public static IlrBOMVocabulary readBOMVocabulary(java.io.Reader bomReader,
                                         java.io.Reader vocReader,
                                         java.util.Locale locale,
                                         boolean includeBoot)
                                                  throws java.io.IOException,
                                                         IlrSyntaxError,
                                                         IlrSerializerError
        Creates a vocabulary from a BOM and a vocabulary reader.
        Throws:
        IlrSyntaxError
        java.io.IOException
        IlrSerializerError
        Parameters:
        bomReader - A reader containing the BOM in a Java-like format.
        vocReader - A reader containing the vocabulary in Properties format.
        locale - The locale this vocabulary is created for.
        includeBoot - Set to true so the returned vocabulary contains the boot.
        Returns:
        A vocabulary.
      • readBOMVocabulary

        public static IlrBOMVocabulary readBOMVocabulary(java.io.Reader vocXmlReader,
                                         boolean includeBoot)
        Creates a vocabulary from a vocabulary reader.
        Parameters:
        vocXmlReader - A reader containing the vocabulary in Vocx XML format.
        includeBoot - Set to true so the returned vocabulary contains the boot.
        Returns:
        A vocabulary.

© Copyright IBM Corp. 1987, 2017