org.nakedobjects.object.control
Class Permission

java.lang.Object
  extended byorg.nakedobjects.object.control.Permission
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
Allow, Veto

public abstract class Permission
extends java.lang.Object
implements java.io.Serializable

See Also:
Serialized Form

Constructor Summary
protected Permission()
           
protected Permission(java.lang.String reason)
           
 
Method Summary
static Permission allow(boolean allow)
          Returns an Allow (Allow.DEFAULT) object if true; Veto (Veto.DEFAULT) if false;
static Permission create(boolean allow)
          Deprecated.  
static Permission create(boolean allow, java.lang.String reasonAllowed, java.lang.String reasonVeteod)
          Returns a new Allow object if allow is true; a new Veto if false.
 java.lang.String getReason()
          Returns the persmission's reason
abstract  boolean isAllowed()
          Returns true if this object is giving permission.
abstract  boolean isVetoed()
          Returns true if this object is NOT giving permission.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Permission

protected Permission()

Permission

protected Permission(java.lang.String reason)
Method Detail

create

public static final Permission create(boolean allow)
Deprecated.  

Returns an Allow (Allow.DEFAULT) object if true; Veto (Veto.DEFAULT) if false;

See Also:
allow(boolean)

allow

public static final Permission allow(boolean allow)
Returns an Allow (Allow.DEFAULT) object if true; Veto (Veto.DEFAULT) if false;


create

public static final Permission create(boolean allow,
                                      java.lang.String reasonAllowed,
                                      java.lang.String reasonVeteod)
Returns a new Allow object if allow is true; a new Veto if false. The respective reason is passed to the newly created object.


getReason

public java.lang.String getReason()
Returns the persmission's reason


isAllowed

public abstract boolean isAllowed()
Returns true if this object is giving permission.


isVetoed

public abstract boolean isVetoed()
Returns true if this object is NOT giving permission.


toString

public java.lang.String toString()