/** * Will be the source provided in the * {@link #ParseValueEvent(Object, Identifier, String) constructor} if not * null, otherwise will fallback to the proposed value. */ @Override public Object getSource() { return super.getSource(); }
@Override public Object getSource() { return super.getSource(); } }
@Override public Object getProposed() { return getSource(); }
/** * The reason message, if any, that this interaction may have been vetoed or * otherwise disallowed. * * <p> * This message should be overridden by subclasses for containing the Reason, the Identifier and any other relevant context information. * * @return */ public String getReasonMessage() { if (this.getIdentifier() != null) { return String.format("Reason: %s. Identifier: %s", this.getReason(), this.getIdentifier()); } else { return String.format("Reason: %s", this.getReason()); } }
@Test public void afterAdvisedShouldReturnAdvisorClass() { interactionEvent = new InteractionEvent(source, identifier) { private static final long serialVersionUID = 1L; }; interactionEvent.advised("some reason", advisorClass); assertEquals(interactionEvent.getAdvisorClass(), advisorClass); }
@Override public String getReasonMessage() { return String.format("Source: %s. %s", this.getSource(), super.getReasonMessage()); } }
@Override public String getReasonMessage() { return String.format("Invalid action argument. Position: %s. Proposed value: %s. Reason: %s", this.getPosition(), this.getProposed(), super.getReasonMessage()); }
public ParseValueEvent(final Object source, final Identifier classIdentifier, final String proposed) { super(coalesce(source, proposed), classIdentifier); this.proposed = proposed; }
/** * The collection object (an instance of a <tt>List</tt> or a <tt>Set</tt> * etc) that is the originator of this event. * * <p> * The owning domain object is available using {@link #getDomainObject()}. * * @see #getDomainObject() */ @Override public Object getSource() { return super.getSource(); }
/** * Convenience method that returns the * {@link InteractionEvent#getAdvisorClass() advisor class} of the wrapped * {@link #getInteractionEvent() interaction event}. * * @return */ public Class<?> getAdvisorClass() { return interactionEvent.getAdvisorClass(); }
/** * Convenience method that returns the * {@link InteractionEvent#getIdentifier() identifier} of the wrapped * {@link #getInteractionEvent() interaction event}. * * @return */ public Identifier getIdentifier() { return interactionEvent.getIdentifier(); }
public InteractionException(final InteractionEvent interactionEvent) { super(interactionEvent.getReasonMessage()); this.interactionEvent = interactionEvent; }
@Override public ActionUsabilityEvent createInteractionEvent() { return new ActionUsabilityEvent(unwrap(getTarget()), getIdentifier()); }
@Override public ObjectTitleEvent createInteractionEvent() { return new ObjectTitleEvent(unwrap(getTarget()), getIdentifier(), getTitle()); }
@Override public ParseValueEvent createInteractionEvent() { final String proposedPojo = (String) unwrap(getProposed()); return new ParseValueEvent(unwrap(getTarget()), getIdentifier(), proposedPojo); }
@Override public Object getSource() { return super.getSource(); }
/** * Will be the source provided in the * {@link #ParseValueEvent(Object, Identifier, String) constructor} if not * null, otherwise will fallback to the proposed value. */ @Override public Object getSource() { return super.getSource(); }
@Override public Object getProposed() { return getSource(); }
public ParseValueEvent(final Object source, final Identifier classIdentifier, final String proposed) { super(coalesce(source, proposed), classIdentifier); this.proposed = proposed; }
/** * The collection object (an instance of a <tt>List</tt> or a <tt>Set</tt> * etc) that is the originator of this event. * * <p> * The owning domain object is available using {@link #getDomainObject()}. * * @see #getDomainObject() */ @Override public Object getSource() { return super.getSource(); }