org.opensaml
Class SAMLObject

java.lang.Object
  |
  +--org.opensaml.SAMLObject
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
SAMLAction, SAMLAdvice, SAMLAttribute, SAMLAuthorityBinding, SAMLCondition, SAMLQuery, SAMLSignedObject, SAMLStatement, SAMLSubject

public abstract class SAMLObject
extends java.lang.Object
implements java.lang.Cloneable

Abstract base class for all SAML constructs

Author:
Scott Cantor

Field Summary
protected  SAMLConfig config
          OpenSAML configuration
protected  org.apache.log4j.Logger log
          Class-specific logging object
protected  org.w3c.dom.Node root
          Root node of a DOM tree capturing the object
 
Constructor Summary
SAMLObject()
           
 
Method Summary
protected  java.lang.Object clone()
          Copies a SAML object such that no dependencies exist between the original and the copy.
 void fromDOM(org.w3c.dom.Element e)
          Base method handles generic initialization of objects from a DOM element
protected static org.w3c.dom.Element fromStream(java.io.InputStream in)
          Base method handles parsing of objects from a stream
protected  org.w3c.dom.Node plantRoot()
          Installs the root node of this DOM as the document element
 byte[] toBase64()
          Returns a base64-encoded XML representation of the SAML object
 org.w3c.dom.Node toDOM()
          Transforms the object into a DOM tree without an existing document context
 org.w3c.dom.Node toDOM(org.w3c.dom.Document doc)
          Base method transforms the object into a DOM tree using an existing document context
 void toStream(java.io.OutputStream out)
          Serializes the XML representation of the SAML object to a stream
 java.lang.String toString()
          Serializes a SAML object to a string in exclusive canonical form.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

root

protected org.w3c.dom.Node root
Root node of a DOM tree capturing the object


log

protected org.apache.log4j.Logger log
Class-specific logging object


config

protected SAMLConfig config
OpenSAML configuration

Constructor Detail

SAMLObject

public SAMLObject()
Method Detail

fromStream

protected static org.w3c.dom.Element fromStream(java.io.InputStream in)
                                         throws SAMLException
Base method handles parsing of objects from a stream

Parameters:
in - A stream containing XML
Returns:
The root of the XML document instance
Throws:
SAMLException - Raised if an exception occurs while constructing the object.

fromDOM

public void fromDOM(org.w3c.dom.Element e)
             throws SAMLException
Base method handles generic initialization of objects from a DOM element

Parameters:
e - Root element of a DOM tree
Throws:
SAMLException - Raised if an exception occurs while constructing the object.

toStream

public void toStream(java.io.OutputStream out)
              throws java.io.IOException
Serializes the XML representation of the SAML object to a stream

Parameters:
out - Stream to use for output
Throws:
java.io.IOException - Raised if an I/O problem is detected

toBase64

public byte[] toBase64()
                throws java.io.IOException
Returns a base64-encoded XML representation of the SAML object

Returns:
A byte array containing the encoded data
Throws:
java.io.IOException - Raised if an I/O problem is detected

toDOM

public org.w3c.dom.Node toDOM(org.w3c.dom.Document doc)
                       throws org.w3c.dom.DOMException
Base method transforms the object into a DOM tree using an existing document context

Parameters:
doc - A Document object to use in manufacturing the tree
Returns:
Root element node of the DOM tree capturing the object
Throws:
org.w3c.dom.DOMException - Raised if an XML exception is detected

toDOM

public org.w3c.dom.Node toDOM()
                       throws org.w3c.dom.DOMException
Transforms the object into a DOM tree without an existing document context

Returns:
Root element node of the DOM tree capturing the object
Throws:
org.w3c.dom.DOMException - Raised if an XML exception is detected

plantRoot

protected org.w3c.dom.Node plantRoot()
Installs the root node of this DOM as the document element

Returns:
The root node so planted

clone

protected java.lang.Object clone()
                          throws java.lang.CloneNotSupportedException
Copies a SAML object such that no dependencies exist between the original and the copy.

Overrides:
clone in class java.lang.Object
Returns:
The new object
java.lang.CloneNotSupportedException
See Also:
Object.clone()

toString

public java.lang.String toString()
Serializes a SAML object to a string in exclusive canonical form.

Overrides:
toString in class java.lang.Object
Returns:
The canonicalized output
See Also:
Object.toString()


Copyright © 2002 UCAID. All Rights Reserved.