org.nakedobjects.applib.events
Class InteractionEvent

java.lang.Object
  extended by java.util.EventObject
      extended by org.nakedobjects.applib.events.InteractionEvent
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AccessEvent, UsabilityEvent, ValidityEvent, VisibilityEvent

public abstract class InteractionEvent
extends EventObject

Represents an interaction with a domain object or a particular feature (property, collection, action) of a domain object.

Many of the interactions are checks for visibility, usability and validity.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
InteractionEvent(Object source, Identifier identifier)
           
 
Method Summary
 void advised(String reason, Class<?> advisorClass)
          Specify the reason that this interaction has been vetoed and the class of the advisor that did the veto.
 Class<?> getAdvisorClass()
          The class of the (first) advisor, if any, that provided the reason that this interaction is vetoed.
 String getClassName()
          Convenience method that returns the class name of the identifier.
 String getClassNaturalName()
          As per getClassName(), but naturalized.
 Identifier getIdentifier()
          The Identifier of the feature of the object being interacted with.
 String getMemberName()
          Convenience method that returns the member name of the identifier.
 String getMemberNaturalName()
          As per getMemberName(), but naturalized.
 String[] getMemberParameterNames()
          Convenience method that returns the class name of the identifier.
 String[] getMemberParameterNaturalNames()
          As per #getMemberParameterName(), but naturalized.
 String getReason()
          The reason, if any, that this interaction may have been vetoed or otherwise disallowed.
 Object getSource()
          The domain object (pojo) against which the interaction occurred.
 boolean isVeto()
          Whether this interaction has been vetoed (meaning that getReason() and getAdvisorClass() will both be non-null and the reason non-empty.)
 
Methods inherited from class java.util.EventObject
toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InteractionEvent

public InteractionEvent(Object source,
                        Identifier identifier)
Method Detail

getSource

public Object getSource()
The domain object (pojo) against which the interaction occurred.

Overrides:
getSource in class EventObject

getIdentifier

public Identifier getIdentifier()
The Identifier of the feature of the object being interacted with.

Will be consistent with the subclass of InteractionEvent. So for example a PropertyModifyEvent will have an Identifier that identifies the property being modified.

Returns:

getClassName

public String getClassName()
Convenience method that returns the class name of the identifier.

See Also:
getIdentifier()

getClassNaturalName

public String getClassNaturalName()
As per getClassName(), but naturalized.


getMemberName

public String getMemberName()
Convenience method that returns the member name of the identifier.

See Also:
getIdentifier()

getMemberNaturalName

public String getMemberNaturalName()
As per getMemberName(), but naturalized.


getMemberParameterNames

public String[] getMemberParameterNames()
Convenience method that returns the class name of the identifier.


getMemberParameterNaturalNames

public String[] getMemberParameterNaturalNames()
As per #getMemberParameterName(), but naturalized.


getReason

public String getReason()
The reason, if any, that this interaction may have been vetoed or otherwise disallowed.

Intended to be set as a result of consulting one of the facets.

Returns:

getAdvisorClass

public Class<?> getAdvisorClass()
The class of the (first) advisor, if any, that provided the reason that this interaction is vetoed.

Returns:

advised

public void advised(String reason,
                    Class<?> advisorClass)
Specify the reason that this interaction has been vetoed and the class of the advisor that did the veto.


isVeto

public boolean isVeto()
Whether this interaction has been vetoed (meaning that getReason() and getAdvisorClass() will both be non-null and the reason non-empty.)

The interpretation of this depends on the subclass:



Copyright © 2001-2009 Naked Objects Group Ltd.. All Rights Reserved.