org.openpermis.policy.bean.basic
Class BasicObligation

java.lang.Object
  extended by org.openpermis.policy.bean.basic.BasicPart
      extended by org.openpermis.policy.bean.basic.BasicPartBean
          extended by org.openpermis.policy.bean.basic.BasicObligation
All Implemented Interfaces:
Serializable, ObligationBean, PartBean, Obligation, Part

public class BasicObligation
extends BasicPartBean
implements ObligationBean

A basic implementation of ObligationBean.

See Also:
Serialized Form
Since:
0.3.0

Constructor Summary
protected BasicObligation(SerialNumber serialNumber, String text)
          Creates a new obligation containing text, that is returned for a granted decision.
 
Method Summary
 void accept(List<PartBean> parents, MultiPartBeanVisitor visitor)
          Allows traversing the model according to the visitor pattern.
protected  void appendPartDetails(StringBuilder sb)
          Appends the details of this extended part for the string representation of this part.
protected  boolean checkLocalConsistency(PartProblemReporter reporter)
          Checks if the extended state of this part is consistent.
protected  boolean comparablePart(BasicPart part)
          Check if the part specified is comparable to this part.
protected  boolean equalPart(BasicPart part)
          Compares another part to this part.
protected  String getSimpleClassName()
          Returns the simple implementation class name of this class.
 String getText()
          Returns the text of this obligation.
protected  int partHashCode()
          Returns the hash code of the extended part state.
 void setText(String text)
          Sets the text of this obligation.
 
Methods inherited from class org.openpermis.policy.bean.basic.BasicPartBean
accept, addPropertyChangeListener, equalSerialNumber, findBySerialNumber, firePropertyChange, getPartBeanType, getSerialNumber, getSerialNumberString, instanceOf, notifyIdentityChange, notifyNameChange, removePropertyChangeListener, toShortString
 
Methods inherited from class org.openpermis.policy.bean.basic.BasicPart
appendDetails, areIdentitiesUnique, areNamesUnique, checkLocalPartConsistency, equals, getIdentity, getName, hashCode, hasPartIdentity, hasPartName, isIdentityValid, isNameValid, reportProblem, setIdentity, setName, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.openpermis.policy.bean.PartBean
accept, addPropertyChangeListener, checkLocalPartConsistency, equalSerialNumber, findBySerialNumber, getPartBeanType, getSerialNumber, instanceOf, removePropertyChangeListener, toShortString
 
Methods inherited from interface org.openpermis.policy.Part
equals, hashCode, toString
 

Constructor Detail

BasicObligation

protected BasicObligation(SerialNumber serialNumber,
                          String text)
Creates a new obligation containing text, that is returned for a granted decision.

Parameters:
serialNumber - the serial number of this part.
text - a String.
Since:
0.3.0
Method Detail

getText

public String getText()
Description copied from interface: ObligationBean
Returns the text of this obligation.

Specified by:
getText in interface ObligationBean
Specified by:
getText in interface Obligation
Returns:
the text of this obligation.
Since:
0.3.0

accept

public void accept(List<PartBean> parents,
                   MultiPartBeanVisitor visitor)
Description copied from interface: PartBean
Allows traversing the model according to the visitor pattern. Visit may be called more than once on each part in the domain model, but it is called exactly once for each tuple (parent path, part).

Each part bean must call method visitor.visit(this)

Specified by:
accept in interface PartBean
Parameters:
parents - the path of parents of this part.
visitor - a PartBeanVisitor.
Since:
0.9.0

setText

public void setText(String text)
Description copied from interface: ObligationBean
Sets the text of this obligation.

Specified by:
setText in interface ObligationBean
Parameters:
text - a String.
Since:
0.3.0

comparablePart

protected boolean comparablePart(BasicPart part)
Description copied from class: BasicPart
Check if the part specified is comparable to this part.

Specified by:
comparablePart in class BasicPart
Parameters:
part - the part to check.
See Also:
BasicPart
Returns:
true if the part supplied is comparable to this part.
Since:
0.3.0

equalPart

protected boolean equalPart(BasicPart part)
Description copied from class: BasicPart
Compares another part to this part.

Overrides:
equalPart in class BasicPart
Parameters:
part - the part to compare to this part.
See Also:
BasicUtilities.equalObjects(Object, Object), BasicPart
Returns:
true if the part supplied is considered equivalent to this part.
Since:
0.3.0

partHashCode

protected int partHashCode()
Description copied from class: BasicPart
Returns the hash code of the extended part state.

Overrides:
partHashCode in class BasicPart
See Also:
BasicPart, BasicUtilities.multiHashCode(int...)
Returns:
the hash code of the extended part state.
Since:
0.3.0

getSimpleClassName

protected String getSimpleClassName()
Description copied from class: BasicPart
Returns the simple implementation class name of this class.

If your implementation represents an interface implementation return the interface simple class name here. In short: return the instance you are checking against in BasicPart.comparablePart(BasicPart).

Overrides:
getSimpleClassName in class BasicPart
Returns:
the simple implementation class name of this class.
Since:
0.3.0

appendPartDetails

protected void appendPartDetails(StringBuilder sb)
Description copied from class: BasicPart
Appends the details of this extended part for the string representation of this part.

Overrides:
appendPartDetails in class BasicPart
Parameters:
sb - the string builder to add the details to.
See Also:
BasicPart, BasicPart.appendDetails(StringBuilder, String, Object)
Since:
0.3.0

checkLocalConsistency

protected boolean checkLocalConsistency(PartProblemReporter reporter)
Description copied from class: BasicPart
Checks if the extended state of this part is consistent.

Overrides:
checkLocalConsistency in class BasicPart
Parameters:
reporter - the problem reporter to use, may be null.
Since:
0.9.0


OpenPermis Role Based Access Control 0.9.0 (Build 16)
2009/08/13 07:16:59
Copyright (c) 2002-2007 Ergon Informatik AG