com.ssx.xml.output
Class Namespace

java.lang.Object
  extended bycom.ssx.xml.output.Namespace

public class Namespace
extends Object

A Data class that holds the three string values that make up a qname, the namespace, the local prefix and the name.


Constructor Summary
Namespace()
          Create a new, empty namespace
Namespace(String prefix, String name)
          Create an new namespace with the given prefix and name
 
Method Summary
 String getName()
          Get the namespace URI
 String getPrefix()
          Get the namespace prefix
static String getQName(Namespace namespace, String name)
          Create the appropriate qname from a namespace and a local name.
 void setName(String name)
          Set the namespace URI
 void setPrefix(String prefix)
          Set the namespace prefix
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Namespace

public Namespace()
Create a new, empty namespace


Namespace

public Namespace(String prefix,
                 String name)
Create an new namespace with the given prefix and name

Parameters:
prefix - The namespace prefix
name - The namespace URI
Method Detail

getName

public String getName()
Get the namespace URI

Returns:
The namespace URI

setName

public void setName(String name)
Set the namespace URI

Parameters:
name - The namespace URI

getPrefix

public String getPrefix()
Get the namespace prefix

Returns:
The namespace prefix

setPrefix

public void setPrefix(String prefix)
Set the namespace prefix

Parameters:
prefix - The namespace prefix

getQName

public static String getQName(Namespace namespace,
                              String name)
Create the appropriate qname from a namespace and a local name. This mehtod handles null and empty namespaces but the local name must exist.

Parameters:
namespace - The namespace part
name - The local name part
Returns:
The qname