Package org.apache.batik.dom.util
Class DOMUtilities.NSMap
java.lang.Object
org.apache.batik.dom.util.DOMUtilities.NSMap
- Enclosing class:
- DOMUtilities
A node in a linked list of prefix to namespace name mappings.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate DOMUtilities.NSMap
The next namespace prefix mapping in the list.private int
The next number to use when generating prefixes.private String
The namespace name that the prefix maps to.private String
The prefix to map. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DOMUtilities.NSMap
create()
Constructs a new namespace prefix mapping object with the XML and XMLNS namespaces predeclared.Declares a new prefix mapping by returning a newNSMap
object that links to this one.getNamespace
(String prefix) Returns the namespace URI that the specified prefix maps to, ornull
if the prefix has not been declared.Returns a new, generated namespace prefix.Returns the prefix appropriate for an attribute that maps to specified namespace URI.Returns the prefix appropriate for an element that maps to specified namespace URI.
-
Field Details
-
prefix
The prefix to map. -
ns
The namespace name that the prefix maps to. The empty string is used to represent no namespace. -
next
The next namespace prefix mapping in the list. -
nextPrefixNumber
private int nextPrefixNumberThe next number to use when generating prefixes. A prefix of the form"a" + number
is generated when serializing a node whose namespace URI does not correspond to a prefix in scope.
-
-
Constructor Details
-
NSMap
private NSMap()Creates a newNSMap
object.
-
-
Method Details
-
create
Constructs a new namespace prefix mapping object with the XML and XMLNS namespaces predeclared. -
declare
Declares a new prefix mapping by returning a newNSMap
object that links to this one. -
getNewPrefix
Returns a new, generated namespace prefix. -
getNamespace
Returns the namespace URI that the specified prefix maps to, ornull
if the prefix has not been declared. -
getPrefixForElement
Returns the prefix appropriate for an element that maps to specified namespace URI. If the specified namespace is the default namespace (i.e., it has an empty string prefix mapping to it), then the empty string is returned. If there is no appropriate prefix,null
is returned. -
getPrefixForAttr
Returns the prefix appropriate for an attribute that maps to specified namespace URI. If there is no appropriate prefix,null
is returned.
-