|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jasig.portal.utils.SAX2FilterImpl
org.jasig.portal.utils.SAX2DuplicatingFilterImpl
public class SAX2DuplicatingFilterImpl
This is a remake of org.xml.sax.helpers.XMLFilterImpl
that allows for downward chaining of LexicalHandlers, and further extensions.
Some of the behavior is slightly different from that of hte XMLFilterImpl. For example this implementation allows to set null handlers. It also redirects parent's handlers right after instantiation or setParent() invokation, not just at the parse().
XMLFilterImpl| Field Summary | |
|---|---|
protected ContentHandler |
contentHandler2
|
protected DTDHandler |
dtdHandler2
|
protected EntityResolver |
entityResolver2
|
protected ErrorHandler |
errorHandler2
|
protected LexicalHandler |
lexicalHandler2
|
| Fields inherited from class org.jasig.portal.utils.SAX2FilterImpl |
|---|
contentHandler, dtdHandler, entityResolver, errorHandler, lexicalHandler, locator, log |
| Constructor Summary | |
|---|---|
SAX2DuplicatingFilterImpl()
Construct an empty XML filter, with no parent. |
|
SAX2DuplicatingFilterImpl(ContentHandler ch,
ContentHandler ch2)
Try to imply all of the handlers from ContentHandler alone. |
|
SAX2DuplicatingFilterImpl(ContentHandler ch,
EntityResolver er,
ErrorHandler eh,
LexicalHandler lh,
DTDHandler dh,
ContentHandler ch2,
EntityResolver er2,
ErrorHandler eh2,
LexicalHandler lh2,
DTDHandler dh2)
Construct an XML filter with the specified children handlers. |
|
SAX2DuplicatingFilterImpl(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 |
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(String uri,
String localName,
String qName)
Filter an end element event. |
void |
endEntity(String name)
Filter endEntity event. |
void |
endPrefixMapping(String prefix)
Filter an end Namespace prefix mapping event. |
void |
error(SAXParseException e)
Filter an error event. |
void |
fatalError(SAXParseException e)
Filter a fatal error event. |
ContentHandler |
getContentHandler2()
Get the content event handler. |
DTDHandler |
getDTDHandler2()
Get the current DTD event handler. |
ErrorHandler |
getErrorHandler2()
Get the current error event handler. |
void |
ignorableWhitespace(char[] ch,
int start,
int length)
Filter an ignorable whitespace event. |
void |
notationDecl(String name,
String publicId,
String systemId)
Filter a notation declaration event. |
void |
processingInstruction(String target,
String data)
Filter a processing instruction event. |
InputSource |
resolveEntity(String publicId,
String systemId)
Filter an external entity resolution. |
void |
setAllHandlers(ContentHandler ch,
ContentHandler ch2)
Try to imply all of the handlers from ContentHandler alone. |
void |
setContentHandler2(ContentHandler handler)
Set the content event handler. |
void |
setDocumentLocator(Locator locator)
Filter a new document locator event. |
void |
setDTDHandler2(DTDHandler handler)
Set the DTD event handler. |
void |
setErrorHandler2(ErrorHandler handler)
Set the error event handler. |
void |
setLexicalHandler2(LexicalHandler handler)
Set the lexical handler. |
void |
skippedEntity(String name)
Filter a skipped entity event. |
void |
startCDATA()
Filter startCDATA event. |
void |
startDocument()
Filter a start document event. |
void |
startDTD(String name,
String publicId,
String systemId)
Filter startDTD event. |
void |
startElement(String uri,
String localName,
String qName,
Attributes atts)
Filter a start element event. |
void |
startEntity(String name)
Filter startEntity event. |
void |
startPrefixMapping(String prefix,
String uri)
Filter a start Namespace prefix mapping event. |
void |
unparsedEntityDecl(String name,
String publicId,
String systemId,
String notationName)
Filter an unparsed entity declaration event. |
void |
warning(SAXParseException e)
Filter a warning event. |
| Methods inherited from class org.jasig.portal.utils.SAX2FilterImpl |
|---|
getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getParent, getProperty, parse, parse, setAllHandlers, setContentHandler, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setLexicalHandler, setParent, setProperty |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected EntityResolver entityResolver2
protected DTDHandler dtdHandler2
protected ContentHandler contentHandler2
protected ErrorHandler errorHandler2
protected LexicalHandler lexicalHandler2
| Constructor Detail |
|---|
public SAX2DuplicatingFilterImpl()
This filter will have no parent: you must assign a parent before you start a parse or do any configuration with setFeature or setProperty.
XMLReader.setFeature(java.lang.String, boolean),
XMLReader.setProperty(java.lang.String, java.lang.Object)public SAX2DuplicatingFilterImpl(XMLReader parent)
SAX2FilterImpl.setParent(XMLReader),
SAX2FilterImpl.getParent()
public SAX2DuplicatingFilterImpl(ContentHandler ch,
EntityResolver er,
ErrorHandler eh,
LexicalHandler lh,
DTDHandler dh,
ContentHandler ch2,
EntityResolver er2,
ErrorHandler eh2,
LexicalHandler lh2,
DTDHandler dh2)
SAX2FilterImpl.setContentHandler(ContentHandler),
SAX2FilterImpl.setDTDHandler(DTDHandler),
SAX2FilterImpl.setErrorHandler(ErrorHandler),
SAX2FilterImpl.setEntityResolver(EntityResolver),
SAX2FilterImpl.setLexicalHandler(LexicalHandler)
public SAX2DuplicatingFilterImpl(ContentHandler ch,
ContentHandler ch2)
| Method Detail |
|---|
public void setAllHandlers(ContentHandler ch,
ContentHandler ch2)
public void setDTDHandler2(DTDHandler handler)
handler - The new DTD handler.XMLReader.setDTDHandler(org.xml.sax.DTDHandler)public DTDHandler getDTDHandler2()
XMLReader.getDTDHandler()public void setContentHandler2(ContentHandler handler)
handler - The new content handler.XMLReader.setContentHandler(org.xml.sax.ContentHandler)public ContentHandler getContentHandler2()
XMLReader.getContentHandler()public void setErrorHandler2(ErrorHandler handler)
handler - The new error handler.XMLReader.setErrorHandler(org.xml.sax.ErrorHandler)public void setLexicalHandler2(LexicalHandler handler)
handler - The new lexical handler.public ErrorHandler getErrorHandler2()
XMLReader.getErrorHandler()
public void startDTD(String name,
String publicId,
String systemId)
throws SAXException
startDTD in interface LexicalHandlerstartDTD in class SAX2FilterImplname - 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.
SAXException - The application may raise an
exception.endDTD(),
startEntity(java.lang.String)
public void endDTD()
throws SAXException
endDTD in interface LexicalHandlerendDTD in class SAX2FilterImplSAXException - The application may raise an exception.startDTD(java.lang.String, java.lang.String, java.lang.String)
public void startEntity(String name)
throws SAXException
startEntity in interface LexicalHandlerstartEntity in class SAX2FilterImplname - The name of the entity. If it is a parameter
entity, the name will begin with '%'.
SAXException - The application may raise an exception.endEntity(java.lang.String),
DeclHandler.internalEntityDecl(java.lang.String, java.lang.String),
DeclHandler.externalEntityDecl(java.lang.String, java.lang.String, java.lang.String)
public void endEntity(String name)
throws SAXException
endEntity in interface LexicalHandlerendEntity in class SAX2FilterImplname - The name of the entity that is ending.
SAXException - The application may raise an exception.startEntity(java.lang.String)
public void startCDATA()
throws SAXException
startCDATA in interface LexicalHandlerstartCDATA in class SAX2FilterImplSAXException - The application may raise an exception.endCDATA()
public void endCDATA()
throws SAXException
endCDATA in interface LexicalHandlerendCDATA in class SAX2FilterImplSAXException - The application may raise an exception.startCDATA()
public void comment(char[] ch,
int start,
int length)
throws SAXException
comment in interface LexicalHandlercomment in class SAX2FilterImplch - 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.
SAXException - The application may raise an exception.
public InputSource resolveEntity(String publicId,
String systemId)
throws SAXException,
IOException
resolveEntity in interface EntityResolverresolveEntity in class SAX2FilterImplpublicId - The entity's public identifier, or null.systemId - The entity's system identifier.
SAXException - The client may throw
an exception during processing.
IOException - The client may throw an
I/O-related exception while obtaining the
new InputSource.EntityResolver.resolveEntity(java.lang.String, java.lang.String)
public void notationDecl(String name,
String publicId,
String systemId)
throws SAXException
notationDecl in interface DTDHandlernotationDecl in class SAX2FilterImplname - The notation name.publicId - The notation's public identifier, or null.systemId - The notation's system identifier, or null.
SAXException - The client may throw
an exception during processing.DTDHandler.notationDecl(java.lang.String, java.lang.String, java.lang.String)
public void unparsedEntityDecl(String name,
String publicId,
String systemId,
String notationName)
throws SAXException
unparsedEntityDecl in interface DTDHandlerunparsedEntityDecl in class SAX2FilterImplname - 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.
SAXException - The client may throw
an exception during processing.DTDHandler.unparsedEntityDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String)public void setDocumentLocator(Locator locator)
setDocumentLocator in interface ContentHandlersetDocumentLocator in class SAX2FilterImpllocator - The document locator.ContentHandler.setDocumentLocator(org.xml.sax.Locator)
public void startDocument()
throws SAXException
startDocument in interface ContentHandlerstartDocument in class SAX2FilterImplSAXException - The client may throw
an exception during processing.ContentHandler.startDocument()
public void endDocument()
throws SAXException
endDocument in interface ContentHandlerendDocument in class SAX2FilterImplSAXException - The client may throw
an exception during processing.ContentHandler.endDocument()
public void startPrefixMapping(String prefix,
String uri)
throws SAXException
startPrefixMapping in interface ContentHandlerstartPrefixMapping in class SAX2FilterImplprefix - The Namespace prefix.uri - The Namespace URI.
SAXException - The client may throw
an exception during processing.ContentHandler.startPrefixMapping(java.lang.String, java.lang.String)
public void endPrefixMapping(String prefix)
throws SAXException
endPrefixMapping in interface ContentHandlerendPrefixMapping in class SAX2FilterImplprefix - The Namespace prefix.
SAXException - The client may throw
an exception during processing.ContentHandler.endPrefixMapping(java.lang.String)
public void startElement(String uri,
String localName,
String qName,
Attributes atts)
throws SAXException
startElement in interface ContentHandlerstartElement in class SAX2FilterImpluri - 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.
SAXException - The client may throw
an exception during processing.ContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
public void endElement(String uri,
String localName,
String qName)
throws SAXException
endElement in interface ContentHandlerendElement in class SAX2FilterImpluri - 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.
SAXException - The client may throw
an exception during processing.ContentHandler.endElement(java.lang.String, java.lang.String, java.lang.String)
public void characters(char[] ch,
int start,
int length)
throws SAXException
characters in interface ContentHandlercharacters in class SAX2FilterImplch - An array of characters.start - The starting position in the array.length - The number of characters to use from the array.
SAXException - The client may throw
an exception during processing.ContentHandler.characters(char[], int, int)
public void ignorableWhitespace(char[] ch,
int start,
int length)
throws SAXException
ignorableWhitespace in interface ContentHandlerignorableWhitespace in class SAX2FilterImplch - An array of characters.start - The starting position in the array.length - The number of characters to use from the array.
SAXException - The client may throw
an exception during processing.ContentHandler.ignorableWhitespace(char[], int, int)
public void processingInstruction(String target,
String data)
throws SAXException
processingInstruction in interface ContentHandlerprocessingInstruction in class SAX2FilterImpltarget - The processing instruction target.data - The text following the target.
SAXException - The client may throw
an exception during processing.ContentHandler.processingInstruction(java.lang.String, java.lang.String)
public void skippedEntity(String name)
throws SAXException
skippedEntity in interface ContentHandlerskippedEntity in class SAX2FilterImplname - The name of the skipped entity.
SAXException - The client may throw
an exception during processing.ContentHandler.skippedEntity(java.lang.String)
public void warning(SAXParseException e)
throws SAXException
warning in interface ErrorHandlerwarning in class SAX2FilterImple - The nwarning as an exception.
SAXException - The client may throw
an exception during processing.ErrorHandler.warning(org.xml.sax.SAXParseException)
public void error(SAXParseException e)
throws SAXException
error in interface ErrorHandlererror in class SAX2FilterImple - The error as an exception.
SAXException - The client may throw
an exception during processing.ErrorHandler.error(org.xml.sax.SAXParseException)
public void fatalError(SAXParseException e)
throws SAXException
fatalError in interface ErrorHandlerfatalError in class SAX2FilterImple - The error as an exception.
SAXException - The client may throw
an exception during processing.ErrorHandler.fatalError(org.xml.sax.SAXParseException)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||