uPortal 2.4.1
API Documentation

org.jasig.portal.utils
Class SAX2BufferImpl

java.lang.Object
  extended byorg.jasig.portal.utils.SAX2FilterImpl
      extended byorg.jasig.portal.utils.SAX2BufferImpl
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler, org.xml.sax.ext.LexicalHandler, org.xml.sax.XMLFilter, org.xml.sax.XMLReader
Direct Known Subclasses:
ChannelRenderingBuffer

public class SAX2BufferImpl
extends SAX2FilterImpl

A basic XML buffer implementation.

Author:
Peter Kharchenko

Field Summary
static java.lang.Integer CHARACTERS
           
static java.lang.Integer COMMENT
           
static java.lang.Integer ENDCDATA
           
static java.lang.Integer ENDDOCUMENT
           
static java.lang.Integer ENDDTD
           
static java.lang.Integer ENDELEMENT
           
static java.lang.Integer ENDENTITY
           
static java.lang.Integer ENDPREFIXMAPPING
           
static java.lang.Integer ERROR
           
static java.lang.Integer FATALERROR
           
static java.lang.Integer IGNORABLEWHITESPACE
           
static java.lang.Integer NOTATIONDECL
           
static java.lang.Integer PROCESSINGINSTRUCTION
           
static java.lang.Integer SKIPPEDENTITY
           
static java.lang.Integer STARTCDATA
           
static java.lang.Integer STARTDOCUMENT
           
static java.lang.Integer STARTDTD
           
static java.lang.Integer STARTELEMENT
           
static java.lang.Integer STARTENTITY
           
static java.lang.Integer STARTPREFIXMAPPING
           
static java.lang.Integer UNPARSEDENTITYDECL
           
static java.lang.Integer WARNING
           
 
Constructor Summary
SAX2BufferImpl()
          Construct an empty XML buffer, with no parent.
SAX2BufferImpl(org.xml.sax.ContentHandler ch)
          Construct an XML filter based on a unified handler.
SAX2BufferImpl(org.xml.sax.ContentHandler ch, org.xml.sax.EntityResolver er, org.xml.sax.ErrorHandler eh, org.xml.sax.ext.LexicalHandler lh, org.xml.sax.DTDHandler dh)
          Construct an XML filter with the specified children.
SAX2BufferImpl(org.xml.sax.XMLReader parent)
          Construct an XML filter with the specified parent.
 
Method Summary
 void characters(char[] ch, int start, int length)
          Filter a character data event.
 void clearBuffer()
           
 void comment(char[] ch, int start, int length)
          Filter comment event.
 void endCDATA()
          Filter endCDATA event.
 void endDocument()
          Filter an end document event.
 void endDTD()
          Filter endDTD event
 void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)
          Filter an end element event.
 void endEntity(java.lang.String name)
          Filter endEntity event.
 void endPrefixMapping(java.lang.String prefix)
          Filter an end Namespace prefix mapping event.
 void error(org.xml.sax.SAXParseException e)
          Filter an error event.
 void fatalError(org.xml.sax.SAXParseException e)
          Filter a fatal error event.
 void ignorableWhitespace(char[] ch, int start, int length)
          Filter an ignorable whitespace event.
 boolean isEmpty()
           
 void notationDecl(java.lang.String name, java.lang.String publicId, java.lang.String systemId)
          Filter a notation declaration event.
 void outputBuffer()
          Outputs buffer's content to a current set of handlers.
 void outputBuffer(org.xml.sax.ContentHandler ch)
          Outputs buffer's content to a specified content handler.
 void processingInstruction(java.lang.String target, java.lang.String data)
          Filter a processing instruction event.
 void setDocumentLocator(org.xml.sax.Locator locator)
          Filter a new document locator event.
 void setOutputAtDocumentEnd(boolean setting)
          Tells buffer to automatically output itself once an end of a document is reached.
 void skippedEntity(java.lang.String name)
          Filter a skipped entity event.
 void startBuffering()
           
 void startCDATA()
          Filter startCDATA event.
 void startDocument()
          Filter a start document event.
 void startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId)
          Filter startDTD event.
 void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts)
          Filter a start element event.
 void startEntity(java.lang.String name)
          Filter startEntity event.
 void startPrefixMapping(java.lang.String prefix, java.lang.String uri)
          Filter a start Namespace prefix mapping event.
 void stopBuffering()
           
 void unparsedEntityDecl(java.lang.String name, java.lang.String publicId, java.lang.String systemId, java.lang.String notationName)
          Filter an unparsed entity declaration event.
 void warning(org.xml.sax.SAXParseException e)
          Filter a warning event.
 
Methods inherited from class org.jasig.portal.utils.SAX2FilterImpl
getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getParent, getProperty, parse, parse, resolveEntity, setAllHandlers, setContentHandler, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setLexicalHandler, setParent, setProperty
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STARTDOCUMENT

public static final java.lang.Integer STARTDOCUMENT

ENDDOCUMENT

public static final java.lang.Integer ENDDOCUMENT

STARTELEMENT

public static final java.lang.Integer STARTELEMENT

ENDELEMENT

public static final java.lang.Integer ENDELEMENT

CHARACTERS

public static final java.lang.Integer CHARACTERS

IGNORABLEWHITESPACE

public static final java.lang.Integer IGNORABLEWHITESPACE

PROCESSINGINSTRUCTION

public static final java.lang.Integer PROCESSINGINSTRUCTION

NOTATIONDECL

public static final java.lang.Integer NOTATIONDECL

UNPARSEDENTITYDECL

public static final java.lang.Integer UNPARSEDENTITYDECL

STARTPREFIXMAPPING

public static final java.lang.Integer STARTPREFIXMAPPING

ENDPREFIXMAPPING

public static final java.lang.Integer ENDPREFIXMAPPING

SKIPPEDENTITY

public static final java.lang.Integer SKIPPEDENTITY

WARNING

public static final java.lang.Integer WARNING

ERROR

public static final java.lang.Integer ERROR

FATALERROR

public static final java.lang.Integer FATALERROR

COMMENT

public static final java.lang.Integer COMMENT

STARTCDATA

public static final java.lang.Integer STARTCDATA

ENDCDATA

public static final java.lang.Integer ENDCDATA

STARTDTD

public static final java.lang.Integer STARTDTD

ENDDTD

public static final java.lang.Integer ENDDTD

STARTENTITY

public static final java.lang.Integer STARTENTITY

ENDENTITY

public static final java.lang.Integer ENDENTITY
Constructor Detail

SAX2BufferImpl

public SAX2BufferImpl()
Construct an empty XML buffer, with no parent.

This filter will have no parent: you must assign a parent before you start a parse or do any configuration with setFeature or setProperty.

By default, buffering is on, outputAtDocumentEnd is off.

See Also:
XMLReader.setFeature(java.lang.String, boolean), XMLReader.setProperty(java.lang.String, java.lang.Object)

SAX2BufferImpl

public SAX2BufferImpl(org.xml.sax.XMLReader parent)
Construct an XML filter with the specified parent.

Same default flag settings as with empty constructor

See Also:
SAX2FilterImpl.setParent(XMLReader), SAX2FilterImpl.getParent()

SAX2BufferImpl

public SAX2BufferImpl(org.xml.sax.ContentHandler ch,
                      org.xml.sax.EntityResolver er,
                      org.xml.sax.ErrorHandler eh,
                      org.xml.sax.ext.LexicalHandler lh,
                      org.xml.sax.DTDHandler dh)
Construct an XML filter with the specified children.

Same default flag settings as with empty constructor

See Also:
SAX2FilterImpl.setContentHandler(ContentHandler), SAX2FilterImpl.setDTDHandler(DTDHandler), SAX2FilterImpl.setErrorHandler(ErrorHandler), SAX2FilterImpl.setEntityResolver(EntityResolver), SAX2FilterImpl.setLexicalHandler(LexicalHandler)

SAX2BufferImpl

public SAX2BufferImpl(org.xml.sax.ContentHandler ch)
Construct an XML filter based on a unified handler.

Same default flag settings as with empty constructor.

Method Detail

setOutputAtDocumentEnd

public void setOutputAtDocumentEnd(boolean setting)
Tells buffer to automatically output itself once an end of a document is reached.

Parameters:
setting - a boolean value

clearBuffer

public void clearBuffer()

stopBuffering

public void stopBuffering()
                   throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException

startBuffering

public void startBuffering()

isEmpty

public boolean isEmpty()

outputBuffer

public void outputBuffer()
                  throws org.xml.sax.SAXException
Outputs buffer's content to a current set of handlers. Please note that this method is not thread-safe if handlers are being reset by different threads. Use the other outputBuffer(ContentHandler) method in such cases.

Throws:
org.xml.sax.SAXException - if an error occurs

outputBuffer

public void outputBuffer(org.xml.sax.ContentHandler ch)
                  throws org.xml.sax.SAXException
Outputs buffer's content to a specified content handler. Please note that the contant handler can also represent lexical handler, dtd handler and error handler. This method is thread-safe.

Parameters:
ch - a ContenteHandler value
Throws:
org.xml.sax.SAXException - if an error occurs

startDTD

public void startDTD(java.lang.String name,
                     java.lang.String publicId,
                     java.lang.String systemId)
              throws org.xml.sax.SAXException
Description copied from class: SAX2FilterImpl
Filter startDTD event.

Specified by:
startDTD in interface org.xml.sax.ext.LexicalHandler
Overrides:
startDTD in class SAX2FilterImpl
Parameters:
name - The document type name.
publicId - The declared public identifier for the external DTD subset, or null if none was declared.
systemId - The declared system identifier for the external DTD subset, or null if none was declared.
Throws:
org.xml.sax.SAXException - The application may raise an exception.
See Also:
SAX2FilterImpl.endDTD(), SAX2FilterImpl.startEntity(java.lang.String)

endDTD

public void endDTD()
            throws org.xml.sax.SAXException
Description copied from class: SAX2FilterImpl
Filter endDTD event

Specified by:
endDTD in interface org.xml.sax.ext.LexicalHandler
Overrides:
endDTD in class SAX2FilterImpl
Throws:
org.xml.sax.SAXException - The application may raise an exception.
See Also:
SAX2FilterImpl.startDTD(java.lang.String, java.lang.String, java.lang.String)

startEntity

public void startEntity(java.lang.String name)
                 throws org.xml.sax.SAXException
Description copied from class: SAX2FilterImpl
Filter startEntity event.

Specified by:
startEntity in interface org.xml.sax.ext.LexicalHandler
Overrides:
startEntity in class SAX2FilterImpl
Parameters:
name - The name of the entity. If it is a parameter entity, the name will begin with '%'.
Throws:
org.xml.sax.SAXException - The application may raise an exception.
See Also:
SAX2FilterImpl.endEntity(java.lang.String), DeclHandler.internalEntityDecl(java.lang.String, java.lang.String), DeclHandler.externalEntityDecl(java.lang.String, java.lang.String, java.lang.String)

endEntity

public void endEntity(java.lang.String name)
               throws org.xml.sax.SAXException
Description copied from class: SAX2FilterImpl
Filter endEntity event.

Specified by:
endEntity in interface org.xml.sax.ext.LexicalHandler
Overrides:
endEntity in class SAX2FilterImpl
Parameters:
name - The name of the entity that is ending.
Throws:
org.xml.sax.SAXException - The application may raise an exception.
See Also:
SAX2FilterImpl.startEntity(java.lang.String)

startCDATA

public void startCDATA()
                throws org.xml.sax.SAXException
Description copied from class: SAX2FilterImpl
Filter startCDATA event.

Specified by:
startCDATA in interface org.xml.sax.ext.LexicalHandler
Overrides:
startCDATA in class SAX2FilterImpl
Throws:
org.xml.sax.SAXException - The application may raise an exception.
See Also:
SAX2FilterImpl.endCDATA()

endCDATA

public void endCDATA()
              throws org.xml.sax.SAXException
Description copied from class: SAX2FilterImpl
Filter endCDATA event.

Specified by:
endCDATA in interface org.xml.sax.ext.LexicalHandler
Overrides:
endCDATA in class SAX2FilterImpl
Throws:
org.xml.sax.SAXException - The application may raise an exception.
See Also:
SAX2FilterImpl.startCDATA()

comment

public void comment(char[] ch,
                    int start,
                    int length)
             throws org.xml.sax.SAXException
Description copied from class: SAX2FilterImpl
Filter comment event.

Specified by:
comment in interface org.xml.sax.ext.LexicalHandler
Overrides:
comment in class SAX2FilterImpl
Parameters:
ch - An array holding the characters in the comment.
start - The starting position in the array.
length - The number of characters to use from the array.
Throws:
org.xml.sax.SAXException - The application may raise an exception.

notationDecl

public void notationDecl(java.lang.String name,
                         java.lang.String publicId,
                         java.lang.String systemId)
                  throws org.xml.sax.SAXException
Description copied from class: SAX2FilterImpl
Filter a notation declaration event.

Specified by:
notationDecl in interface org.xml.sax.DTDHandler
Overrides:
notationDecl in class SAX2FilterImpl
Parameters:
name - The notation name.
publicId - The notation's public identifier, or null.
systemId - The notation's system identifier, or null.
Throws:
org.xml.sax.SAXException - The client may throw an exception during processing.
See Also:
DTDHandler.notationDecl(java.lang.String, java.lang.String, java.lang.String)

unparsedEntityDecl

public void unparsedEntityDecl(java.lang.String name,
                               java.lang.String publicId,
                               java.lang.String systemId,
                               java.lang.String notationName)
                        throws org.xml.sax.SAXException
Description copied from class: SAX2FilterImpl
Filter an unparsed entity declaration event.

Specified by:
unparsedEntityDecl in interface org.xml.sax.DTDHandler
Overrides:
unparsedEntityDecl in class SAX2FilterImpl
Parameters:
name - The entity name.
publicId - The entity's public identifier, or null.
systemId - The entity's system identifier, or null.
notationName - The name of the associated notation.
Throws:
org.xml.sax.SAXException - The client may throw an exception during processing.
See Also:
DTDHandler.unparsedEntityDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String)

setDocumentLocator

public void setDocumentLocator(org.xml.sax.Locator locator)
Description copied from class: SAX2FilterImpl
Filter a new document locator event.

Specified by:
setDocumentLocator in interface org.xml.sax.ContentHandler
Overrides:
setDocumentLocator in class SAX2FilterImpl
Parameters:
locator - The document locator.
See Also:
ContentHandler.setDocumentLocator(org.xml.sax.Locator)

startDocument

public void startDocument()
                   throws org.xml.sax.SAXException
Description copied from class: SAX2FilterImpl
Filter a start document event.

Specified by:
startDocument in interface org.xml.sax.ContentHandler
Overrides:
startDocument in class SAX2FilterImpl
Throws:
org.xml.sax.SAXException - The client may throw an exception during processing.
See Also:
ContentHandler.startDocument()

endDocument

public void endDocument()
                 throws org.xml.sax.SAXException
Description copied from class: SAX2FilterImpl
Filter an end document event.

Specified by:
endDocument in interface org.xml.sax.ContentHandler
Overrides:
endDocument in class SAX2FilterImpl
Throws:
org.xml.sax.SAXException - The client may throw an exception during processing.
See Also:
ContentHandler.endDocument()

startPrefixMapping

public void startPrefixMapping(java.lang.String prefix,
                               java.lang.String uri)
                        throws org.xml.sax.SAXException
Description copied from class: SAX2FilterImpl
Filter a start Namespace prefix mapping event.

Specified by:
startPrefixMapping in interface org.xml.sax.ContentHandler
Overrides:
startPrefixMapping in class SAX2FilterImpl
Parameters:
prefix - The Namespace prefix.
uri - The Namespace URI.
Throws:
org.xml.sax.SAXException - The client may throw an exception during processing.
See Also:
ContentHandler.startPrefixMapping(java.lang.String, java.lang.String)

endPrefixMapping

public void endPrefixMapping(java.lang.String prefix)
                      throws org.xml.sax.SAXException
Description copied from class: SAX2FilterImpl
Filter an end Namespace prefix mapping event.

Specified by:
endPrefixMapping in interface org.xml.sax.ContentHandler
Overrides:
endPrefixMapping in class SAX2FilterImpl
Parameters:
prefix - The Namespace prefix.
Throws:
org.xml.sax.SAXException - The client may throw an exception during processing.
See Also:
ContentHandler.endPrefixMapping(java.lang.String)

startElement

public void startElement(java.lang.String uri,
                         java.lang.String localName,
                         java.lang.String qName,
                         org.xml.sax.Attributes atts)
                  throws org.xml.sax.SAXException
Description copied from class: SAX2FilterImpl
Filter a start element event.

Specified by:
startElement in interface org.xml.sax.ContentHandler
Overrides:
startElement in class SAX2FilterImpl
Parameters:
uri - The element's Namespace URI, or the empty string.
localName - The element's local name, or the empty string.
qName - The element's qualified (prefixed) name, or the empty string.
atts - The element's attributes.
Throws:
org.xml.sax.SAXException - The client may throw an exception during processing.
See Also:
ContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)

endElement

public void endElement(java.lang.String uri,
                       java.lang.String localName,
                       java.lang.String qName)
                throws org.xml.sax.SAXException
Description copied from class: SAX2FilterImpl
Filter an end element event.

Specified by:
endElement in interface org.xml.sax.ContentHandler
Overrides:
endElement in class SAX2FilterImpl
Parameters:
uri - The element's Namespace URI, or the empty string.
localName - The element's local name, or the empty string.
qName - The element's qualified (prefixed) name, or the empty string.
Throws:
org.xml.sax.SAXException - The client may throw an exception during processing.
See Also:
ContentHandler.endElement(java.lang.String, java.lang.String, java.lang.String)

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws org.xml.sax.SAXException
Description copied from class: SAX2FilterImpl
Filter a character data event.

Specified by:
characters in interface org.xml.sax.ContentHandler
Overrides:
characters in class SAX2FilterImpl
Parameters:
ch - An array of characters.
start - The starting position in the array.
length - The number of characters to use from the array.
Throws:
org.xml.sax.SAXException - The client may throw an exception during processing.
See Also:
ContentHandler.characters(char[], int, int)

ignorableWhitespace

public void ignorableWhitespace(char[] ch,
                                int start,
                                int length)
                         throws org.xml.sax.SAXException
Description copied from class: SAX2FilterImpl
Filter an ignorable whitespace event.

Specified by:
ignorableWhitespace in interface org.xml.sax.ContentHandler
Overrides:
ignorableWhitespace in class SAX2FilterImpl
Parameters:
ch - An array of characters.
start - The starting position in the array.
length - The number of characters to use from the array.
Throws:
org.xml.sax.SAXException - The client may throw an exception during processing.
See Also:
ContentHandler.ignorableWhitespace(char[], int, int)

processingInstruction

public void processingInstruction(java.lang.String target,
                                  java.lang.String data)
                           throws org.xml.sax.SAXException
Description copied from class: SAX2FilterImpl
Filter a processing instruction event.

Specified by:
processingInstruction in interface org.xml.sax.ContentHandler
Overrides:
processingInstruction in class SAX2FilterImpl
Parameters:
target - The processing instruction target.
data - The text following the target.
Throws:
org.xml.sax.SAXException - The client may throw an exception during processing.
See Also:
ContentHandler.processingInstruction(java.lang.String, java.lang.String)

skippedEntity

public void skippedEntity(java.lang.String name)
                   throws org.xml.sax.SAXException
Description copied from class: SAX2FilterImpl
Filter a skipped entity event.

Specified by:
skippedEntity in interface org.xml.sax.ContentHandler
Overrides:
skippedEntity in class SAX2FilterImpl
Parameters:
name - The name of the skipped entity.
Throws:
org.xml.sax.SAXException - The client may throw an exception during processing.
See Also:
ContentHandler.skippedEntity(java.lang.String)

warning

public void warning(org.xml.sax.SAXParseException e)
             throws org.xml.sax.SAXException
Description copied from class: SAX2FilterImpl
Filter a warning event.

Specified by:
warning in interface org.xml.sax.ErrorHandler
Overrides:
warning in class SAX2FilterImpl
Parameters:
e - The nwarning as an exception.
Throws:
org.xml.sax.SAXException - The client may throw an exception during processing.
See Also:
ErrorHandler.warning(org.xml.sax.SAXParseException)

error

public void error(org.xml.sax.SAXParseException e)
           throws org.xml.sax.SAXException
Description copied from class: SAX2FilterImpl
Filter an error event.

Specified by:
error in interface org.xml.sax.ErrorHandler
Overrides:
error in class SAX2FilterImpl
Parameters:
e - The error as an exception.
Throws:
org.xml.sax.SAXException - The client may throw an exception during processing.
See Also:
ErrorHandler.error(org.xml.sax.SAXParseException)

fatalError

public void fatalError(org.xml.sax.SAXParseException e)
                throws org.xml.sax.SAXException
Description copied from class: SAX2FilterImpl
Filter a fatal error event.

Specified by:
fatalError in interface org.xml.sax.ErrorHandler
Overrides:
fatalError in class SAX2FilterImpl
Parameters:
e - The error as an exception.
Throws:
org.xml.sax.SAXException - The client may throw an exception during processing.
See Also:
ErrorHandler.fatalError(org.xml.sax.SAXParseException)

uPortal 2.4.1
API Documentation