public class NamespaceRegistry
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static boolean |
namedDefaultCreationEnabled
NOT YET DOCUMENTED
|
static org.dom4j.Namespace |
NO_NAMESPACE
NOT YET DOCUMENTED
|
static java.lang.String |
schemaInstanceNamespaceUri
schema Instance Namespace Uri
|
static java.lang.String |
schemaNamespaceUri
schema Namespace Uri
|
static java.lang.String |
xmlNamespacePrefix
NOT YET DOCUMENTED
|
static java.lang.String |
xmlNamespaceUri
URI of xml namespace
|
Constructor and Description |
---|
NamespaceRegistry()
Initialize the data structures used by NamespaceRegistry
|
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
doQname(org.dom4j.Element element)
NOT YET DOCUMENTED
|
org.dom4j.Namespace |
getDefaultNamespace()
Gets the defaultNamespace attribute of the NamespaceRegistry object
|
org.dom4j.Namespace |
getNamedDefaultNamespace()
Returns a namespace having a non-empty prefix and the same URI as the
defaultNameSpace (if one exists).
|
static org.dom4j.Namespace |
getNamespace(org.dom4j.Document doc)
Gets the namespace attribute of the NamespaceRegistry class
|
org.jaxen.SimpleNamespaceContext |
getNamespaceContext()
Gets the namespaceContext attribute of the NamespaceRegistry object
|
static java.lang.String |
getNamespacePrefix(java.lang.String name)
Gets the namespacePrefix attribute of the NamespaceRegistry class
|
java.util.Collection |
getNamespaces()
Utility returns all Namespaces as a Collection.
|
org.dom4j.Namespace |
getNSforPrefix(java.lang.String prefix)
Gets the namespace corresponding to the specified prefix
|
org.dom4j.Namespace |
getNSforUri(java.lang.String uri)
Gets the Namespace for provided URI.
|
java.lang.String |
getPrefixforNS(org.dom4j.Namespace ns)
Gets the prefix for given namespace object, but uses the LOCAL namespace
(obtained by the provided namespace's uri) so that the prefix returned is
correct within the local context.
|
java.lang.String |
getPrefixforUri(java.lang.String uri)
Gets the prefix corresponding to the provided uri after finding that uri's
namespace.
|
java.util.Map |
getPrefixMap()
Gets the prefixMap attribute of the NamespaceRegistry object
|
org.dom4j.QName |
getQName(java.lang.String qualifiedName)
Gets the qName attribute of the NamespaceRegistry object
|
org.dom4j.Namespace |
getSchemaInstanceNamespace()
The schemaInstanceNamespace is used to introduce "xsi:type", "xsi:nil",
"xsi:schemaLocation", and "xsi:noNamespaceSchmaLocation" attributes in
instance documents.
|
org.dom4j.Namespace |
getSchemaNamespace()
Gets the schemaNamespace attribute of the NamespaceRegistry object
|
org.dom4j.Namespace |
getTargetNamespace()
Gets the targetNamespace attribute of the NamespaceRegistry object
|
java.lang.String |
getTargetNamespaceUri()
Gets the targetNamespaceUri attribute of the NamespaceRegistry object
|
boolean |
isMultiNamespace()
Returns true if there is a namespace defined in addition to the default ns
and the schemaNamespace.
|
static boolean |
isQualified(java.lang.String s)
Gets the qualified attribute of the NamespaceRegistry class
|
static void |
main(java.lang.String[] args)
The main program for the NamespaceRegistry class
|
static java.lang.String |
makeQualifiedName(org.dom4j.Namespace namespace,
java.lang.String name)
Returns namespace.prefix:name, or just name if a namespace is not provided;
|
static java.lang.String |
makeQualifiedName(java.lang.String prefix,
java.lang.String name)
Make a qualified name - prefix:name;
|
java.util.Iterator |
nsIterator()
Utility returns an iterator for the registed namespaces
|
static java.lang.String |
nsToString(org.dom4j.Namespace ns)
NOT YET DOCUMENTED
|
void |
register(org.dom4j.Namespace ns)
Register a namespace by placing itto the uriMap (mapping uri to its
namespace) and resets default namespaces so they will be recomputed using
updated uriMap.
|
void |
registerNamespaces(org.dom4j.Document doc)
Register all the namespaces defined in the docuement's rootElement.
|
void |
setTargetNamespaceUri(java.lang.String uri)
Sets the targetNamespaceUri attribute of the NamespaceRegistry object
|
static java.lang.String |
stripNamespacePrefix(java.lang.String name)
NOT YET DOCUMENTED
|
java.lang.String |
toString()
NOT YET DOCUMENTED
|
void |
unregister(org.dom4j.Namespace ns)
Remove a namespace from prefixMap and uriMap structures.
|
java.lang.String |
uriMapToString()
Debugging utility returns a printable representation of the uriMap.
|
public static final java.lang.String schemaInstanceNamespaceUri
public static final java.lang.String schemaNamespaceUri
public static final java.lang.String xmlNamespaceUri
public static final java.lang.String xmlNamespacePrefix
public static final org.dom4j.Namespace NO_NAMESPACE
public static boolean namedDefaultCreationEnabled
public NamespaceRegistry()
public void register(org.dom4j.Namespace ns)
ns
- namespace to be registeredpublic boolean isMultiNamespace()
public void registerNamespaces(org.dom4j.Document doc)
doc
- NOT YET DOCUMENTEDpublic org.jaxen.SimpleNamespaceContext getNamespaceContext()
public java.util.Iterator nsIterator()
public java.util.Collection getNamespaces()
public java.lang.String uriMapToString()
public void unregister(org.dom4j.Namespace ns)
ns
- NOT YET DOCUMENTEDpublic org.dom4j.Namespace getNamedDefaultNamespace()
public org.dom4j.Namespace getNSforUri(java.lang.String uri)
uri
- NOT YET DOCUMENTEDpublic java.lang.String getPrefixforUri(java.lang.String uri)
uri
- NOT YET DOCUMENTEDpublic java.lang.String getPrefixforNS(org.dom4j.Namespace ns)
ns
- NOT YET DOCUMENTEDpublic org.dom4j.Namespace getNSforPrefix(java.lang.String prefix)
prefix
- namespace prefixpublic java.util.Map getPrefixMap()
public java.lang.String getTargetNamespaceUri()
public org.dom4j.Namespace getTargetNamespace()
public void setTargetNamespaceUri(java.lang.String uri)
uri
- The new targetNamespaceUri valuepublic org.dom4j.Namespace getDefaultNamespace()
public org.dom4j.Namespace getSchemaInstanceNamespace()
ISSUE: is it okay to assume that the schemaInstanceNamespace prefix will always be "xsi"??
public org.dom4j.Namespace getSchemaNamespace()
public static java.lang.String doQname(org.dom4j.Element element)
element
- NOT YET DOCUMENTEDpublic static java.lang.String makeQualifiedName(java.lang.String prefix, java.lang.String name)
prefix
- a namespace prefixname
- name to be qualifiedpublic static java.lang.String makeQualifiedName(org.dom4j.Namespace namespace, java.lang.String name)
namespace
- a namespace instancename
- name to be qualifiedpublic org.dom4j.QName getQName(java.lang.String qualifiedName) throws java.lang.Exception
qualifiedName
- NOT YET DOCUMENTEDjava.lang.Exception
- NOT YET DOCUMENTEDpublic static boolean isQualified(java.lang.String s)
s
- NOT YET DOCUMENTEDpublic static java.lang.String nsToString(org.dom4j.Namespace ns)
ns
- NOT YET DOCUMENTEDpublic static org.dom4j.Namespace getNamespace(org.dom4j.Document doc)
doc
- NOT YET DOCUMENTEDpublic static java.lang.String getNamespacePrefix(java.lang.String name)
name
- NOT YET DOCUMENTEDpublic static java.lang.String stripNamespacePrefix(java.lang.String name)
name
- NOT YET DOCUMENTEDpublic static void main(java.lang.String[] args)
args
- The command line argumentspublic java.lang.String toString()
toString
in class java.lang.Object