StAXDocumentSerializerpublic interface LowLevelFastInfosetStreamWriter
This interface provides additional stream-based serialization methods for the case where an application is in specific control of the serialization process and has the knowledge to call the LowLevel methods in the required order.
For example, the application may be able to perform efficient information to indexing mapping and to provide certain information in UTF-8 encoded form.
These methods may be used in conjuction with XMLStreamWriter
as long as an element fragment written using the efficient streaming methods
are self-contained and no sub-fragment is written using methods from
XMLStreamWriter.
The required call sequence is as follows:
CALLSEQUENCE :=startDocumentinitiateLowLevelWriting ELEMENTendDocument| initiateLowLevelWriting ELEMENT // for fragment ELEMENT := writeLowLevelTerminationAndMark NAMESPACES? ELEMENT_NAME ATTRIBUTES? writeLowLevelEndStartElement CONTENTS writeLowLevelEndElement NAMESPACES := writeLowLevelStartNamespaces writeLowLevelNamespace* writeLowLevelEndNamespaces ELEMENT_NAME := writeLowLevelStartElementIndexed | writeLowLevelStartNameLiteral | writeLowLevelStartElement ATTRUBUTES := writeLowLevelStartAttributes (ATTRIBUTE_NAME writeLowLevelAttributeValue)* ATTRIBUTE_NAME := writeLowLevelAttributeIndexed | writeLowLevelStartNameLiteral | writeLowLevelAttribute CONTENTS := (ELEMENT | writeLowLevelText writeLowLevelOctets)*
Some methods defer to the application for the mapping of information to indexes.
| Modifier and Type | Method | Description |
|---|---|---|
int |
getLocalNameIndex() |
Get the current index that was applied to an [local name] of an
Element or Attribute Information Item.
|
int |
getNextAttributeIndex() |
Get the next index to apply to an Attribute Information Item.
|
int |
getNextElementIndex() |
Get the next index to apply to an Element Information Item.
|
int |
getNextLocalNameIndex() |
Get the next index to apply to an [local name] of an Element or Attribute
Information Item.
|
void |
initiateLowLevelWriting() |
Initiate low level writing of an element fragment.
|
boolean |
writeLowLevelAttribute(java.lang.String prefix,
java.lang.String namespaceURI,
java.lang.String localName) |
Write an attribute.
|
void |
writeLowLevelAttributeIndexed(int index) |
|
void |
writeLowLevelAttributeValue(java.lang.String value) |
|
void |
writeLowLevelEndElement() |
|
void |
writeLowLevelEndNamespaces() |
|
void |
writeLowLevelEndStartElement() |
|
void |
writeLowLevelNamespace(java.lang.String prefix,
java.lang.String namespaceName) |
|
void |
writeLowLevelOctets(byte[] octets,
int length) |
|
void |
writeLowLevelStartAttributes() |
|
boolean |
writeLowLevelStartElement(int type,
java.lang.String prefix,
java.lang.String localName,
java.lang.String namespaceURI) |
Write the start of an element.
|
void |
writeLowLevelStartElementIndexed(int type,
int index) |
|
void |
writeLowLevelStartNameLiteral(int type,
java.lang.String prefix,
byte[] utf8LocalName,
java.lang.String namespaceURI) |
|
void |
writeLowLevelStartNameLiteral(int type,
java.lang.String prefix,
int localNameIndex,
java.lang.String namespaceURI) |
|
void |
writeLowLevelStartNamespaces() |
|
void |
writeLowLevelTerminationAndMark() |
|
void |
writeLowLevelText(char[] text,
int length) |
|
void |
writeLowLevelText(java.lang.String text) |
void initiateLowLevelWriting()
throws javax.xml.stream.XMLStreamException
This method must be invoked before other low level method.
javax.xml.stream.XMLStreamExceptionint getNextElementIndex()
This will increment the next obtained index such that:
i = w.getNextElementIndex(); j = w.getNextElementIndex(); i == j + 1;
int getNextAttributeIndex()
i = w.getNextAttributeIndex(); j = w.getNextAttributeIndex(); i == j + 1;
int getLocalNameIndex()
int getNextLocalNameIndex()
i = w.getNextLocalNameIndex(); j = w.getNextLocalNameIndex(); i == j + 1;
void writeLowLevelTerminationAndMark()
throws java.io.IOException
java.io.IOExceptionvoid writeLowLevelStartElementIndexed(int type,
int index)
throws java.io.IOException
java.io.IOExceptionboolean writeLowLevelStartElement(int type,
java.lang.String prefix,
java.lang.String localName,
java.lang.String namespaceURI)
throws java.io.IOException
java.io.IOExceptionvoid writeLowLevelStartNamespaces()
throws java.io.IOException
java.io.IOExceptionvoid writeLowLevelNamespace(java.lang.String prefix,
java.lang.String namespaceName)
throws java.io.IOException
java.io.IOExceptionvoid writeLowLevelEndNamespaces()
throws java.io.IOException
java.io.IOExceptionvoid writeLowLevelStartAttributes()
throws java.io.IOException
java.io.IOExceptionvoid writeLowLevelAttributeIndexed(int index)
throws java.io.IOException
java.io.IOExceptionboolean writeLowLevelAttribute(java.lang.String prefix,
java.lang.String namespaceURI,
java.lang.String localName)
throws java.io.IOException
java.io.IOExceptionvoid writeLowLevelAttributeValue(java.lang.String value)
throws java.io.IOException
java.io.IOExceptionvoid writeLowLevelStartNameLiteral(int type,
java.lang.String prefix,
byte[] utf8LocalName,
java.lang.String namespaceURI)
throws java.io.IOException
java.io.IOExceptionvoid writeLowLevelStartNameLiteral(int type,
java.lang.String prefix,
int localNameIndex,
java.lang.String namespaceURI)
throws java.io.IOException
java.io.IOExceptionvoid writeLowLevelEndStartElement()
throws java.io.IOException
java.io.IOExceptionvoid writeLowLevelEndElement()
throws java.io.IOException
java.io.IOExceptionvoid writeLowLevelText(char[] text,
int length)
throws java.io.IOException
java.io.IOExceptionvoid writeLowLevelText(java.lang.String text)
throws java.io.IOException
java.io.IOExceptionvoid writeLowLevelOctets(byte[] octets,
int length)
throws java.io.IOException
java.io.IOExceptionCopyright © 2018 Oracle Corporation. All rights reserved.