Class FastInfosetReaderSAXBufferCreator
- java.lang.Object
-
- com.sun.xml.stream.buffer.AbstractCreatorProcessor
-
- com.sun.xml.stream.buffer.AbstractCreator
-
- com.sun.xml.fastinfoset.streambuffer.FastInfosetReaderSAXBufferCreator
-
- All Implemented Interfaces:
org.jvnet.fastinfoset.sax.EncodingAlgorithmContentHandler
,ContentHandler
,DTDHandler
,EntityResolver
,ErrorHandler
,LexicalHandler
public final class FastInfosetReaderSAXBufferCreator extends com.sun.xml.stream.buffer.AbstractCreator implements EntityResolver, DTDHandler, ContentHandler, ErrorHandler, LexicalHandler, org.jvnet.fastinfoset.sax.EncodingAlgorithmContentHandler
A creator of aXMLStreamBuffer
that that produces the XML infoset using aFastInfosetReader
.
-
-
Field Summary
-
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
Constructors Constructor Description FastInfosetReaderSAXBufferCreator()
FastInfosetReaderSAXBufferCreator(com.sun.xml.stream.buffer.MutableXMLStreamBuffer buffer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
characters(char[] ch, int start, int length)
void
comment(char[] ch, int start, int length)
com.sun.xml.stream.buffer.MutableXMLStreamBuffer
create(org.jvnet.fastinfoset.sax.FastInfosetReader reader, InputStream in)
void
endCDATA()
void
endDocument()
void
endDTD()
void
endElement(String uri, String localName, String qName)
void
endEntity(String name)
void
endPrefixMapping(String prefix)
void
error(SAXParseException e)
void
fatalError(SAXParseException e)
void
ignorableWhitespace(char[] ch, int start, int length)
void
notationDecl(String name, String publicId, String systemId)
void
object(String URI, int algorithm, Object o)
Receive notification of encoding algorithm data as an object.void
octets(String URI, int algorithm, byte[] b, int start, int length)
Receive notification of encoding algorithm data as an array of byte.void
processingInstruction(String target, String data)
void
reset()
InputSource
resolveEntity(String publicId, String systemId)
void
setDocumentLocator(Locator locator)
void
skippedEntity(String name)
void
startCDATA()
void
startDocument()
void
startDTD(String name, String publicId, String systemId)
void
startElement(String uri, String localName, String qName, Attributes attributes)
void
startEntity(String name)
void
startPrefixMapping(String prefix, String uri)
void
unparsedEntityDecl(String name, String publicId, String systemId, String notationName)
void
warning(SAXParseException e)
-
Methods inherited from class com.sun.xml.stream.buffer.AbstractCreator
createBuffer, getXMLStreamBuffer, increaseTreeCount, peekAtContentObject, resizeContentCharacters, resizeContentObjects, resizeStructure, resizeStructureStrings, setBuffer, setHasInternedStrings, setXMLStreamBuffer, storeContentCharacters, storeContentCharactersCopy, storeContentObject, storeContentString, storeStructure, storeStructureString
-
-
-
-
Method Detail
-
create
public com.sun.xml.stream.buffer.MutableXMLStreamBuffer create(org.jvnet.fastinfoset.sax.FastInfosetReader reader, InputStream in) throws IOException, SAXException
- Throws:
IOException
SAXException
-
reset
public void reset()
-
startDocument
public void startDocument() throws SAXException
- Specified by:
startDocument
in interfaceContentHandler
- Throws:
SAXException
-
endDocument
public void endDocument() throws SAXException
- Specified by:
endDocument
in interfaceContentHandler
- Throws:
SAXException
-
startPrefixMapping
public void startPrefixMapping(String prefix, String uri) throws SAXException
- Specified by:
startPrefixMapping
in interfaceContentHandler
- Throws:
SAXException
-
startElement
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException
- Specified by:
startElement
in interfaceContentHandler
- Throws:
SAXException
-
endElement
public void endElement(String uri, String localName, String qName) throws SAXException
- Specified by:
endElement
in interfaceContentHandler
- Throws:
SAXException
-
characters
public void characters(char[] ch, int start, int length) throws SAXException
- Specified by:
characters
in interfaceContentHandler
- Throws:
SAXException
-
ignorableWhitespace
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException
- Specified by:
ignorableWhitespace
in interfaceContentHandler
- Throws:
SAXException
-
processingInstruction
public void processingInstruction(String target, String data) throws SAXException
- Specified by:
processingInstruction
in interfaceContentHandler
- Throws:
SAXException
-
comment
public void comment(char[] ch, int start, int length) throws SAXException
- Specified by:
comment
in interfaceLexicalHandler
- Throws:
SAXException
-
octets
public void octets(String URI, int algorithm, byte[] b, int start, int length) throws SAXException
Description copied from interface:org.jvnet.fastinfoset.sax.EncodingAlgorithmContentHandler
Receive notification of encoding algorithm data as an array of byte.The application must not attempt to read from the array outside of the specified range.
Such notifications will occur for a Fast Infoset SAX parser when processing encoding algorithm data.
The Parser will call the method of this interface to report each encoding algorithm data. Parsers MUST return all contiguous characters in a single chunk
Parsers may return all contiguous bytes in a single chunk, or they may split it into several chunks providing that the length of each chunk is of the required length to successfully apply the encoding algorithm to the chunk.
- Specified by:
octets
in interfaceorg.jvnet.fastinfoset.sax.EncodingAlgorithmContentHandler
- Parameters:
URI
- the URI of the encoding algorithmalgorithm
- the encoding algorithm indexb
- the array of bytestart
- the start position in the arraylength
- the number of byte to read from the array- Throws:
SAXException
- any SAX exception, possibly wrapping another exception- See Also:
EncodingAlgorithmIndexes
-
object
public void object(String URI, int algorithm, Object o) throws SAXException
Description copied from interface:org.jvnet.fastinfoset.sax.EncodingAlgorithmContentHandler
Receive notification of encoding algorithm data as an object.Such notifications will occur for a Fast Infoset SAX parser when processing encoding algorithm data that is converted from an array of byte to an object more suitable for processing.
- Specified by:
object
in interfaceorg.jvnet.fastinfoset.sax.EncodingAlgorithmContentHandler
- Parameters:
URI
- the URI of the encoding algorithmalgorithm
- the encoding algorithm indexo
- the encoding algorithm object- Throws:
SAXException
- any SAX exception, possibly wrapping another exception- See Also:
EncodingAlgorithmIndexes
-
resolveEntity
public InputSource resolveEntity(String publicId, String systemId) throws IOException, SAXException
- Specified by:
resolveEntity
in interfaceEntityResolver
- Throws:
IOException
SAXException
-
notationDecl
public void notationDecl(String name, String publicId, String systemId) throws SAXException
- Specified by:
notationDecl
in interfaceDTDHandler
- Throws:
SAXException
-
unparsedEntityDecl
public void unparsedEntityDecl(String name, String publicId, String systemId, String notationName) throws SAXException
- Specified by:
unparsedEntityDecl
in interfaceDTDHandler
- Throws:
SAXException
-
setDocumentLocator
public void setDocumentLocator(Locator locator)
- Specified by:
setDocumentLocator
in interfaceContentHandler
-
endPrefixMapping
public void endPrefixMapping(String prefix) throws SAXException
- Specified by:
endPrefixMapping
in interfaceContentHandler
- Throws:
SAXException
-
skippedEntity
public void skippedEntity(String name) throws SAXException
- Specified by:
skippedEntity
in interfaceContentHandler
- Throws:
SAXException
-
startDTD
public void startDTD(String name, String publicId, String systemId) throws SAXException
- Specified by:
startDTD
in interfaceLexicalHandler
- Throws:
SAXException
-
endDTD
public void endDTD() throws SAXException
- Specified by:
endDTD
in interfaceLexicalHandler
- Throws:
SAXException
-
startEntity
public void startEntity(String name) throws SAXException
- Specified by:
startEntity
in interfaceLexicalHandler
- Throws:
SAXException
-
endEntity
public void endEntity(String name) throws SAXException
- Specified by:
endEntity
in interfaceLexicalHandler
- Throws:
SAXException
-
startCDATA
public void startCDATA() throws SAXException
- Specified by:
startCDATA
in interfaceLexicalHandler
- Throws:
SAXException
-
endCDATA
public void endCDATA() throws SAXException
- Specified by:
endCDATA
in interfaceLexicalHandler
- Throws:
SAXException
-
warning
public void warning(SAXParseException e) throws SAXException
- Specified by:
warning
in interfaceErrorHandler
- Throws:
SAXException
-
error
public void error(SAXParseException e) throws SAXException
- Specified by:
error
in interfaceErrorHandler
- Throws:
SAXException
-
fatalError
public void fatalError(SAXParseException e) throws SAXException
- Specified by:
fatalError
in interfaceErrorHandler
- Throws:
SAXException
-
-