issrg.pba
Class SimpleObligations

java.lang.Object
  extended by issrg.pba.SimpleObligations
All Implemented Interfaces:
Obligations

public class SimpleObligations
extends java.lang.Object
implements Obligations

This class implements the interface Obligations, and provides a constructor to construct an instance based on a PolicyXMLNode object.

Author:
gansen

Constructor Summary
SimpleObligations()
          Creates a new instance of SimpleObligations
SimpleObligations(PolicyXMLNode ObligationsNode)
          Construct a SimpleObligations Object using an XMLPolicyNode.
 
Method Summary
 java.util.List getObligations()
          This function retrieves a List of the obligations
 boolean isEmpty()
          check if the Obligations Object contains no obligations.
 java.lang.String toString()
          This function acts the same as the toXML function.
 java.lang.String toXML()
          This function converts the internal structure into XML text string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleObligations

public SimpleObligations()
Creates a new instance of SimpleObligations


SimpleObligations

public SimpleObligations(PolicyXMLNode ObligationsNode)
Construct a SimpleObligations Object using an XMLPolicyNode.
This constructor constructs an instance based on the PolicyXMLNode constructed when by the xml policy parser. The PolcyXMLNode corresponses to the xml node of the obligations object in the xml tree.

Parameters:
ObligationsNode - The corresponding PolicyXMLNode object of the Obligations in the target access rule.
Method Detail

isEmpty

public boolean isEmpty()
check if the Obligations Object contains no obligations.

Specified by:
isEmpty in interface Obligations

toXML

public java.lang.String toXML()
This function converts the internal structure into XML text string. It generates the tags for the highest level (OBLIGATIONS). The tags are and

No Attributes are iterated and inserts into the XML text as the XML DTD of Obligations contains no attributes. All children nodes are converted to XML by their own (which is implemented by the xmlpolicynode).

Specified by:
toXML in interface Obligations

getObligations

public java.util.List getObligations()
This function retrieves a List of the obligations

Specified by:
getObligations in interface Obligations
Returns:
a List containing the obligations objects that are children of the OBLIGATIONS object. when the current OBLIGATIONS object has no children, the return value might be a null pointer.

toString

public java.lang.String toString()
This function acts the same as the toXML function. It overrides the default implementation of the java's object class.

Overrides:
toString in class java.lang.Object
Returns:
the XML string representing the current object.