Class NamespaceBinder
java.lang.Object
org.htmlunit.cyberneko.filters.DefaultFilter
org.htmlunit.cyberneko.filters.NamespaceBinder
- All Implemented Interfaces:
HTMLComponent, XMLComponent, XMLDocumentFilter, XMLDocumentSource, XMLDocumentHandler
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:
- http://xml.org/sax/features/namespaces
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThis namespace context object implements the old and new XNINamespaceContextinterface methods so that it can be used across all versions of Xerces2. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Boolean[]Feature defaults.private final HTMLConfigurationprivate static final StringInsert namespace binding URIs.private booleanInsert namespaces.private static final StringModify HTML element names: { "upper", "lower", "default" }.private static final shortLowercase HTML names.private static final shortDon't modify HTML names.private static final shortUppercase HTML names.private shortModify HTML element names.private final NamespaceBinder.NamespaceSupportNamespace context.private static final StringNamespaces.private booleanNamespaces.private static final StringNamespaces URI.private StringNamespaces URI.private static final StringOverride namespace binding URI.private booleanOverride namespaces.private static final Object[]Property defaults.private final QNameQName.private static final String[]Recognized features.private static final String[]Recognized properties.static final StringXHTML 1.0 namespace URI (http://www.w3.org/1999/xhtml).static final StringXML namespace URI (http://www.w3.org/XML/1998/namespace).static final StringXMLNS namespace URI (http://www.w3.org/2000/xmlns/). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbindNamespaces(QName element, XMLAttributes attrs) voidemptyElement(QName element, XMLAttributes attrs, Augmentations augs) Empty element.voidendElement(QName element, Augmentations augs) End element.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.protected static shortgetNamesValue(String value) 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.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.protected static StringmodifyName(String name, short mode) voidreset(XMLComponentManager manager) Resets the component.voidstartDocument(XMLLocator locator, String encoding, NamespaceContext nscontext, Augmentations augs) Start document.voidstartElement(QName element, XMLAttributes attrs, Augmentations augs) Start element.Methods inherited from class DefaultFilter
characters, comment, doctypeDecl, endCDATA, endDocument, getDocumentHandler, getDocumentSource, merge, processingInstruction, setDocumentHandler, setDocumentSource, setFeature, setProperty, startCDATA, xmlDecl
-
Field Details
-
XHTML_1_0_URI
XHTML 1.0 namespace URI (http://www.w3.org/1999/xhtml).- See Also:
-
XML_URI
XML namespace URI (http://www.w3.org/XML/1998/namespace).- See Also:
-
XMLNS_URI
-
NAMESPACES
-
OVERRIDE_NAMESPACES
-
INSERT_NAMESPACES
-
RECOGNIZED_FEATURES
Recognized features. -
FEATURE_DEFAULTS
Feature defaults. -
NAMES_ELEMS
Modify HTML element names: { "upper", "lower", "default" }.- See Also:
-
NAMESPACES_URI
-
RECOGNIZED_PROPERTIES
Recognized properties. -
PROPERTY_DEFAULTS
Property defaults. -
NAMES_NO_CHANGE
private static final short NAMES_NO_CHANGEDon't modify HTML names.- See Also:
-
NAMES_UPPERCASE
private static final short NAMES_UPPERCASEUppercase HTML names.- See Also:
-
NAMES_LOWERCASE
private static final short NAMES_LOWERCASELowercase HTML names.- See Also:
-
namespaces_
private boolean namespaces_Namespaces. -
overrideNamespaces_
private boolean overrideNamespaces_Override namespaces. -
insertNamespaces_
private boolean insertNamespaces_Insert namespaces. -
namesElems_
private short namesElems_Modify HTML element names. -
namespacesURI_
Namespaces URI. -
namespaceContext_
Namespace context. -
qName_
QName. -
htmlConfiguration_
-
-
Constructor Details
-
NamespaceBinder
-
-
Method Details
-
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 interfaceXMLComponent- Overrides:
getRecognizedFeaturesin classDefaultFilter- Returns:
- an array of feature identifiers that are recognized by this component. This method may return null if no features are recognized by this component.
-
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 interfaceXMLComponent- Overrides:
getFeatureDefaultin classDefaultFilter- Parameters:
featureId- The feature identifier.- Returns:
- the default state for a feature, or null if this component does not want to report a default value for this feature.
-
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 interfaceXMLComponent- Overrides:
getRecognizedPropertiesin classDefaultFilter- Returns:
- an array of property identifiers that are recognized by this component. This method may return null if no properties are recognized by this component.
-
getPropertyDefault
Returns the default value 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 interfaceXMLComponent- Overrides:
getPropertyDefaultin classDefaultFilter- Parameters:
propertyId- The property identifier.- Returns:
- the default state for a property, or null if this component does not want to report a default value for this property
-
reset
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 interfaceXMLComponent- Overrides:
resetin classDefaultFilter- Parameters:
manager- The component manager.- Throws:
XNIException- Thrown by component on initialization error.XMLConfigurationException
-
startDocument
public void startDocument(XMLLocator locator, String encoding, NamespaceContext nscontext, Augmentations augs) throws XNIException Start document.- Specified by:
startDocumentin interfaceXMLDocumentHandler- Overrides:
startDocumentin classDefaultFilter- Parameters:
locator- The document locator, or null if the document location cannot be reported during the parsing of this document. However, it is strongly recommended that a locator be supplied that can at least report the system identifier of the document.encoding- The auto-detected IANA encoding name of the entity stream. This value will be null in those situations where the entity encoding is not auto-detected (e.g. internal entities or a document entity that is parsed from a java.io.Reader).nscontext- The namespace context in effect at the start of this document. This object represents the current context. Implementors of this class are responsible for copying the namespace bindings from the the current context (and its parent contexts) if that information is important.augs- Additional information that may include infoset augmentations- Throws:
XNIException- Thrown by handler to signal an error.
-
startElement
public void startElement(QName element, XMLAttributes attrs, Augmentations augs) throws XNIException Start element.- Specified by:
startElementin interfaceXMLDocumentHandler- Overrides:
startElementin classDefaultFilter- Parameters:
element- The name of the element.attrs- The element attributes.augs- Additional information that may include infoset augmentations- Throws:
XNIException- Thrown by handler to signal an error.
-
emptyElement
public void emptyElement(QName element, XMLAttributes attrs, Augmentations augs) throws XNIException Empty element.- Specified by:
emptyElementin interfaceXMLDocumentHandler- Overrides:
emptyElementin classDefaultFilter- Parameters:
element- The name of the element.attrs- The element attributes.augs- Additional information that may include infoset augmentations- Throws:
XNIException- Thrown by handler to signal an error.
-
endElement
End element.- Specified by:
endElementin interfaceXMLDocumentHandler- Overrides:
endElementin classDefaultFilter- Parameters:
element- The name of the element.augs- Additional information that may include infoset augmentations- Throws:
XNIException- Thrown by handler to signal an error.
-
getNamesValue
-
modifyName
-
bindNamespaces
-