org.erights.e.elib.slot
Class BaseAuditor

java.lang.Object
  |
  +--org.erights.e.elib.slot.BaseGuard
        |
        +--org.erights.e.elib.slot.BaseAuditor
All Implemented Interfaces:
Auditor, Guard, SlotGuard, ValueGuard
Direct Known Subclasses:
DeepFrozenAuditor, DeepPassByCopyAuditor, PassByConstructionAuditor, PassByCopyAuditor, PersistentAuditor, TypeDesc

public abstract class BaseAuditor
extends BaseGuard
implements Auditor

Safe: Most Auditors will also double as ValueGuards and SlotGuards in a stereotyped way.

This base class is just a convenience for such combined Auditor/Guards that fit this pattern.

Author:
Mark S. Miller

Field Summary
 
Fields inherited from class org.erights.e.elib.slot.BaseGuard
myOptValueGuard
 
Constructor Summary
protected BaseAuditor()
           
 
Method Summary
 boolean audit(Object script)
          Enabled: Defaults to always return false.
 Object coerce(Object specimen, OneArgFunc optEjector)
          Enabled: The default implementation here is Gozarian -- if the object doesn't trivially pass, it is asked to __conformTo/1 this auditor and given a second chance.
 
Methods inherited from class org.erights.e.elib.slot.BaseGuard
__printOn, accepts, and, butNot, coerce, get, getName, makeSlot, makeSlot, not, or, toString, xor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BaseAuditor

protected BaseAuditor()
Method Detail

audit

public boolean audit(Object script)
Enabled: Defaults to always return false.

Specified by:
audit in interface Auditor

coerce

public Object coerce(Object specimen,
                     OneArgFunc optEjector)
Enabled: The default implementation here is Gozarian -- if the object doesn't trivially pass, it is asked to __conformTo/1 this auditor and given a second chance.

If specimen was instantiated with the approval of this auditor, the specimen itself is returned. Otherwise, a coercion failure is reported.

Specified by:
coerce in interface ValueGuard
Overrides:
coerce in class BaseGuard


comments?