org.cyberneko.html.filters

Class DefaultFilter

public class DefaultFilter extends Object implements 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
protected XMLDocumentHandlerfDocumentHandler
Document handler.
protected XMLDocumentSourcefDocumentSource
Document source.
Method Summary
voidcharacters(XMLString text, Augmentations augs)
Characters.
voidcomment(XMLString text, Augmentations augs)
Comment.
voiddoctypeDecl(String root, String publicId, String systemId, Augmentations augs)
Doctype declaration.
voidemptyElement(QName element, XMLAttributes attributes, Augmentations augs)
Empty element.
voidendCDATA(Augmentations augs)
End CDATA section.
voidendDocument(Augmentations augs)
End document.
voidendElement(QName element, Augmentations augs)
End element.
voidendGeneralEntity(String name, Augmentations augs)
End general entity.
voidendPrefixMapping(String prefix, Augmentations augs)
End prefix mapping.
XMLDocumentHandlergetDocumentHandler()
Returns the document handler.
XMLDocumentSourcegetDocumentSource()
Returns the document source.
BooleangetFeatureDefault(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.
ObjectgetPropertyDefault(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[]getRecognizedFeatures()
Returns a list of feature identifiers that are recognized by this component.
String[]getRecognizedProperties()
Returns a list of property identifiers that are recognized by this component.
voidignorableWhitespace(XMLString text, Augmentations augs)
Ignorable whitespace.
protected static String[]merge(String[] array1, String[] array2)
Utility method for merging string arrays for recognized features and recognized properties.
voidprocessingInstruction(String target, XMLString data, Augmentations augs)
Processing instruction.
voidreset(XMLComponentManager componentManager)
Resets the component.
voidsetDocumentHandler(XMLDocumentHandler handler)
Sets the document handler.
voidsetDocumentSource(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(Augmentations augs)
Start CDATA section.
voidstartDocument(XMLLocator locator, String encoding, NamespaceContext nscontext, Augmentations augs)
Start document.
voidstartDocument(XMLLocator locator, String encoding, Augmentations augs)
Start document.
voidstartElement(QName element, XMLAttributes attributes, Augmentations augs)
Start element.
voidstartGeneralEntity(String name, XMLResourceIdentifier id, String encoding, Augmentations augs)
Start general entity.
voidstartPrefixMapping(String prefix, String uri, Augmentations augs)
Start prefix mapping.
voidtextDecl(String version, String encoding, Augmentations augs)
Text declaration.
voidxmlDecl(String version, String encoding, String standalone, Augmentations augs)
XML declaration.

Field Detail

fDocumentHandler

protected XMLDocumentHandler fDocumentHandler
Document handler.

fDocumentSource

protected XMLDocumentSource fDocumentSource
Document source.

Method Detail

characters

public void characters(XMLString text, Augmentations augs)
Characters.

comment

public void comment(XMLString text, Augmentations augs)
Comment.

doctypeDecl

public void doctypeDecl(String root, String publicId, String systemId, Augmentations augs)
Doctype declaration.

emptyElement

public void emptyElement(QName element, XMLAttributes attributes, Augmentations augs)
Empty element.

endCDATA

public void endCDATA(Augmentations augs)
End CDATA section.

endDocument

public void endDocument(Augmentations augs)
End document.

endElement

public void endElement(QName element, Augmentations augs)
End element.

endGeneralEntity

public void endGeneralEntity(String name, Augmentations augs)
End general entity.

endPrefixMapping

public void endPrefixMapping(String prefix, Augmentations augs)
End prefix mapping.

getDocumentHandler

public XMLDocumentHandler getDocumentHandler()
Returns the document handler.

getDocumentSource

public XMLDocumentSource getDocumentSource()
Returns the document source.

getFeatureDefault

public Boolean 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

public Object 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.

getRecognizedFeatures

public String[] 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.

getRecognizedProperties

public String[] 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.

ignorableWhitespace

public void ignorableWhitespace(XMLString text, Augmentations augs)
Ignorable whitespace.

merge

protected static String[] merge(String[] array1, String[] array2)
Utility method for merging string arrays for recognized features and recognized properties.

processingInstruction

public void processingInstruction(String target, XMLString data, Augmentations augs)
Processing instruction.

reset

public void reset(XMLComponentManager componentManager)
Resets the component. The component can query the component manager about any features and properties that affect the operation of the component.

Parameters: componentManager The component manager.

Throws: XNIException Thrown by component on initialization error.

setDocumentHandler

public void setDocumentHandler(XMLDocumentHandler handler)
Sets the document handler.

setDocumentSource

public void setDocumentSource(XMLDocumentSource source)
Sets the document source.

setFeature

public void setFeature(String featureId, boolean state)
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.

Parameters: featureId The feature identifier. state The state of the feature.

Throws: 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)
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.

Parameters: propertyId The property identifier. value The value of the property.

Throws: XMLConfigurationException Thrown for configuration error. In general, components should only throw this exception if it is really a critical error.

startCDATA

public void startCDATA(Augmentations augs)
Start CDATA section.

startDocument

public void startDocument(XMLLocator locator, String encoding, NamespaceContext nscontext, Augmentations augs)
Start document.

startDocument

public void startDocument(XMLLocator locator, String encoding, Augmentations augs)
Start document.

startElement

public void startElement(QName element, XMLAttributes attributes, Augmentations augs)
Start element.

startGeneralEntity

public void startGeneralEntity(String name, XMLResourceIdentifier id, String encoding, Augmentations augs)
Start general entity.

startPrefixMapping

public void startPrefixMapping(String prefix, String uri, Augmentations augs)
Start prefix mapping.

textDecl

public void textDecl(String version, String encoding, Augmentations augs)
Text declaration.

xmlDecl

public void xmlDecl(String version, String encoding, String standalone, Augmentations augs)
XML declaration.
(C) Copyright 2002-2005, Andy Clark. All rights reserved.