Package org.htmlunit.cyberneko.filters
Class NamespaceBinder.NamespaceSupport
- java.lang.Object
-
- org.htmlunit.cyberneko.filters.NamespaceBinder.NamespaceSupport
-
- All Implemented Interfaces:
NamespaceContext
- Enclosing class:
- NamespaceBinder
public static class NamespaceBinder.NamespaceSupport extends java.lang.Object implements NamespaceContext
This namespace context object implements the old and new XNINamespaceContext
interface methods so that it can be used across all versions of Xerces2.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
NamespaceBinder.NamespaceSupport.Entry
A namespace binding entry.
-
Field Summary
Fields Modifier and Type Field Description private NamespaceBinder.NamespaceSupport.Entry[]
entries_
The entries.private int[]
levels_
The levels of the entries.private int
top_
Top of the levels list.-
Fields inherited from interface org.htmlunit.cyberneko.xerces.xni.NamespaceContext
XML_URI, XMLNS_URI
-
-
Constructor Summary
Constructors Constructor Description NamespaceSupport()
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
declarePrefix(java.lang.String prefix, java.lang.String uri)
Declare prefix.java.lang.String
getDeclaredPrefixAt(int index)
Get declared prefix at.int
getDeclaredPrefixCount()
Get declared prefix count.NamespaceContext
getParentContext()
java.lang.String
getURI(java.lang.String prefix)
Get URI.void
popContext()
Pop context.void
pushContext()
Push context.void
reset()
Reset.
-
-
-
Field Detail
-
top_
private int top_
Top of the levels list.
-
levels_
private int[] levels_
The levels of the entries.
-
entries_
private NamespaceBinder.NamespaceSupport.Entry[] entries_
The entries.
-
-
Method Detail
-
getURI
public java.lang.String getURI(java.lang.String prefix)
Get URI.- Specified by:
getURI
in interfaceNamespaceContext
- Parameters:
prefix
- The prefix to look up.- Returns:
- The associated Namespace URI, or null if the prefix is undeclared in this context.
-
getDeclaredPrefixCount
public int getDeclaredPrefixCount()
Get declared prefix count.- Specified by:
getDeclaredPrefixCount
in interfaceNamespaceContext
- Returns:
- a count of locally declared prefixes, including the default prefix if bound.
-
getDeclaredPrefixAt
public java.lang.String getDeclaredPrefixAt(int index)
Get declared prefix at.- Specified by:
getDeclaredPrefixAt
in interfaceNamespaceContext
- Parameters:
index
- the index pos- Returns:
- the prefix at the specified index in the current context.
-
getParentContext
public NamespaceContext getParentContext()
-
reset
public void reset()
Reset.- Specified by:
reset
in interfaceNamespaceContext
-
pushContext
public void pushContext()
Push context.- Specified by:
pushContext
in interfaceNamespaceContext
- See Also:
NamespaceContext.popContext()
-
popContext
public void popContext()
Pop context.- Specified by:
popContext
in interfaceNamespaceContext
- See Also:
NamespaceContext.pushContext()
-
declarePrefix
public boolean declarePrefix(java.lang.String prefix, java.lang.String uri)
Declare prefix.- Specified by:
declarePrefix
in interfaceNamespaceContext
- Parameters:
prefix
- The prefix to declare, or null for the empty string.uri
- The Namespace URI to associate with the prefix.- Returns:
- true if the prefix was legal, false otherwise
- See Also:
NamespaceContext.getURI(java.lang.String)
,NamespaceContext.getDeclaredPrefixAt(int)
-
-