Package org.cyberneko.html.filters
Class DefaultFilter
java.lang.Object
org.cyberneko.html.filters.DefaultFilter
- All Implemented Interfaces:
org.apache.xerces.xni.parser.XMLComponent,org.apache.xerces.xni.parser.XMLDocumentFilter,org.apache.xerces.xni.parser.XMLDocumentSource,org.apache.xerces.xni.XMLDocumentHandler,HTMLComponent
- Direct Known Subclasses:
ElementRemover,Identity,NamespaceBinder,Purifier,Writer
public class DefaultFilter
extends Object
implements org.apache.xerces.xni.parser.XMLDocumentFilter, HTMLComponent
This class implements a filter that simply passes document
events to the next handler. It can be used as a base class to
simplify the development of new document filters.
- Version:
- $Id: DefaultFilter.java,v 1.7 2005/02/14 03:56:54 andyc Exp $
- Author:
- Andy Clark
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.apache.xerces.xni.XMLDocumentHandlerDocument handler.protected org.apache.xerces.xni.parser.XMLDocumentSourceDocument source. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcharacters(org.apache.xerces.xni.XMLString text, org.apache.xerces.xni.Augmentations augs) Characters.voidcomment(org.apache.xerces.xni.XMLString text, org.apache.xerces.xni.Augmentations augs) Comment.voiddoctypeDecl(String root, String publicId, String systemId, org.apache.xerces.xni.Augmentations augs) Doctype declaration.voidemptyElement(org.apache.xerces.xni.QName element, org.apache.xerces.xni.XMLAttributes attributes, org.apache.xerces.xni.Augmentations augs) Empty element.voidendCDATA(org.apache.xerces.xni.Augmentations augs) End CDATA section.voidendDocument(org.apache.xerces.xni.Augmentations augs) End document.voidendElement(org.apache.xerces.xni.QName element, org.apache.xerces.xni.Augmentations augs) End element.voidendGeneralEntity(String name, org.apache.xerces.xni.Augmentations augs) End general entity.voidendPrefixMapping(String prefix, org.apache.xerces.xni.Augmentations augs) End prefix mapping.org.apache.xerces.xni.XMLDocumentHandlerReturns the document handler.org.apache.xerces.xni.parser.XMLDocumentSourceReturns the document source.getFeatureDefault(String featureId) Returns the default state for a feature, or null if this component does not want to report a default value for this feature.getPropertyDefault(String propertyId) Returns the default state for a property, or null if this component does not want to report a default value for this property.String[]Returns a list of feature identifiers that are recognized by this component.String[]Returns a list of property identifiers that are recognized by this component.voidignorableWhitespace(org.apache.xerces.xni.XMLString text, org.apache.xerces.xni.Augmentations augs) Ignorable whitespace.protected static String[]Utility method for merging string arrays for recognized features and recognized properties.voidprocessingInstruction(String target, org.apache.xerces.xni.XMLString data, org.apache.xerces.xni.Augmentations augs) Processing instruction.voidreset(org.apache.xerces.xni.parser.XMLComponentManager componentManager) Resets the component.voidsetDocumentHandler(org.apache.xerces.xni.XMLDocumentHandler handler) Sets the document handler.voidsetDocumentSource(org.apache.xerces.xni.parser.XMLDocumentSource source) Sets the document source.voidsetFeature(String featureId, boolean state) Sets the state of a feature.voidsetProperty(String propertyId, Object value) Sets the value of a property.voidstartCDATA(org.apache.xerces.xni.Augmentations augs) Start CDATA section.voidstartDocument(org.apache.xerces.xni.XMLLocator locator, String encoding, org.apache.xerces.xni.Augmentations augs) Start document.voidstartDocument(org.apache.xerces.xni.XMLLocator locator, String encoding, org.apache.xerces.xni.NamespaceContext nscontext, org.apache.xerces.xni.Augmentations augs) Start document.voidstartElement(org.apache.xerces.xni.QName element, org.apache.xerces.xni.XMLAttributes attributes, org.apache.xerces.xni.Augmentations augs) Start element.voidstartGeneralEntity(String name, org.apache.xerces.xni.XMLResourceIdentifier id, String encoding, org.apache.xerces.xni.Augmentations augs) Start general entity.voidstartPrefixMapping(String prefix, String uri, org.apache.xerces.xni.Augmentations augs) Start prefix mapping.voidText declaration.voidxmlDecl(String version, String encoding, String standalone, org.apache.xerces.xni.Augmentations augs) XML declaration.
-
Field Details
-
fDocumentHandler
protected org.apache.xerces.xni.XMLDocumentHandler fDocumentHandlerDocument handler. -
fDocumentSource
protected org.apache.xerces.xni.parser.XMLDocumentSource fDocumentSourceDocument source.
-
-
Constructor Details
-
DefaultFilter
public DefaultFilter()
-
-
Method Details
-
setDocumentHandler
public void setDocumentHandler(org.apache.xerces.xni.XMLDocumentHandler handler) Sets the document handler.- Specified by:
setDocumentHandlerin interfaceorg.apache.xerces.xni.parser.XMLDocumentSource
-
getDocumentHandler
public org.apache.xerces.xni.XMLDocumentHandler getDocumentHandler()Returns the document handler.- Specified by:
getDocumentHandlerin interfaceorg.apache.xerces.xni.parser.XMLDocumentSource
-
setDocumentSource
public void setDocumentSource(org.apache.xerces.xni.parser.XMLDocumentSource source) Sets the document source.- Specified by:
setDocumentSourcein interfaceorg.apache.xerces.xni.XMLDocumentHandler
-
getDocumentSource
public org.apache.xerces.xni.parser.XMLDocumentSource getDocumentSource()Returns the document source.- Specified by:
getDocumentSourcein interfaceorg.apache.xerces.xni.XMLDocumentHandler
-
startDocument
public void startDocument(org.apache.xerces.xni.XMLLocator locator, String encoding, org.apache.xerces.xni.NamespaceContext nscontext, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException Start document.- Specified by:
startDocumentin interfaceorg.apache.xerces.xni.XMLDocumentHandler- Throws:
org.apache.xerces.xni.XNIException
-
xmlDecl
public void xmlDecl(String version, String encoding, String standalone, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException XML declaration.- Specified by:
xmlDeclin interfaceorg.apache.xerces.xni.XMLDocumentHandler- Throws:
org.apache.xerces.xni.XNIException
-
doctypeDecl
public void doctypeDecl(String root, String publicId, String systemId, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException Doctype declaration.- Specified by:
doctypeDeclin interfaceorg.apache.xerces.xni.XMLDocumentHandler- Throws:
org.apache.xerces.xni.XNIException
-
comment
public void comment(org.apache.xerces.xni.XMLString text, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException Comment.- Specified by:
commentin interfaceorg.apache.xerces.xni.XMLDocumentHandler- Throws:
org.apache.xerces.xni.XNIException
-
processingInstruction
public void processingInstruction(String target, org.apache.xerces.xni.XMLString data, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException Processing instruction.- Specified by:
processingInstructionin interfaceorg.apache.xerces.xni.XMLDocumentHandler- Throws:
org.apache.xerces.xni.XNIException
-
startElement
public void startElement(org.apache.xerces.xni.QName element, org.apache.xerces.xni.XMLAttributes attributes, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException Start element.- Specified by:
startElementin interfaceorg.apache.xerces.xni.XMLDocumentHandler- Throws:
org.apache.xerces.xni.XNIException
-
emptyElement
public void emptyElement(org.apache.xerces.xni.QName element, org.apache.xerces.xni.XMLAttributes attributes, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException Empty element.- Specified by:
emptyElementin interfaceorg.apache.xerces.xni.XMLDocumentHandler- Throws:
org.apache.xerces.xni.XNIException
-
characters
public void characters(org.apache.xerces.xni.XMLString text, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException Characters.- Specified by:
charactersin interfaceorg.apache.xerces.xni.XMLDocumentHandler- Throws:
org.apache.xerces.xni.XNIException
-
ignorableWhitespace
public void ignorableWhitespace(org.apache.xerces.xni.XMLString text, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException Ignorable whitespace.- Specified by:
ignorableWhitespacein interfaceorg.apache.xerces.xni.XMLDocumentHandler- Throws:
org.apache.xerces.xni.XNIException
-
startGeneralEntity
public void startGeneralEntity(String name, org.apache.xerces.xni.XMLResourceIdentifier id, String encoding, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException Start general entity.- Specified by:
startGeneralEntityin interfaceorg.apache.xerces.xni.XMLDocumentHandler- Throws:
org.apache.xerces.xni.XNIException
-
textDecl
public void textDecl(String version, String encoding, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException Text declaration.- Specified by:
textDeclin interfaceorg.apache.xerces.xni.XMLDocumentHandler- Throws:
org.apache.xerces.xni.XNIException
-
endGeneralEntity
public void endGeneralEntity(String name, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException End general entity.- Specified by:
endGeneralEntityin interfaceorg.apache.xerces.xni.XMLDocumentHandler- Throws:
org.apache.xerces.xni.XNIException
-
startCDATA
public void startCDATA(org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException Start CDATA section.- Specified by:
startCDATAin interfaceorg.apache.xerces.xni.XMLDocumentHandler- Throws:
org.apache.xerces.xni.XNIException
-
endCDATA
public void endCDATA(org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException End CDATA section.- Specified by:
endCDATAin interfaceorg.apache.xerces.xni.XMLDocumentHandler- Throws:
org.apache.xerces.xni.XNIException
-
endElement
public void endElement(org.apache.xerces.xni.QName element, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException End element.- Specified by:
endElementin interfaceorg.apache.xerces.xni.XMLDocumentHandler- Throws:
org.apache.xerces.xni.XNIException
-
endDocument
public void endDocument(org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException End document.- Specified by:
endDocumentin interfaceorg.apache.xerces.xni.XMLDocumentHandler- Throws:
org.apache.xerces.xni.XNIException
-
startDocument
public void startDocument(org.apache.xerces.xni.XMLLocator locator, String encoding, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException Start document.- Throws:
org.apache.xerces.xni.XNIException
-
startPrefixMapping
public void startPrefixMapping(String prefix, String uri, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException Start prefix mapping.- Throws:
org.apache.xerces.xni.XNIException
-
endPrefixMapping
public void endPrefixMapping(String prefix, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException End prefix mapping.- Throws:
org.apache.xerces.xni.XNIException
-
getRecognizedFeatures
Returns a list of feature identifiers that are recognized by this component. This method may return null if no features are recognized by this component.- Specified by:
getRecognizedFeaturesin interfaceorg.apache.xerces.xni.parser.XMLComponent
-
getFeatureDefault
Returns the default state for a feature, or null if this component does not want to report a default value for this feature.- Specified by:
getFeatureDefaultin interfaceHTMLComponent- Specified by:
getFeatureDefaultin interfaceorg.apache.xerces.xni.parser.XMLComponent
-
getRecognizedProperties
Returns a list of property identifiers that are recognized by this component. This method may return null if no properties are recognized by this component.- Specified by:
getRecognizedPropertiesin interfaceorg.apache.xerces.xni.parser.XMLComponent
-
getPropertyDefault
Returns the default state for a property, or null if this component does not want to report a default value for this property.- Specified by:
getPropertyDefaultin interfaceHTMLComponent- Specified by:
getPropertyDefaultin interfaceorg.apache.xerces.xni.parser.XMLComponent
-
reset
public void reset(org.apache.xerces.xni.parser.XMLComponentManager componentManager) throws org.apache.xerces.xni.parser.XMLConfigurationException Resets the component. The component can query the component manager about any features and properties that affect the operation of the component.- Specified by:
resetin interfaceorg.apache.xerces.xni.parser.XMLComponent- Parameters:
componentManager- The component manager.- Throws:
org.apache.xerces.xni.XNIException- Thrown by component on initialization error.org.apache.xerces.xni.parser.XMLConfigurationException
-
setFeature
public void setFeature(String featureId, boolean state) throws org.apache.xerces.xni.parser.XMLConfigurationException Sets the state of a feature. This method is called by the component manager any time after reset when a feature changes state.Note: Components should silently ignore features that do not affect the operation of the component.
- Specified by:
setFeaturein interfaceorg.apache.xerces.xni.parser.XMLComponent- Parameters:
featureId- The feature identifier.state- The state of the feature.- Throws:
org.apache.xerces.xni.parser.XMLConfigurationException- Thrown for configuration error. In general, components should only throw this exception if it is really a critical error.
-
setProperty
public void setProperty(String propertyId, Object value) throws org.apache.xerces.xni.parser.XMLConfigurationException Sets the value of a property. This method is called by the component manager any time after reset when a property changes value.Note: Components should silently ignore properties that do not affect the operation of the component.
- Specified by:
setPropertyin interfaceorg.apache.xerces.xni.parser.XMLComponent- Parameters:
propertyId- The property identifier.value- The value of the property.- Throws:
org.apache.xerces.xni.parser.XMLConfigurationException- Thrown for configuration error. In general, components should only throw this exception if it is really a critical error.
-
merge
Utility method for merging string arrays for recognized features and recognized properties.
-