@API(type=EXTENDABLE,
src=PRIVATE)
public class ProxyNamespaceMapping
extends java.lang.Object
implements java.lang.Cloneable
Constructor and Description |
---|
ProxyNamespaceMapping()
Constructor.
|
ProxyNamespaceMapping(org.w3c.dom.Node node)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addMapping(java.lang.String prefix,
java.lang.String namespace)
Adds a prefix-namespace mapping.
|
void |
clear()
Clear all mappings.
|
java.lang.Object |
clone()
Clones the prefix namespace mapping.
|
ProxyNamespaceMapping |
getMappingsFromAncestor(ProxyNamespaceMapping prefixNamespaceMapping)
Get mapping from ancestor, by removing from the current one the given mappings.
|
java.lang.String |
getNamespaceForAttributePrefix(java.lang.String prefix)
Gets the URI namespace for the specified attribute prefix.
|
java.lang.String |
getNamespaceForPrefix(java.lang.String prefix)
Gets the URI namespace for the specified prefix.
|
java.util.Set<java.lang.String> |
getNamespaces()
Get all the namespaces encountered so far.
|
java.lang.String[] |
getPrefixesForNamespace(java.lang.String namespace)
Gets the prefixes namespace for the specified namespace URI.
|
protected java.lang.String[] |
getPrefixesForNamespace(java.lang.String namespace,
boolean allowDefault)
Gets the prefix namespace for the specified namespace URI ignoring or not
the default namespaces as depending on the
allowDefault value. |
java.lang.String |
getPrefixForAttributeNamespace(java.lang.String namespace)
Gets the prefix namespace for the specified namespace URI ignoring the
default namespaces as they do not apply for attributes.
|
java.lang.String |
getPrefixForNamespace(java.lang.String namespace)
Gets the prefix namespace for the specified namespace URI.
|
protected java.lang.String |
getPrefixForNamespace(java.lang.String namespace,
boolean allowDefault)
Gets the prefix namespace for the specified namespace URI ignoring or not
the default namespaces as depending on the
allowDefault value. |
java.util.List<java.lang.String> |
getProxies()
Get the prefixes from the mapping.
|
void |
removeByNamespace(java.lang.String namespace)
Removes a mapping by indicating the namespace.
|
void |
removeByPrefix(java.lang.String prefix)
Removes a mapping by indicating the prefix.
|
void |
removeLastMapping()
Removes the last mapping.
|
java.lang.String |
toString() |
void |
update(org.w3c.dom.Node node)
Updates the content of the prefix namespace mapping based on a node and its
parents.
|
void |
updateNamespaceProxyMapping(java.lang.String namespace,
java.lang.String prefix)
Update a currently available namespace prefix mapping.
|
public ProxyNamespaceMapping(org.w3c.dom.Node node)
node
- The context node, DOM Level 1, the prefix namespace mapping will
be populated based on the xmlns
attributes, starting with the
root element.public ProxyNamespaceMapping()
public void update(org.w3c.dom.Node node)
node
- The node, must be DOM Level 1.public void addMapping(java.lang.String prefix, java.lang.String namespace)
prefix
- The prefix
string.namespace
- The namespace
string.public java.lang.String getNamespaceForAttributePrefix(java.lang.String prefix)
getNamespaceForPrefix(String)
otherwise.prefix
- The prefix
string.null
.public java.lang.String getNamespaceForPrefix(java.lang.String prefix)
prefix
- The prefix string.null
.public java.lang.String[] getPrefixesForNamespace(java.lang.String namespace)
namespace
- The namespace URI.public java.lang.String getPrefixForNamespace(java.lang.String namespace)
namespace
- The namespace URI.null
.public java.lang.String getPrefixForAttributeNamespace(java.lang.String namespace)
namespace
- The namespace URI of an attribute.null
.protected final java.lang.String getPrefixForNamespace(java.lang.String namespace, boolean allowDefault)
allowDefault
value.namespace
- The namespace URI of an attribute.allowDefault
- True
if default namespace should be allowed.null
.protected final java.lang.String[] getPrefixesForNamespace(java.lang.String namespace, boolean allowDefault)
allowDefault
value.namespace
- The namespace URI of an attribute.allowDefault
- True
if default namespace should be allowed.null
.public void removeByPrefix(java.lang.String prefix)
prefix
- The prefix string (not null
).public void removeByNamespace(java.lang.String namespace)
namespace
- The namespace URI(not null
).public void clear()
public java.lang.String toString()
toString
in class java.lang.Object
public void removeLastMapping()
public java.util.Set<java.lang.String> getNamespaces()
public java.lang.Object clone()
clone
in class java.lang.Object
public java.util.List<java.lang.String> getProxies()
public ProxyNamespaceMapping getMappingsFromAncestor(ProxyNamespaceMapping prefixNamespaceMapping)
prefixNamespaceMapping
- The prefix namespace mapping that must be
removed from the current one.public void updateNamespaceProxyMapping(java.lang.String namespace, java.lang.String prefix)
namespace
- The namespace.prefix
- New prefix.© Copyright SyncRO Soft SRL 2002 - 2016. All rights reserved.