|
DLESE Tools v1.6.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.dlese.dpc.xml.schema.NamespaceRegistry
public class NamespaceRegistry
NamespaceRegistry holds namespace information and provides namespace utilities.
Field Summary | |
---|---|
static boolean |
namedDefaultCreationEnabled
NOT YET DOCUMENTED |
static Namespace |
NO_NAMESPACE
NOT YET DOCUMENTED |
static String |
schemaInstanceNamespaceUri
schema Instance Namespace Uri |
static String |
schemaNamespaceUri
schema Namespace Uri |
static String |
xmlNamespacePrefix
NOT YET DOCUMENTED |
static String |
xmlNamespaceUri
URI of xml namespace |
Constructor Summary | |
---|---|
NamespaceRegistry()
Initialize the data structures used by NamespaceRegistry |
Method Summary | |
---|---|
static String |
doQname(Element element)
NOT YET DOCUMENTED |
Namespace |
getDefaultNamespace()
Gets the defaultNamespace attribute of the NamespaceRegistry object |
Namespace |
getNamedDefaultNamespace()
Returns a namespace having a non-empty prefix and the same URI as the defaultNameSpace (if one exists). |
static Namespace |
getNamespace(Document doc)
Gets the namespace attribute of the NamespaceRegistry class |
org.jaxen.SimpleNamespaceContext |
getNamespaceContext()
Gets the namespaceContext attribute of the NamespaceRegistry object |
static String |
getNamespacePrefix(String name)
Gets the namespacePrefix attribute of the NamespaceRegistry class |
Collection |
getNamespaces()
Utility returns all Namespaces as a Collection. |
Namespace |
getNSforPrefix(String prefix)
Gets the namespace corresponding to the specified prefix |
Namespace |
getNSforUri(String uri)
Gets the Namespace for provided URI. |
String |
getPrefixforNS(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. |
String |
getPrefixforUri(String uri)
Gets the prefix corresponding to the provided uri after finding that uri's namespace. |
Map |
getPrefixMap()
Gets the prefixMap attribute of the NamespaceRegistry object |
QName |
getQName(String qualifiedName)
Gets the qName attribute of the NamespaceRegistry object |
Namespace |
getSchemaInstanceNamespace()
The schemaInstanceNamespace is used to introduce "xsi:type", "xsi:nil", "xsi:schemaLocation", and "xsi:noNamespaceSchmaLocation" attributes in instance documents. |
Namespace |
getSchemaNamespace()
Gets the schemaNamespace attribute of the NamespaceRegistry object |
Namespace |
getTargetNamespace()
Gets the targetNamespace attribute of the NamespaceRegistry object |
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(String s)
Gets the qualified attribute of the NamespaceRegistry class |
static void |
main(String[] args)
The main program for the NamespaceRegistry class |
static String |
makeQualifiedName(Namespace namespace,
String name)
Returns namespace.prefix:name, or just name if a namespace is not provided; |
static String |
makeQualifiedName(String prefix,
String name)
Make a qualified name - prefix:name; |
Iterator |
nsIterator()
Utility returns an iterator for the registed namespaces |
static String |
nsToString(Namespace ns)
NOT YET DOCUMENTED |
void |
register(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(Document doc)
Register all the namespaces defined in the docuement's rootElement. |
void |
setTargetNamespaceUri(String uri)
Sets the targetNamespaceUri attribute of the NamespaceRegistry object |
static String |
stripNamespacePrefix(String name)
NOT YET DOCUMENTED |
String |
toString()
NOT YET DOCUMENTED |
void |
unregister(Namespace ns)
Remove a namespace from prefixMap and uriMap structures. |
String |
uriMapToString()
Debugging utility returns a printable representation of the uriMap. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String schemaInstanceNamespaceUri
public static final String schemaNamespaceUri
public static final String xmlNamespaceUri
public static final String xmlNamespacePrefix
public static final Namespace NO_NAMESPACE
public static boolean namedDefaultCreationEnabled
Constructor Detail |
---|
public NamespaceRegistry()
Method Detail |
---|
public void register(Namespace ns)
ns
- namespace to be registeredpublic boolean isMultiNamespace()
public void registerNamespaces(Document doc)
doc
- NOT YET DOCUMENTEDpublic org.jaxen.SimpleNamespaceContext getNamespaceContext()
public Iterator nsIterator()
public Collection getNamespaces()
public String uriMapToString()
public void unregister(Namespace ns)
ns
- NOT YET DOCUMENTEDpublic Namespace getNamedDefaultNamespace()
public Namespace getNSforUri(String uri)
uri
- NOT YET DOCUMENTED
public String getPrefixforUri(String uri)
uri
- NOT YET DOCUMENTED
public String getPrefixforNS(Namespace ns)
ns
- NOT YET DOCUMENTED
public Namespace getNSforPrefix(String prefix)
prefix
- namespace prefix
public Map getPrefixMap()
public String getTargetNamespaceUri()
public Namespace getTargetNamespace()
public void setTargetNamespaceUri(String uri)
uri
- The new targetNamespaceUri valuepublic Namespace getDefaultNamespace()
public Namespace getSchemaInstanceNamespace()
ISSUE: is it okay to assume that the schemaInstanceNamespace prefix will always be "xsi"??
public Namespace getSchemaNamespace()
public static String doQname(Element element)
element
- NOT YET DOCUMENTED
public static String makeQualifiedName(String prefix, String name)
prefix
- a namespace prefixname
- name to be qualified
public static String makeQualifiedName(Namespace namespace, String name)
namespace
- a namespace instancename
- name to be qualified
public QName getQName(String qualifiedName) throws Exception
qualifiedName
- NOT YET DOCUMENTED
Exception
- NOT YET DOCUMENTEDpublic static boolean isQualified(String s)
s
- NOT YET DOCUMENTED
public static String nsToString(Namespace ns)
ns
- NOT YET DOCUMENTED
public static Namespace getNamespace(Document doc)
doc
- NOT YET DOCUMENTED
public static String getNamespacePrefix(String name)
name
- NOT YET DOCUMENTED
public static String stripNamespacePrefix(String name)
name
- NOT YET DOCUMENTED
public static void main(String[] args)
args
- The command line argumentspublic String toString()
toString
in class Object
|
DLESE Tools v1.6.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |