|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.openexi.sax.Transmogrifier
public final class Transmogrifier
The Transmogrifier converts an XML stream to an EXI stream.
| Constructor Summary | |
|---|---|
Transmogrifier()
Create an instance of the Transmogrifier with a default SAX parser. |
|
Transmogrifier(javax.xml.parsers.SAXParserFactory saxParserFactory)
Create an instance of the Transmogrifier, specifying the SAXParserFactory from which to create the SAX parser. |
|
| Method Summary | |
|---|---|
void |
encode(org.xml.sax.InputSource is)
Parses XML input source and converts it to an EXI stream. |
GrammarCache |
getGrammarCache()
Returns the GrammarCache that was previously set. |
SAXTransmogrifier |
getSAXTransmogrifier()
Returns the SAXTransmogrifier, which implements both the ContentHandler and LexicalHandler. |
void |
setAlignmentType(AlignmentType alignmentType)
Set the bit alignment style for the encoded EXI stream. |
void |
setBlockSize(int blockSize)
Set the size, in number of values, of the information that will be processed as a chunk of the entire XML stream. |
void |
setDatatypeRepresentationMap(QName[] dtrm,
int n_bindings)
Set a datatype representation map (DTRM). |
void |
setEntityResolver(org.xml.sax.EntityResolver entityResolver)
Set an external SAX entity resolver. |
void |
setFragment(boolean isFragment)
Set to true if the XML input stream is an XML fragment (a non-compliant XML document with multiple root elements). |
void |
setGrammarCache(GrammarCache grammarCache)
Set the GrammarCache used in transmogrifying XML data to EXI. |
void |
setGrammarCache(GrammarCache grammarCache,
org.openexi.proc.common.SchemaId schemaId)
Set the GrammarCache to be used in encoding XML streams into EXI streams by the transmogrifier. |
void |
setOutputCookie(boolean outputCookie)
Tells the encoder whether to or not to start the stream by adding an EXI cookie. |
void |
setOutputOptions(HeaderOptionsOutputType outputOptions)
Set the header output options. |
void |
setOutputStream(java.io.OutputStream ostream)
Set an output stream to which encoded streams are written. |
void |
setPreserveLexicalValues(boolean preserveLexicalValues)
Set to true to preserve the original string values from the XML stream. |
void |
setPreserveWhitespaces(boolean preserveWhitespaces)
Set to true to preserve whitespace (for example, spaces, tabs, and line breaks) in the encoded EXI stream. |
void |
setResolveExternalGeneralEntities(boolean resolveExternalGeneralEntities)
Change the way a Transmogrifier handles external general entities. |
void |
setValueMaxLength(int valueMaxLength)
Set the maximum length of a string that will be stored for reuse in the String Table. |
void |
setValuePartitionCapacity(int valuePartitionCapacity)
Set the maximum number of values in the String Table. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Transmogrifier()
throws org.openexi.sax.TransmogrifierRuntimeException
TransmogrifierException
org.openexi.sax.TransmogrifierRuntimeException
public Transmogrifier(javax.xml.parsers.SAXParserFactory saxParserFactory)
throws org.openexi.sax.TransmogrifierRuntimeException
saxParserFactory -
TransmogrifierException
org.openexi.sax.TransmogrifierRuntimeException| Method Detail |
|---|
public void setResolveExternalGeneralEntities(boolean resolveExternalGeneralEntities)
throws TransmogrifierException
resolveExternalGeneralEntities -
TransmogrifierException - Thrown when the underlying XMLReader does not
support the specified behavior.public final void setOutputStream(java.io.OutputStream ostream)
ostream - output stream
public final void setAlignmentType(AlignmentType alignmentType)
throws org.openexi.proc.common.EXIOptionsException
alignmentType - AlignmentType.
Default is bit-packed.
org.openexi.proc.common.EXIOptionsExceptionpublic final void setFragment(boolean isFragment)
isFragment - true if the XML input stream is an XML fragment.
public final void setBlockSize(int blockSize)
throws org.openexi.proc.common.EXIOptionsException
blockSize - number of values in each processing block. Default is 1,000,000.
org.openexi.proc.common.EXIOptionsExceptionpublic final void setValueMaxLength(int valueMaxLength)
valueMaxLength - maximum length of entries in the String Table.public final void setValuePartitionCapacity(int valuePartitionCapacity)
valuePartitionCapacity - maximum number of entries in the String Table
public final void setPreserveLexicalValues(boolean preserveLexicalValues)
throws org.openexi.proc.common.EXIOptionsException
preserveLexicalValues - true to keep original strings intact
org.openexi.proc.common.EXIOptionsException
public final void setGrammarCache(GrammarCache grammarCache)
throws org.openexi.proc.common.EXIOptionsException
grammarCache - GrammarCache
org.openexi.proc.common.EXIOptionsException
public final void setGrammarCache(GrammarCache grammarCache,
org.openexi.proc.common.SchemaId schemaId)
throws org.openexi.proc.common.EXIOptionsException
grammarCache - GrammarCacheschemaId -
org.openexi.proc.common.EXIOptionsExceptionpublic final GrammarCache getGrammarCache()
public final void setDatatypeRepresentationMap(QName[] dtrm,
int n_bindings)
throws org.openexi.proc.common.EXIOptionsException
QName q1 = new QName("xsd:boolean","http://www.w3.org/2001/XMLSchema");
QName q2 = new QName("exi:integer","http://www.w3.org/2009/exi");
QName[] dtrm = new QName[2];
dtrm = {q1, q2}; // Each mapping requires 2 qualified names.
transmogrifierInstance.setDatatypeRepresentationMap(dtrm, 1); // The array, and the number of pairs (1).
dtrm - a sequence of pairs of datatype QName and datatype representation QNamen_bindings - the number of QName pairs
org.openexi.proc.common.EXIOptionsExceptionpublic final void setEntityResolver(org.xml.sax.EntityResolver entityResolver)
entityResolver - EntityResolverpublic final void setOutputCookie(boolean outputCookie)
outputCookie - true to include the EXI cookie
public final void setOutputOptions(HeaderOptionsOutputType outputOptions)
throws org.openexi.proc.common.EXIOptionsException
HeaderOptionsOutputType enumeration.
Options are all, lessSchemaID (that is, all values
except for the SchemaId), or none.
outputOptions - HeaderOptionsOutputType
org.openexi.proc.common.EXIOptionsExceptionpublic final void setPreserveWhitespaces(boolean preserveWhitespaces)
preserveWhitespaces - true to retain whitespace in the encoded EXI stream
public void encode(org.xml.sax.InputSource is)
throws TransmogrifierException,
java.io.IOException
is - XML input source
TransmogrifierException
java.io.IOExceptionpublic SAXTransmogrifier getSAXTransmogrifier()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||