org.cyberneko.html.filters

Class NamespaceBinder

public class NamespaceBinder extends DefaultFilter

This filter binds namespaces if namespace processing is turned on by setting the feature "http://xml.org/sax/features/namespaces" is set to true.

This configuration recognizes the following features:

Version: $Id: NamespaceBinder.java,v 1.8 2005/05/30 00:19:28 andyc Exp $

Author: Andy Clark

Nested Class Summary
static classNamespaceBinder.NamespaceSupport
This namespace context object implements the old and new XNI NamespaceContext interface methods so that it can be used across all versions of Xerces2.
Field Summary
protected booleanfInsertNamespaces
Insert namespaces.
protected shortfNamesAttrs
Modify HTML attribute names.
protected shortfNamesElems
Modify HTML element names.
protected NamespaceBinder.NamespaceSupportfNamespaceContext
Namespace context.
protected booleanfNamespacePrefixes
Namespace prefixes.
protected booleanfNamespaces
Namespaces.
protected StringfNamespacesURI
Namespaces URI.
protected booleanfOverrideNamespaces
Override namespaces.
protected static StringINSERT_NAMESPACES
Insert namespace binding URIs.
protected static StringNAMESPACES
Namespaces.
protected static StringNAMESPACES_URI
Namespaces URI.
protected static StringNAMES_ATTRS
Modify HTML attribute names: { "upper", "lower", "default" }.
protected static StringNAMES_ELEMS
Modify HTML element names: { "upper", "lower", "default" }.
protected static shortNAMES_LOWERCASE
Lowercase HTML names.
protected static shortNAMES_NO_CHANGE
Don't modify HTML names.
protected static shortNAMES_UPPERCASE
Uppercase HTML names.
protected static StringOVERRIDE_NAMESPACES
Override namespace binding URI.
static StringXHTML_1_0_URI
XHTML 1.0 namespace URI (http://www.w3.org/1999/xhtml).
static StringXMLNS_URI
XMLNS namespace URI (http://www.w3.org/2000/xmlns/).
static StringXML_URI
XML namespace URI (http://www.w3.org/XML/1998/namespace).
Method Summary
protected voidbindNamespaces(QName element, XMLAttributes attrs)
Binds namespaces.
voidemptyElement(QName element, XMLAttributes attrs, Augmentations augs)
Empty element.
voidendElement(QName element, Augmentations augs)
End element.
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.
protected static shortgetNamesValue(String value)
Converts HTML names string value to constant value.
ObjectgetPropertyDefault(String propertyId)
Returns the default value 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.
protected static StringmodifyName(String name, short mode)
Modifies the given name based on the specified mode.
voidreset(XMLComponentManager manager)
Resets the component.
protected static voidsplitQName(QName qname)
Splits a qualified name.
voidstartDocument(XMLLocator locator, String encoding, NamespaceContext nscontext, Augmentations augs)
Start document.
voidstartElement(QName element, XMLAttributes attrs, Augmentations augs)
Start element.

Field Detail

fInsertNamespaces

protected boolean fInsertNamespaces
Insert namespaces.

fNamesAttrs

protected short fNamesAttrs
Modify HTML attribute names.

fNamesElems

protected short fNamesElems
Modify HTML element names.

fNamespaceContext

protected final NamespaceBinder.NamespaceSupport fNamespaceContext
Namespace context.

fNamespacePrefixes

protected boolean fNamespacePrefixes
Namespace prefixes.

fNamespaces

protected boolean fNamespaces
Namespaces.

fNamespacesURI

protected String fNamespacesURI
Namespaces URI.

fOverrideNamespaces

protected boolean fOverrideNamespaces
Override namespaces.

INSERT_NAMESPACES

protected static final String INSERT_NAMESPACES
Insert namespace binding URIs.

NAMESPACES

protected static final String NAMESPACES
Namespaces.

NAMESPACES_URI

protected static final String NAMESPACES_URI
Namespaces URI.

NAMES_ATTRS

protected static final String NAMES_ATTRS
Modify HTML attribute names: { "upper", "lower", "default" }.

NAMES_ELEMS

protected static final String NAMES_ELEMS
Modify HTML element names: { "upper", "lower", "default" }.

NAMES_LOWERCASE

protected static final short NAMES_LOWERCASE
Lowercase HTML names.

NAMES_NO_CHANGE

protected static final short NAMES_NO_CHANGE
Don't modify HTML names.

NAMES_UPPERCASE

protected static final short NAMES_UPPERCASE
Uppercase HTML names.

OVERRIDE_NAMESPACES

protected static final String OVERRIDE_NAMESPACES
Override namespace binding URI.

XHTML_1_0_URI

public static final String XHTML_1_0_URI
XHTML 1.0 namespace URI (http://www.w3.org/1999/xhtml).

XMLNS_URI

public static final String XMLNS_URI
XMLNS namespace URI (http://www.w3.org/2000/xmlns/).

XML_URI

public static final String XML_URI
XML namespace URI (http://www.w3.org/XML/1998/namespace).

Method Detail

bindNamespaces

protected void bindNamespaces(QName element, XMLAttributes attrs)
Binds namespaces.

emptyElement

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

endElement

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

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.

getNamesValue

protected static final short getNamesValue(String value)
Converts HTML names string value to constant value.

See Also: NAMES_NO_CHANGE NAMES_LOWERCASE NAMES_UPPERCASE

getPropertyDefault

public Object getPropertyDefault(String propertyId)
Returns the default value 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.

modifyName

protected static final String modifyName(String name, short mode)
Modifies the given name based on the specified mode.

reset

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

Parameters: manager The component manager.

Throws: XNIException Thrown by component on initialization error.

splitQName

protected static void splitQName(QName qname)
Splits a qualified name.

startDocument

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

startElement

public void startElement(QName element, XMLAttributes attrs, Augmentations augs)
Start element.
(C) Copyright 2002-2005, Andy Clark. All rights reserved.