Data Request Broker
2-3-release

fr.gael.drb.xsd
Class Namespace

java.lang.Object
  extended by fr.gael.drb.xsd.Namespace
All Implemented Interfaces:
Cloneable

public class Namespace
extends Object
implements Cloneable

Declaration of a namespace.


Field Summary
protected  String defaultNamespaceURI
          The default namespace URI.
protected  HashMap namespaceMap
          The namespace binding.
protected  HashMap prefixMap
          The prefix binding.
static String XML_SCHEMA_INSTANCE
          XML_SCHEMA_INSTANCE
static String XML_SCHEMA_NAMESPACE
          XML_SCHEMA_NAMESPACE
 
Constructor Summary
Namespace()
           
 
Method Summary
 void addNamespaces(Namespace namespaces)
          Add a set of namespaces to the current set.
 void bind(String ns_prefix, String ns_full)
          Bind a namespace to a prefix.
 Namespace cloneNamespace()
          Clones the current class.
 String createPrefix(String ns_prefix, String ns_full)
          Create a prefix and bind it to a namespace.
 String[] getDeclaredPrefixes()
          Returns all the declared prefixes.
 String getDefaultNamespaceURI()
          Returns the default namespace URI
 String resolveNamespace(String ns_prefix)
          Returns the namespace from a prefix.
 String resolvePrefix(String ns_full)
          Returns the prefix from a namespace.
 void setDefaultNamespaceURI(String ns_uri)
          Set the default namespace URI.
static String toLocal(String qualified_name)
          Returns the local part of the specified qualified name.
static String toPrefix(String qualified_name)
          Returns the prefix of the specified qualified name.
 String toString()
          Returns the list of (prefix, URI) couples on a line per line basis.
 void unbind(String ns_prefix)
          Unbind a prefix.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

XML_SCHEMA_NAMESPACE

public static final String XML_SCHEMA_NAMESPACE
XML_SCHEMA_NAMESPACE

See Also:
Constant Field Values

XML_SCHEMA_INSTANCE

public static final String XML_SCHEMA_INSTANCE
XML_SCHEMA_INSTANCE

See Also:
Constant Field Values

namespaceMap

protected HashMap namespaceMap
The namespace binding.


prefixMap

protected HashMap prefixMap
The prefix binding.


defaultNamespaceURI

protected String defaultNamespaceURI
The default namespace URI.

Constructor Detail

Namespace

public Namespace()
Method Detail

cloneNamespace

public Namespace cloneNamespace()
Clones the current class. Caution: The constructor clones the lists of prefix and URIs but does not their referenced elements.

Returns:
the cloned namespace.

addNamespaces

public void addNamespaces(Namespace namespaces)
Add a set of namespaces to the current set.

Parameters:
namespaces - the container of the namespaces to add.

resolveNamespace

public String resolveNamespace(String ns_prefix)
Returns the namespace from a prefix.

Parameters:
ns_prefix - String
Returns:
String

resolvePrefix

public String resolvePrefix(String ns_full)
Returns the prefix from a namespace.

Parameters:
ns_full - String
Returns:
String

bind

public void bind(String ns_prefix,
                 String ns_full)
Bind a namespace to a prefix. If a binding already exist for that prefix, the namespace will be replaced.

Parameters:
ns_prefix - a prefix
ns_full - the namespace URI

createPrefix

public String createPrefix(String ns_prefix,
                           String ns_full)
Create a prefix and bind it to a namespace.

Parameters:
ns_prefix - a prefix (must never be empty)
ns_full - String
Returns:
the new prefix.

unbind

public void unbind(String ns_prefix)
Unbind a prefix.

Parameters:
ns_prefix - String

getDefaultNamespaceURI

public String getDefaultNamespaceURI()
Returns the default namespace URI

Returns:
the default namespace URI

setDefaultNamespaceURI

public void setDefaultNamespaceURI(String ns_uri)
Set the default namespace URI.

Parameters:
ns_uri - the default namespace URI

getDeclaredPrefixes

public String[] getDeclaredPrefixes()
Returns all the declared prefixes.

Returns:
The declared prefixes.

toPrefix

public static String toPrefix(String qualified_name)
Returns the prefix of the specified qualified name. It is assumed that there is at most one prefix.

Parameters:
qualified_name - a qualified name.
Returns:
The prefix of the specified qualified name.

toLocal

public static String toLocal(String qualified_name)
Returns the local part of the specified qualified name. It is assumed that there is at most one prefix.

Parameters:
qualified_name - a qualified name.
Returns:
The local part of the specified qualified name.

toString

public String toString()
Returns the list of (prefix, URI) couples on a line per line basis.

Overrides:
toString in class Object
Returns:
the couples of prefix, URI.

Data Request Broker - DRB API®
2-3-release

Copyright© 2001-2009 GAEL Consultant. All rights reserved. Use is subject to license terms .