com.xerox.adoc.dexss
Class DeXSSFilterPipeline

java.lang.Object
  extended by org.xml.sax.helpers.XMLFilterImpl
      extended by com.xerox.adoc.dexss.DeXSSFilterPipeline
All Implemented Interfaces:
DeXSSChangeListener, org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler, org.xml.sax.XMLFilter, org.xml.sax.XMLReader
Direct Known Subclasses:
DeXSSParser

public class DeXSSFilterPipeline
extends org.xml.sax.helpers.XMLFilterImpl
implements DeXSSChangeListener

DeXSSFilterPipeline sets up a pipeline of other filters.


Field Summary
static java.lang.String BODY_ONLY
          Feature.
static java.lang.String DEXSS_CHANGE_LISTENER
          Property.
 
Constructor Summary
DeXSSFilterPipeline()
           
 
Method Summary
 DeXSSChangeListener getDeXSSChangeListener()
          Equivalent to getProperty(#DeXSS_CHANGE_LISTENER)
 boolean getFeature(java.lang.String name)
          Processes feature BODY_ONLY directly; other features are referred to the superclass.
 java.lang.Object getProperty(java.lang.String name)
          Processes property DEXSS_CHANGE_LISTENER directly; other properties are referred to the superclass.
 void logXSSChange(java.lang.String message)
          Called when a change happens and there are no informational items.
 void logXSSChange(java.lang.String message, java.lang.String item1)
          Called when a change happens and there is one informational item.
 void logXSSChange(java.lang.String message, java.lang.String item1, java.lang.String item2)
          Called when a change happens and there are two informational items.
 void setDeXSSChangeListener(DeXSSChangeListener xssChangeListener)
          Equivalent to setProperty(DEXSS_CHANGE_LISTENER, xssChangeListener)
 void setFeature(java.lang.String name, boolean state)
          Processes feature BODY_ONLY directly; other features are referred to the superclass.
 void setParent(org.xml.sax.XMLReader rr)
          Specializes XMLFilterImpl.setParent(XMLReader) and constructs the DeXSS filter pipeline first.
 void setProperty(java.lang.String name, java.lang.Object value)
          Processes property DEXSS_CHANGE_LISTENER directly; other features are referred to the superclass.
 
Methods inherited from class org.xml.sax.helpers.XMLFilterImpl
characters, endDocument, endElement, endPrefixMapping, error, fatalError, getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getParent, ignorableWhitespace, notationDecl, parse, parse, processingInstruction, resolveEntity, setContentHandler, setDocumentLocator, setDTDHandler, setEntityResolver, setErrorHandler, skippedEntity, startDocument, startElement, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BODY_ONLY

public static final java.lang.String BODY_ONLY
Feature. If set to true, only the body is returned, and the <html> and <head> elements are discarded.

See Also:
Constant Field Values

DEXSS_CHANGE_LISTENER

public static final java.lang.String DEXSS_CHANGE_LISTENER
Property. Value should be an object satisfying interface DeXSSChangeListener.

See Also:
Constant Field Values
Constructor Detail

DeXSSFilterPipeline

public DeXSSFilterPipeline()
Method Detail

setFeature

public void setFeature(java.lang.String name,
                       boolean state)
                throws org.xml.sax.SAXNotRecognizedException,
                       org.xml.sax.SAXNotSupportedException
Processes feature BODY_ONLY directly; other features are referred to the superclass.

Specified by:
setFeature in interface org.xml.sax.XMLReader
Overrides:
setFeature in class org.xml.sax.helpers.XMLFilterImpl
Parameters:
name - feature name
state - feature state
Throws:
SAXNotRecognizedException, - SAXNotSupportedException
org.xml.sax.SAXNotRecognizedException
org.xml.sax.SAXNotSupportedException

getFeature

public boolean getFeature(java.lang.String name)
                   throws org.xml.sax.SAXNotRecognizedException,
                          org.xml.sax.SAXNotSupportedException
Processes feature BODY_ONLY directly; other features are referred to the superclass.

Specified by:
getFeature in interface org.xml.sax.XMLReader
Overrides:
getFeature in class org.xml.sax.helpers.XMLFilterImpl
Parameters:
name - feature name
Returns:
feature value
Throws:
SAXNotRecognizedException, - SAXNotSupportedException
org.xml.sax.SAXNotRecognizedException
org.xml.sax.SAXNotSupportedException

setProperty

public void setProperty(java.lang.String name,
                        java.lang.Object value)
                 throws org.xml.sax.SAXNotRecognizedException,
                        org.xml.sax.SAXNotSupportedException
Processes property DEXSS_CHANGE_LISTENER directly; other features are referred to the superclass.

Specified by:
setProperty in interface org.xml.sax.XMLReader
Overrides:
setProperty in class org.xml.sax.helpers.XMLFilterImpl
Parameters:
name - property name
Throws:
SAXNotRecognizedException, - SAXNotSupportedException
org.xml.sax.SAXNotRecognizedException
org.xml.sax.SAXNotSupportedException

getProperty

public java.lang.Object getProperty(java.lang.String name)
                             throws org.xml.sax.SAXNotRecognizedException,
                                    org.xml.sax.SAXNotSupportedException
Processes property DEXSS_CHANGE_LISTENER directly; other properties are referred to the superclass.

Specified by:
getProperty in interface org.xml.sax.XMLReader
Overrides:
getProperty in class org.xml.sax.helpers.XMLFilterImpl
Parameters:
name - property name
Returns:
property value
Throws:
SAXNotRecognizedException, - SAXNotSupportedException
org.xml.sax.SAXNotRecognizedException
org.xml.sax.SAXNotSupportedException

setDeXSSChangeListener

public void setDeXSSChangeListener(DeXSSChangeListener xssChangeListener)
Equivalent to setProperty(DEXSS_CHANGE_LISTENER, xssChangeListener)

See Also:
getDeXSSChangeListener()

getDeXSSChangeListener

public DeXSSChangeListener getDeXSSChangeListener()
Equivalent to getProperty(#DeXSS_CHANGE_LISTENER)

Returns:
DeXSSChangeListener or null if none set.
See Also:
setDeXSSChangeListener(DeXSSChangeListener)

setParent

public void setParent(org.xml.sax.XMLReader rr)
Specializes XMLFilterImpl.setParent(XMLReader) and constructs the DeXSS filter pipeline first.

TODO: Pipeline configuration is controlled by inline boolean constants. Configuration should be made better, perhaps with a Properties parameter to the constructor.

Specified by:
setParent in interface org.xml.sax.XMLFilter
Overrides:
setParent in class org.xml.sax.helpers.XMLFilterImpl

logXSSChange

public void logXSSChange(java.lang.String message)
Called when a change happens and there are no informational items. If this DeXSSFilterPipeline has an xssChangeListener, invokes the similar method on it.

Specified by:
logXSSChange in interface DeXSSChangeListener
Parameters:
message - Main message

logXSSChange

public void logXSSChange(java.lang.String message,
                         java.lang.String item1)
Called when a change happens and there is one informational item. If this DeXSSFilterPipeline has an xssChangeListener, invokes the similar method on it.

Specified by:
logXSSChange in interface DeXSSChangeListener
Parameters:
message - Main message
item1 - Information item

logXSSChange

public void logXSSChange(java.lang.String message,
                         java.lang.String item1,
                         java.lang.String item2)
Called when a change happens and there are two informational items. If this DeXSSFilterPipeline has an xssChangeListener, invokes the similar method on it.

Specified by:
logXSSChange in interface DeXSSChangeListener
Parameters:
message - Main message
item1 - Information item 1
item2 - Information item 2