Interface LowLevelFastInfosetStreamWriter
-
- All Known Implementing Classes:
StAXDocumentSerializer
public interface LowLevelFastInfosetStreamWriterLow level Fast Infoset stream writer.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 conjunction with
XMLStreamWriteras long as an element fragment written using the efficient streaming methods are self-contained and no sub-fragment is written using methods fromXMLStreamWriter.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.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intgetLocalNameIndex()Get the current index that was applied to an [local name] of an Element or Attribute Information Item.intgetNextAttributeIndex()Get the next index to apply to an Attribute Information Item.intgetNextElementIndex()Get the next index to apply to an Element Information Item.intgetNextLocalNameIndex()Get the next index to apply to an [local name] of an Element or Attribute Information Item.voidinitiateLowLevelWriting()Initiate low level writing of an element fragment.booleanwriteLowLevelAttribute(String prefix, String namespaceURI, String localName)Write an attribute.voidwriteLowLevelAttributeIndexed(int index)voidwriteLowLevelAttributeValue(String value)voidwriteLowLevelEndElement()voidwriteLowLevelEndNamespaces()voidwriteLowLevelEndStartElement()voidwriteLowLevelNamespace(String prefix, String namespaceName)voidwriteLowLevelOctets(byte[] octets, int length)voidwriteLowLevelStartAttributes()booleanwriteLowLevelStartElement(int type, String prefix, String localName, String namespaceURI)Write the start of an element.voidwriteLowLevelStartElementIndexed(int type, int index)voidwriteLowLevelStartNameLiteral(int type, String prefix, byte[] utf8LocalName, String namespaceURI)voidwriteLowLevelStartNameLiteral(int type, String prefix, int localNameIndex, String namespaceURI)voidwriteLowLevelStartNamespaces()voidwriteLowLevelTerminationAndMark()voidwriteLowLevelText(char[] text, int length)voidwriteLowLevelText(String text)
-
-
-
Method Detail
-
initiateLowLevelWriting
void initiateLowLevelWriting() throws XMLStreamExceptionInitiate low level writing of an element fragment.This method must be invoked before other low level method.
- Throws:
XMLStreamException
-
getNextElementIndex
int getNextElementIndex()
Get the next index to apply to an Element Information Item.This will increment the next obtained index such that:
i = w.getNextElementIndex(); j = w.getNextElementIndex(); i == j + 1;
- Returns:
- the index.
-
getNextAttributeIndex
int getNextAttributeIndex()
Get the next index to apply to an Attribute Information Item. This will increment the next obtained index such that:i = w.getNextAttributeIndex(); j = w.getNextAttributeIndex(); i == j + 1;
- Returns:
- the index.
-
getLocalNameIndex
int getLocalNameIndex()
Get the current index that was applied to an [local name] of an Element or Attribute Information Item.- Returns:
- the index.
-
getNextLocalNameIndex
int getNextLocalNameIndex()
Get the next index to apply to an [local name] of an Element or Attribute Information Item. This will increment the next obtained index such that:i = w.getNextLocalNameIndex(); j = w.getNextLocalNameIndex(); i == j + 1;
- Returns:
- the index.
-
writeLowLevelTerminationAndMark
void writeLowLevelTerminationAndMark() throws IOException- Throws:
IOException
-
writeLowLevelStartElementIndexed
void writeLowLevelStartElementIndexed(int type, int index) throws IOException- Throws:
IOException
-
writeLowLevelStartElement
boolean writeLowLevelStartElement(int type, String prefix, String localName, String namespaceURI) throws IOExceptionWrite the start of an element.- Returns:
- true if element is indexed, otherwise false.
- Throws:
IOException
-
writeLowLevelStartNamespaces
void writeLowLevelStartNamespaces() throws IOException- Throws:
IOException
-
writeLowLevelNamespace
void writeLowLevelNamespace(String prefix, String namespaceName) throws IOException
- Throws:
IOException
-
writeLowLevelEndNamespaces
void writeLowLevelEndNamespaces() throws IOException- Throws:
IOException
-
writeLowLevelStartAttributes
void writeLowLevelStartAttributes() throws IOException- Throws:
IOException
-
writeLowLevelAttributeIndexed
void writeLowLevelAttributeIndexed(int index) throws IOException- Throws:
IOException
-
writeLowLevelAttribute
boolean writeLowLevelAttribute(String prefix, String namespaceURI, String localName) throws IOException
Write an attribute.- Returns:
- true if attribute is indexed, otherwise false.
- Throws:
IOException
-
writeLowLevelAttributeValue
void writeLowLevelAttributeValue(String value) throws IOException
- Throws:
IOException
-
writeLowLevelStartNameLiteral
void writeLowLevelStartNameLiteral(int type, String prefix, byte[] utf8LocalName, String namespaceURI) throws IOException- Throws:
IOException
-
writeLowLevelStartNameLiteral
void writeLowLevelStartNameLiteral(int type, String prefix, int localNameIndex, String namespaceURI) throws IOException- Throws:
IOException
-
writeLowLevelEndStartElement
void writeLowLevelEndStartElement() throws IOException- Throws:
IOException
-
writeLowLevelEndElement
void writeLowLevelEndElement() throws IOException- Throws:
IOException
-
writeLowLevelText
void writeLowLevelText(char[] text, int length) throws IOException- Throws:
IOException
-
writeLowLevelText
void writeLowLevelText(String text) throws IOException
- Throws:
IOException
-
writeLowLevelOctets
void writeLowLevelOctets(byte[] octets, int length) throws IOException- Throws:
IOException
-
-