InteractionEvent

Supported only by WrapperFactory , 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 VisibilityEvent , UsabilityEvent and ValidityEvent .

API

InteractionEvent.java
class InteractionEvent {
  InteractionEvent(Object source, Identifier identifier)
  Object getSource()     (1)
  Identifier getIdentifier()     (2)
  String getClassName()     (3)
  String getClassNaturalName()     (4)
  String getMemberName()     (5)
  String getMemberNaturalName()     (6)
  Can<String> getMemberParameterNames()     (7)
  Can<String> getMemberParameterNaturalNames()     (8)
  String getReason()     (9)
  String getReasonMessage()     (10)
  Class<?> getAdvisorClass()     (11)
  void advised(String reason, Class<?> advisorClass)     (12)
  boolean isVeto()     (13)
}
1 getSource()

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

2 getIdentifier()

The Identifier of the feature of the object being interacted with.

3 getClassName()

As per #getClassName() , but naturalized.

4 getClassNaturalName()

Convenience method that returns the Identifier#getClassNaturalName() natural class name of the #getIdentifier() identifier .

5 getMemberName()

Convenience method that returns the Identifier#getMemberLogicalName() member name of the #getIdentifier() identifier .

6 getMemberNaturalName()

As per #getMemberName() , but naturalized.

7 getMemberParameterNames()

Convenience method that returns the Identifier#getClassName() class name of the #getIdentifier() identifier .

8 getMemberParameterNaturalNames()

As per #getMemberParameterNames() , but naturalized.

9 getReason()

The reason, if any, that this interaction may have been vetoed or otherwise disallowed.

10 getReasonMessage()

The reason message, if any, that this interaction may have been vetoed or otherwise disallowed.

11 getAdvisorClass()

The class of the (first) advisor, if any, that provided the #getReason() reason that this interaction is #isVeto() vetoed .

12 advised(String, Class)

Specify the #getReason() reason that this interaction has been vetoed and the #getAdvisorClass() class of the advisor that did the veto.

13 isVeto()

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

Members

getSource()

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

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.

getClassName()

As per #getClassName() , but naturalized.

getClassNaturalName()

Convenience method that returns the Identifier#getClassNaturalName() natural class name of the #getIdentifier() identifier .

getMemberName()

Convenience method that returns the Identifier#getMemberLogicalName() member name of the #getIdentifier() identifier .

getMemberNaturalName()

As per #getMemberName() , but naturalized.

getMemberParameterNames()

Convenience method that returns the Identifier#getClassName() class name of the #getIdentifier() identifier .

getMemberParameterNaturalNames()

As per #getMemberParameterNames() , but naturalized.

getReason()

The reason, if any, that this interaction may have been vetoed or otherwise disallowed.

Intended to be #advised(String, Class) set as a result of consulting one of the facets.

getReasonMessage()

The reason message, if any, that this interaction may have been vetoed or otherwise disallowed.

This message should be overridden by subclasses for containing the Reason, the Identifier and any other relevant context information.

getAdvisorClass()

The class of the (first) advisor, if any, that provided the #getReason() reason that this interaction is #isVeto() vetoed .

advised(String, Class)

Specify the #getReason() reason that this interaction has been vetoed and the #getAdvisorClass() class of the advisor that did the veto.

isVeto()

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

The interpretation of this depends on the subclass:

  • for VisibilityEvent , a veto means that the feature (property, collection, action) is hidden

  • for UsabilityEvent , a veto means that the feature is disabled

  • for ValidityEvent , a veto means that the proposed modification (property value, object added/removed, action argument) is invalid