|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.xml.stream.buffer.XMLStreamBuffer
com.sun.xml.stream.buffer.MutableXMLStreamBuffer
public class MutableXMLStreamBuffer
A mutable stream-based buffer of an XML infoset.
A MutableXMLStreamBuffer is created using specific SAX and StAX-based creators. Utility methods on MutableXMLStreamBuffer are provided for such functionality that utilize SAX and StAX-based creators.
Once instantiated the same instance of a MutableXMLStreamBuffer may be reused for creation to reduce the amount of Objects instantiated and garbage collected that are required for internally representing an XML infoset.
A MutableXMLStreamBuffer is not designed to be created and processed concurrently. If done so unspecified behaviour may occur.
| Field Summary | |
|---|---|
static int |
DEFAULT_ARRAY_SIZE
The default array size for the arrays used in internal representation of the XML infoset. |
| Fields inherited from class com.sun.xml.stream.buffer.XMLStreamBuffer |
|---|
_contentCharactersBuffer, _contentCharactersBufferPtr, _contentObjects, _contentObjectsPtr, _hasInternedStrings, _inscopeNamespaces, _structure, _structurePtr, _structureStrings, _structureStringsPtr, systemId, treeCount |
| Constructor Summary | |
|---|---|
MutableXMLStreamBuffer()
Create a new MutableXMLStreamBuffer using the DEFAULT_ARRAY_SIZE. |
|
MutableXMLStreamBuffer(int size)
Create a new MutableXMLStreamBuffer. |
|
| Method Summary | |
|---|---|
SAXBufferCreator |
createFromSAXBufferCreator()
Create contents of a buffer from a SAXBufferCreator. |
void |
createFromXMLReader(XMLReader reader,
InputStream in)
Create contents of a buffer from a XMLReader and InputStream. |
void |
createFromXMLReader(XMLReader reader,
InputStream in,
String systemId)
Create contents of a buffer from a XMLReader and InputStream. |
void |
createFromXMLStreamReader(XMLStreamReader reader)
Create contents of a buffer from a XMLStreamReader. |
XMLStreamWriter |
createFromXMLStreamWriter()
Create contents of a buffer from a XMLStreamWriter. |
void |
reset()
Reset the MutableXMLStreamBuffer. |
protected void |
setHasInternedStrings(boolean hasInternedStrings)
|
void |
setSystemId(String systemId)
Set the system identifier for this buffer. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_ARRAY_SIZE
| Constructor Detail |
|---|
public MutableXMLStreamBuffer()
DEFAULT_ARRAY_SIZE.
public MutableXMLStreamBuffer(int size)
size - The size of the arrays used in the internal representation
of the XML infoset.
NegativeArraySizeException - If the size argument is less than 0.| Method Detail |
|---|
public void setSystemId(String systemId)
systemId - The system identifier.
public void createFromXMLStreamReader(XMLStreamReader reader)
throws XMLStreamException
The MutableXMLStreamBuffer is reset (see reset()) before creation.
The MutableXMLStreamBuffer is created by consuming the events on the XMLStreamReader using
an instance of StreamReaderBufferCreator.
reader - A XMLStreamReader to read from to create.
XMLStreamExceptionpublic XMLStreamWriter createFromXMLStreamWriter()
The MutableXMLStreamBuffer is reset (see reset()) before creation.
The MutableXMLStreamBuffer is created by consuming events on a XMLStreamWriter using
an instance of StreamWriterBufferCreator.
public SAXBufferCreator createFromSAXBufferCreator()
SAXBufferCreator.
The MutableXMLStreamBuffer is reset (see reset()) before creation.
The MutableXMLStreamBuffer is created by consuming events from a ContentHandler using
an instance of SAXBufferCreator.
SAXBufferCreator to create from.
public void createFromXMLReader(XMLReader reader,
InputStream in)
throws SAXException,
IOException
XMLReader and InputStream.
The MutableXMLStreamBuffer is reset (see reset()) before creation.
The MutableXMLStreamBuffer is created by using an instance of SAXBufferCreator
and registering associated handlers on the XMLReader.
reader - The XMLReader to use for parsing.in - The InputStream to be parsed.
SAXException
IOException
public void createFromXMLReader(XMLReader reader,
InputStream in,
String systemId)
throws SAXException,
IOException
XMLReader and InputStream.
The MutableXMLStreamBuffer is reset (see reset()) before creation.
The MutableXMLStreamBuffer is created by using an instance of SAXBufferCreator
and registering associated handlers on the XMLReader.
reader - The XMLReader to use for parsing.in - The InputStream to be parsed.systemId - The system ID of the input stream.
SAXException
IOExceptionpublic void reset()
This method will reset the MutableXMLStreamBuffer to a state of being "uncreated" similar to the state of a newly instantiated MutableXMLStreamBuffer.
As many Objects as possible will be retained for reuse in future creation.
protected void setHasInternedStrings(boolean hasInternedStrings)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||