Package com.sun.xml.stream.buffer.sax
Class SAXBufferProcessor
java.lang.Object
com.sun.xml.stream.buffer.AbstractCreatorProcessor
com.sun.xml.stream.buffer.AbstractProcessor
com.sun.xml.stream.buffer.sax.SAXBufferProcessor
- All Implemented Interfaces:
XMLReader
A processor of a
XMLStreamBuffer
that that reads the XML infoset as
XMLReader
.-
Field Summary
Modifier and TypeFieldDescriptionprotected AttributesHolder
protected ContentHandler
Reference to content handler.protected DTDHandler
Reference to dtd handler.protected EntityResolver
Reference to entity resolver.protected ErrorHandler
Reference to error handler.protected LexicalHandler
Reference to lexical handler.protected int[]
protected int
protected int[]
protected String[]
protected boolean
SAX Namespace attributes featuresprotected int
Fields inherited from class com.sun.xml.stream.buffer.AbstractProcessor
_buffer, _fragmentMode, _qNameBuffer, _stringInterningFeature, _treeCount, STATE_ATTRIBUTE_LN, STATE_ATTRIBUTE_LN_OBJECT, STATE_ATTRIBUTE_P_U_LN, STATE_ATTRIBUTE_P_U_LN_OBJECT, STATE_ATTRIBUTE_U_LN, STATE_ATTRIBUTE_U_LN_OBJECT, STATE_ATTRIBUTE_U_LN_QN, STATE_ATTRIBUTE_U_LN_QN_OBJECT, STATE_COMMENT_AS_CHAR_ARRAY_COPY, STATE_COMMENT_AS_CHAR_ARRAY_MEDIUM, STATE_COMMENT_AS_CHAR_ARRAY_SMALL, STATE_COMMENT_AS_STRING, STATE_DOCUMENT, STATE_DOCUMENT_FRAGMENT, STATE_ELEMENT_LN, STATE_ELEMENT_P_U_LN, STATE_ELEMENT_U_LN, STATE_ELEMENT_U_LN_QN, STATE_END, STATE_ILLEGAL, STATE_NAMESPACE_ATTRIBUTE, STATE_NAMESPACE_ATTRIBUTE_P, STATE_NAMESPACE_ATTRIBUTE_P_U, STATE_NAMESPACE_ATTRIBUTE_U, STATE_PROCESSING_INSTRUCTION, STATE_TEXT_AS_CHAR_ARRAY_COPY, STATE_TEXT_AS_CHAR_ARRAY_MEDIUM, STATE_TEXT_AS_CHAR_ARRAY_SMALL, STATE_TEXT_AS_OBJECT, STATE_TEXT_AS_STRING
Fields inherited from class com.sun.xml.stream.buffer.AbstractCreatorProcessor
_contentCharactersBuffer, _contentCharactersBufferPtr, _contentObjects, _contentObjectsPtr, _currentContentCharactersBufferFragment, _currentContentObjectFragment, _currentStructureFragment, _currentStructureStringFragment, _structure, _structurePtr, _structureStrings, _structureStringsPtr, CHAR_ARRAY_LENGTH_MEDIUM, CHAR_ARRAY_LENGTH_MEDIUM_SIZE, CHAR_ARRAY_LENGTH_SMALL, CHAR_ARRAY_LENGTH_SMALL_SIZE, CONTENT_TYPE_CHAR_ARRAY, CONTENT_TYPE_CHAR_ARRAY_COPY, CONTENT_TYPE_OBJECT, CONTENT_TYPE_STRING, FLAG_DOCUMENT_FRAGMENT, FLAG_PREFIX, FLAG_QUALIFIED_NAME, FLAG_URI, T_ATTRIBUTE, T_ATTRIBUTE_LN, T_ATTRIBUTE_LN_OBJECT, T_ATTRIBUTE_P_U_LN, T_ATTRIBUTE_P_U_LN_OBJECT, T_ATTRIBUTE_U_LN, T_ATTRIBUTE_U_LN_OBJECT, T_ATTRIBUTE_U_LN_QN, T_ATTRIBUTE_U_LN_QN_OBJECT, T_COMMENT, T_COMMENT_AS_CHAR_ARRAY, T_COMMENT_AS_CHAR_ARRAY_COPY, T_COMMENT_AS_CHAR_ARRAY_MEDIUM, T_COMMENT_AS_CHAR_ARRAY_SMALL, T_COMMENT_AS_STRING, T_DOCUMENT, T_DOCUMENT_FRAGMENT, T_ELEMENT, T_ELEMENT_LN, T_ELEMENT_P_U_LN, T_ELEMENT_U_LN, T_ELEMENT_U_LN_QN, T_END, T_END_OF_BUFFER, T_NAMESPACE_ATTRIBUTE, T_NAMESPACE_ATTRIBUTE_P, T_NAMESPACE_ATTRIBUTE_P_U, T_NAMESPACE_ATTRIBUTE_U, T_PROCESSING_INSTRUCTION, T_TEXT, T_TEXT_AS_CHAR_ARRAY, T_TEXT_AS_CHAR_ARRAY_COPY, T_TEXT_AS_CHAR_ARRAY_MEDIUM, T_TEXT_AS_CHAR_ARRAY_SMALL, T_TEXT_AS_OBJECT, T_TEXT_AS_STRING, T_UNEXPANDED_ENTITY_REFERENCE, TYPE_MASK, VALUE_TYPE_OBJECT, VALUE_TYPE_STRING
-
Constructor Summary
ConstructorDescriptionSAXBufferProcessor
(XMLStreamBuffer buffer) Deprecated.SAXBufferProcessor
(XMLStreamBuffer buffer, boolean produceFragmentEvent) -
Method Summary
Modifier and TypeMethodDescriptionboolean
getFeature
(String name) getProperty
(String name) void
void
parse
(InputSource input) final void
process()
Parse the sub-tree (or a whole document) thatXMLStreamBuffer
points to, and sends events to handlers.final void
process
(XMLStreamBuffer buffer) Deprecated.final void
process
(XMLStreamBuffer buffer, boolean produceFragmentEvent) Short-hand forsetXMLStreamBuffer(XMLStreamBuffer,boolean)
thenprocess()
.protected void
processElement
(String uri, String localName, String qName, boolean inscope) void
setContentHandler
(ContentHandler handler) void
setDTDHandler
(DTDHandler handler) void
setEntityResolver
(EntityResolver resolver) void
setErrorHandler
(ErrorHandler handler) void
setFeature
(String name, boolean value) void
setLexicalHandler
(LexicalHandler handler) void
setProperty
(String name, Object value) void
setXMLStreamBuffer
(XMLStreamBuffer buffer) Deprecated.void
setXMLStreamBuffer
(XMLStreamBuffer buffer, boolean produceFragmentEvent) Resets the parser to read from the beginning of the givenXMLStreamBuffer
.Methods inherited from class com.sun.xml.stream.buffer.AbstractProcessor
getAIIState, getEIIState, getNIIState, getPrefixFromQName, getQName, peekStructure, readContentCharactersBuffer, readContentCharactersCopy, readContentObject, readContentString, readEiiState, readStructure, readStructure16, readStructureString, setBuffer, setBuffer
-
Field Details
-
_entityResolver
Reference to entity resolver. -
_dtdHandler
Reference to dtd handler. -
_contentHandler
Reference to content handler. -
_errorHandler
Reference to error handler. -
_lexicalHandler
Reference to lexical handler. -
_namespacePrefixesFeature
protected boolean _namespacePrefixesFeatureSAX Namespace attributes features -
_attributes
-
_namespacePrefixes
-
_namespacePrefixesIndex
protected int _namespacePrefixesIndex -
_namespaceAttributesStartingStack
protected int[] _namespaceAttributesStartingStack -
_namespaceAttributesStack
protected int[] _namespaceAttributesStack -
_namespaceAttributesStackIndex
protected int _namespaceAttributesStackIndex
-
-
Constructor Details
-
SAXBufferProcessor
public SAXBufferProcessor() -
SAXBufferProcessor
Deprecated. -
SAXBufferProcessor
- Parameters:
produceFragmentEvent
- True to generate fragment SAX events without start/endDocument. False to generate a full document SAX events.
-
-
Method Details
-
getFeature
- Specified by:
getFeature
in interfaceXMLReader
- Throws:
SAXNotRecognizedException
SAXNotSupportedException
-
setFeature
public void setFeature(String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException - Specified by:
setFeature
in interfaceXMLReader
- Throws:
SAXNotRecognizedException
SAXNotSupportedException
-
getProperty
- Specified by:
getProperty
in interfaceXMLReader
- Throws:
SAXNotRecognizedException
SAXNotSupportedException
-
setProperty
public void setProperty(String name, Object value) throws SAXNotRecognizedException, SAXNotSupportedException - Specified by:
setProperty
in interfaceXMLReader
- Throws:
SAXNotRecognizedException
SAXNotSupportedException
-
setEntityResolver
- Specified by:
setEntityResolver
in interfaceXMLReader
-
getEntityResolver
- Specified by:
getEntityResolver
in interfaceXMLReader
-
setDTDHandler
- Specified by:
setDTDHandler
in interfaceXMLReader
-
getDTDHandler
- Specified by:
getDTDHandler
in interfaceXMLReader
-
setContentHandler
- Specified by:
setContentHandler
in interfaceXMLReader
-
getContentHandler
- Specified by:
getContentHandler
in interfaceXMLReader
-
setErrorHandler
- Specified by:
setErrorHandler
in interfaceXMLReader
-
getErrorHandler
- Specified by:
getErrorHandler
in interfaceXMLReader
-
setLexicalHandler
-
getLexicalHandler
-
parse
- Specified by:
parse
in interfaceXMLReader
- Throws:
IOException
SAXException
-
parse
- Specified by:
parse
in interfaceXMLReader
- Throws:
IOException
SAXException
-
process
Deprecated.Short-hand forsetXMLStreamBuffer(XMLStreamBuffer)
thenprocess()
.- Throws:
SAXException
-
process
Short-hand forsetXMLStreamBuffer(XMLStreamBuffer,boolean)
thenprocess()
.- Parameters:
produceFragmentEvent
- True to generate fragment SAX events without start/endDocument. False to generate a full document SAX events.- Throws:
SAXException
-
setXMLStreamBuffer
Deprecated.Resets the parser to read from the beginning of the givenXMLStreamBuffer
. -
setXMLStreamBuffer
Resets the parser to read from the beginning of the givenXMLStreamBuffer
.- Parameters:
produceFragmentEvent
- True to generate fragment SAX events without start/endDocument. False to generate a full document SAX events.
-
process
Parse the sub-tree (or a whole document) thatXMLStreamBuffer
points to, and sends events to handlers.TODO: We probably need two modes for a sub-tree event generation. One for firing a sub-tree as if it's a whole document (in which case start/endDocument and appropriate additional namespace bindings are necessary), and the other mode for firing a subtree as a subtree, like it does today. A stream buffer SAX feature could be used to specify this.
- Throws:
SAXException
- Follow the same semantics asXMLReader.parse(InputSource)
.
-
processElement
protected void processElement(String uri, String localName, String qName, boolean inscope) throws SAXException - Throws:
SAXException
-
SAXBufferProcessor(XMLStreamBuffer, boolean)