org.opensaml
Class SAMLAttributeStatement

java.lang.Object
  extended byorg.opensaml.SAMLObject
      extended byorg.opensaml.SAMLStatement
          extended byorg.opensaml.SAMLSubjectStatement
              extended byorg.opensaml.SAMLAttributeStatement
All Implemented Interfaces:
Cloneable

public class SAMLAttributeStatement
extends SAMLSubjectStatement
implements Cloneable

Represents a SAML Attribute Statement

Author:
Scott Cantor

Field Summary
protected  ArrayList attrs
           
 
Fields inherited from class org.opensaml.SAMLSubjectStatement
subject
 
Fields inherited from class org.opensaml.SAMLStatement
statementTypeMap
 
Fields inherited from class org.opensaml.SAMLObject
config, dirty, log, parentObject, root
 
Constructor Summary
SAMLAttributeStatement()
          Default constructor
SAMLAttributeStatement(Element e)
          Reconstructs an attribute statement from a DOM tree
SAMLAttributeStatement(InputStream in)
          Reconstructs an attribute statement from a stream
SAMLAttributeStatement(SAMLSubject subject, Collection attrs)
          Builds a statement out of its component parts
 
Method Summary
 void addAttribute(SAMLAttribute attribute)
          Adds an attribute to the statement
protected  Element buildRoot(Document doc, boolean xmlns)
          Delegates the process of building the root element of an object and inserting appropriate namespaces.
 void checkValidity()
          Evaluates the object's content to see if it is currently valid if serialized.
 Object clone()
          Copies a SAML object such that no dependencies exist between the original and the copy
 void fromDOM(Element e)
          Initialization of an object from a DOM element
 Iterator getAttributes()
          Gets attributes from the statement, if any
 void removeAttribute(int index)
          Removes an attribute by position (zero-based)
 void setAttributes(Collection attributes)
          Sets the attributes inside the statement
 Node toDOM(Document doc, boolean xmlns)
          Transforms the object into a DOM tree using an existing document context
 
Methods inherited from class org.opensaml.SAMLSubjectStatement
getSubject, setSubject
 
Methods inherited from class org.opensaml.SAMLStatement
getInstance, getInstance, regFactory, unregFactory
 
Methods inherited from class org.opensaml.SAMLObject
fromStream, fromStream, getParent, plantRoot, setDirty, setParent, toBase64, toDOM, toDOM, toDOM, toStream, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

attrs

protected ArrayList attrs
Constructor Detail

SAMLAttributeStatement

public SAMLAttributeStatement()
Default constructor


SAMLAttributeStatement

public SAMLAttributeStatement(SAMLSubject subject,
                              Collection attrs)
                       throws SAMLException
Builds a statement out of its component parts

Parameters:
subject - Subject of statement
attrs - Collection of attributes
Throws:
SAMLException - Raised if a statement cannot be constructed from the supplied information

SAMLAttributeStatement

public SAMLAttributeStatement(Element e)
                       throws SAMLException
Reconstructs an attribute statement from a DOM tree

Parameters:
e - The root of a DOM tree
Throws:
SAMLException - Thrown if the object cannot be constructed

SAMLAttributeStatement

public SAMLAttributeStatement(InputStream in)
                       throws SAMLException
Reconstructs an attribute statement from a stream

Parameters:
in - A stream containing XML
Throws:
SAMLException - Raised if an exception occurs while constructing the object.
Method Detail

fromDOM

public void fromDOM(Element e)
             throws SAMLException
Description copied from class: SAMLObject
Initialization of an object from a DOM element

Overrides:
fromDOM in class SAMLSubjectStatement
Throws:
SAMLException
See Also:
SAMLObject.fromDOM(org.w3c.dom.Element)

getAttributes

public Iterator getAttributes()
Gets attributes from the statement, if any

Returns:
An array of attributes

setAttributes

public void setAttributes(Collection attributes)
                   throws SAMLException
Sets the attributes inside the statement

Parameters:
attributes - The attributes to include
Throws:
SAMLException - Raised if the attributes are invalid

addAttribute

public void addAttribute(SAMLAttribute attribute)
                  throws SAMLException
Adds an attribute to the statement

Parameters:
attribute - The attribute to add
Throws:
SAMLException - Raised if the subject is invalid

removeAttribute

public void removeAttribute(int index)
Removes an attribute by position (zero-based)

Parameters:
index - The position of the attribute to remove

buildRoot

protected Element buildRoot(Document doc,
                            boolean xmlns)
Description copied from class: SAMLObject
Delegates the process of building the root element of an object and inserting appropriate namespaces.

Specified by:
buildRoot in class SAMLObject
Parameters:
doc - The document context to use
xmlns - Include namespace(s) on root element?
Returns:
A new root element for the object
See Also:
SAMLObject.buildRoot(org.w3c.dom.Document,boolean)

toDOM

public Node toDOM(Document doc,
                  boolean xmlns)
           throws SAMLException
Description copied from class: SAMLObject
Transforms the object into a DOM tree using an existing document context

Overrides:
toDOM in class SAMLSubjectStatement
Throws:
SAMLException
See Also:
SAMLObject.toDOM(org.w3c.dom.Document,boolean)

checkValidity

public void checkValidity()
                   throws SAMLException
Description copied from class: SAMLObject
Evaluates the object's content to see if it is currently valid if serialized. Does not evaluate embedded objects except on the basis of whether they exist. For example, an Assertion must have a Statement, but if an invalid statement is added, SAMLAssertion.checkValidity() would succeed, while SAMLStatement.checkValidity would raise an exception.

Overrides:
checkValidity in class SAMLSubjectStatement
Throws:
SAMLException
See Also:
SAMLObject.checkValidity()

clone

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

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


Copyright ? 2005 UCAID. All Rights Reserved.