Top Description Fields Methods
org.jvnet.fastinfoset.sax

public Interface FastInfosetReader

extends XMLReader, FastInfosetParser
Known Direct Implementers
com.sun.xml.fastinfoset.sax.SAXDocumentParser
Imports
java.io.IOException, .InputStream, org.jvnet.fastinfoset.FastInfosetException, .FastInfosetParser, org.xml.sax.SAXException, .XMLReader, org.xml.sax.ext.DeclHandler, .LexicalHandler

Interface for reading an Fast Infoset document using callbacks.

FastInfosetReader is the interface that a Fast Infoset parser's SAX2 driver must implement. This interface allows an application to to register Fast Infoset specific event handlers for encoding algorithms.

The reception of encoding algorithm events is determined by the registration of:

The reporting of element content events for built-in algorithms is determimed by the following:

The reporting of element content events for application-defined algorithms is determimed by the following:

The reporting of attribute values for encoding algorithms is achieved using EncodingAlgorithmAttributes that extends org.xml.sax.Attributes. The registered ContentHandler may cast the attr paramter of the org.xml.sax.ContentHandler#startElement(String, String, String, org.xml.sax.Attributes) to the EncodingAlgorithmAttributes interface to access to encoding algorithm information.

The reporting of attribute values for built-in algorithms is determimed by the following:

The reporting of attribute values for application-defined algorithms is determimed by the following:

See Also
org.jvnet.fastinfoset.sax.PrimitiveTypeContentHandler, org.jvnet.fastinfoset.sax.EncodingAlgorithmContentHandler, org.xml.sax.XMLReader, org.xml.sax.ContentHandler

Field Summary

Modifier and TypeField and Description
public static final String
ENCODING_ALGORITHM_CONTENT_HANDLER_PROPERTY

The property name to be used for getting and setting the EncodingAlgorithmContentHandler.

public static final String
PRIMITIVE_TYPE_CONTENT_HANDLER_PROPERTY

The property name to be used for getting and setting the PrimtiveTypeContentHandler.

Inherited from org.jvnet.fastinfoset.FastInfosetParser:
BUFFER_SIZE_PROPERTYEXTERNAL_VOCABULARIES_PROPERTYFORCE_STREAM_CLOSE_PROPERTYREGISTERED_ENCODING_ALGORITHMS_PROPERTYSTRING_INTERNING_PROPERTY

Method Summary

Modifier and TypeMethod and Description
public DeclHandler

Returns:

The current DTD declaration handler, or null if none has been registered.
getDeclHandler
()

Return the current DTD declaration handler.

public EncodingAlgorithmContentHandler

Returns:

The current encoding algorithm handler, or null if none has been registered.
getEncodingAlgorithmContentHandler
()

Return the current encoding algorithm handler.

public LexicalHandler

Returns:

The current lexical handler, or null if none has been registered.
getLexicalHandler
()

Return the current lexical handler.

public PrimitiveTypeContentHandler

Returns:

The current primitive type handler, or null if none has been registered.
getPrimitiveTypeContentHandler
()

Return the current primitive type handler.

public void
parse(InputStream
The byte stream to parse from.
s
)

Parse a fast infoset document from an InputStream.

public void
setDeclHandler(DeclHandler
The DTD declaration handler.
handler
)

Allow an application to register a DTD declaration handler.

public void
setEncodingAlgorithmContentHandler(EncodingAlgorithmContentHandler
The encoding algorithm handler.
handler
)

Allow an application to register an encoding algorithm handler.

public void
setLexicalHandler(LexicalHandler
The lexical handler.
handler
)

Allow an application to register a lexical handler.

public void
setPrimitiveTypeContentHandler(PrimitiveTypeContentHandler
The primitive type handler.
handler
)

Allow an application to register a primitive type handler.

Inherited from org.jvnet.fastinfoset.FastInfosetParser:
getBufferSizegetExternalVocabulariesgetForceStreamClosegetParseFragmentsgetRegisteredEncodingAlgorithmsgetStringInterningsetBufferSizesetExternalVocabulariessetForceStreamClosesetParseFragmentssetRegisteredEncodingAlgorithmssetStringInterning
Inherited from org.xml.sax.XMLReader:
getContentHandlergetDTDHandlergetEntityResolvergetErrorHandlergetFeaturegetPropertyparseparsesetContentHandlersetDTDHandlersetEntityResolversetErrorHandlersetFeaturesetProperty

Field Detail

ENCODING_ALGORITHM_CONTENT_HANDLER_PROPERTYback to summary
public static final String ENCODING_ALGORITHM_CONTENT_HANDLER_PROPERTY

The property name to be used for getting and setting the EncodingAlgorithmContentHandler.

PRIMITIVE_TYPE_CONTENT_HANDLER_PROPERTYback to summary
public static final String PRIMITIVE_TYPE_CONTENT_HANDLER_PROPERTY

The property name to be used for getting and setting the PrimtiveTypeContentHandler.

Method Detail

getDeclHandlerback to summary
public DeclHandler getDeclHandler()

Return the current DTD declaration handler.

Returns:DeclHandler

The current DTD declaration handler, or null if none has been registered.

See Also
setLexicalHandler
getEncodingAlgorithmContentHandlerback to summary
public EncodingAlgorithmContentHandler getEncodingAlgorithmContentHandler()

Return the current encoding algorithm handler.

Returns:EncodingAlgorithmContentHandler

The current encoding algorithm handler, or null if none has been registered.

See Also
setEncodingAlgorithmContentHandler
getLexicalHandlerback to summary
public LexicalHandler getLexicalHandler()

Return the current lexical handler.

Returns:LexicalHandler

The current lexical handler, or null if none has been registered.

See Also
setLexicalHandler
getPrimitiveTypeContentHandlerback to summary
public PrimitiveTypeContentHandler getPrimitiveTypeContentHandler()

Return the current primitive type handler.

Returns:PrimitiveTypeContentHandler

The current primitive type handler, or null if none has been registered.

See Also
setPrimitiveTypeContentHandler
parseback to summary
public void parse(InputStream s) throws IOException, FastInfosetException, SAXException

Parse a fast infoset document from an InputStream.

The application can use this method to instruct the Fast Infoset reader to begin parsing a fast infoset document from a byte stream.

Applications may not invoke this method while a parse is in progress (they should create a new XMLReader instead for each nested XML document). Once a parse is complete, an application may reuse the same FastInfosetReader object, possibly with a different byte stream.

During the parse, the FastInfosetReader will provide information about the fast infoset document through the registered event handlers.

This method is synchronous: it will not return until parsing has ended. If a client application wants to terminate parsing early, it should throw an exception.

Parameters
s:InputStream

The byte stream to parse from.

setDeclHandlerback to summary
public void setDeclHandler(DeclHandler handler)

Allow an application to register a DTD declaration handler.

Applications may register a new or different handler in the middle of a parse, and the SAX parser must begin using the new handler immediately.

Parameters
handler:DeclHandler

The DTD declaration handler.

See Also
getLexicalHandler
setEncodingAlgorithmContentHandlerback to summary
public void setEncodingAlgorithmContentHandler(EncodingAlgorithmContentHandler handler)

Allow an application to register an encoding algorithm handler.

Applications may register a new or different handler in the middle of a parse, and the SAX parser must begin using the new handler immediately.

Parameters
handler:EncodingAlgorithmContentHandler

The encoding algorithm handler.

See Also
getEncodingAlgorithmContentHandler
setLexicalHandlerback to summary
public void setLexicalHandler(LexicalHandler handler)

Allow an application to register a lexical handler.

Applications may register a new or different handler in the middle of a parse, and the SAX parser must begin using the new handler immediately.

Parameters
handler:LexicalHandler

The lexical handler.

See Also
getLexicalHandler
setPrimitiveTypeContentHandlerback to summary
public void setPrimitiveTypeContentHandler(PrimitiveTypeContentHandler handler)

Allow an application to register a primitive type handler.

Applications may register a new or different handler in the middle of a parse, and the SAX parser must begin using the new handler immediately.

Parameters
handler:PrimitiveTypeContentHandler

The primitive type handler.

See Also
getPrimitiveTypeContentHandler