public class IlrBOMVocabularyIOHelper
extends java.lang.Object
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.| Constructor and Description |
|---|
IlrBOMVocabularyIOHelper() |
| 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.
|
public static void writeBOMVocabulary(IlrBOMVocabulary vocabulary, java.io.Writer vocWriter, boolean xml) throws java.io.IOException, javax.xml.parsers.ParserConfigurationException
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.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.public static void writeBOMVocabulary(IlrBOMVocabulary vocabulary, java.io.Writer bomWriter, java.io.Writer vocWriter, boolean xml) throws java.io.IOException, javax.xml.parsers.ParserConfigurationException
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.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.public static IlrBOMVocabulary readBOMVocabulary(java.io.Reader bomReader, java.io.Reader vocReader, java.util.Locale locale, boolean includeBoot) throws java.io.IOException, IlrSyntaxError, IlrSerializerError
IlrSyntaxErrorjava.io.IOExceptionIlrSerializerErrorbomReader - 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.public static IlrBOMVocabulary readBOMVocabulary(java.io.Reader vocXmlReader, boolean includeBoot)
vocXmlReader - A reader containing the vocabulary in Vocx XML format.includeBoot - Set to true so the returned vocabulary
contains the boot.© Copyright IBM Corp. 1987, 2017