org.opensaml.xml
Class Namespace

java.lang.Object
  extended by org.opensaml.xml.Namespace

public class Namespace
extends Object

Data structure for representing XML namespace attributes.


Field Summary
private  boolean alwaysDeclare
          Always declare this namespace while marshalling?
private  String namespacePrefix
          Prefix of the namespace.
private  String namespaceURI
          URI of the namespace.
private  String nsStr
          String representation of this namespace.
 
Constructor Summary
Namespace()
          Constructor.
Namespace(String uri, String prefix)
          Constructor.
 
Method Summary
 boolean alwaysDeclare()
          Deprecated. use appropriate methods on the XMLObject's NamespaceManager.
protected  void constructStringRepresentation()
          Constructs an XML namespace declaration string representing this namespace.
 boolean equals(Object obj)
          Checks if the given object is the same as this Namespace.
 String getNamespacePrefix()
          Gets the prefix of the namespace.
 String getNamespaceURI()
          Gets the URI of the namespace.
 int hashCode()
          
 void setAlwaysDeclare(boolean shouldAlwaysDeclare)
          Deprecated. use appropriate methods on the XMLObject's NamespaceManager.
 void setNamespacePrefix(String newPrefix)
          Sets the prefix of the namespace.
 void setNamespaceURI(String newURI)
          Sets the URI of the namespace.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

namespaceURI

private String namespaceURI
URI of the namespace.


namespacePrefix

private String namespacePrefix
Prefix of the namespace.


alwaysDeclare

private boolean alwaysDeclare
Always declare this namespace while marshalling?


nsStr

private String nsStr
String representation of this namespace.

Constructor Detail

Namespace

public Namespace()
Constructor.


Namespace

public Namespace(String uri,
                 String prefix)
Constructor.

Parameters:
uri - the URI of the namespace
prefix - the prefix of the namespace
Method Detail

getNamespacePrefix

public String getNamespacePrefix()
Gets the prefix of the namespace.

Returns:
the prefix of the namespace, may be null if this is a default namespace

setNamespacePrefix

public void setNamespacePrefix(String newPrefix)
Sets the prefix of the namespace.

Parameters:
newPrefix - the prefix of the namespace

getNamespaceURI

public String getNamespaceURI()
Gets the URI of the namespace.

Returns:
the URI of the namespace

setNamespaceURI

public void setNamespaceURI(String newURI)
Sets the URI of the namespace.

Parameters:
newURI - the URI of the namespace

alwaysDeclare

public boolean alwaysDeclare()
Deprecated. use appropriate methods on the XMLObject's NamespaceManager.

Gets wether this namespace should always be declared when marshalling, even if it was already declared on an ancestral element.

Returns:
true if this namespace should always be declared, false if not

setAlwaysDeclare

public void setAlwaysDeclare(boolean shouldAlwaysDeclare)
Deprecated. use appropriate methods on the XMLObject's NamespaceManager.

Sets wether this namespace should always be declared when marshalling, even if it was already declared on an ancestral element.

Parameters:
shouldAlwaysDeclare - true if this namespace should always be declared, false if not

toString

public String toString()

Overrides:
toString in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Checks if the given object is the same as this Namespace. This is true if:

Overrides:
equals in class Object
Parameters:
obj -
Returns:

constructStringRepresentation

protected void constructStringRepresentation()
Constructs an XML namespace declaration string representing this namespace.



Copyright © 1999-2013. All Rights Reserved.