/** * 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(); }
/** * 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.getReason()); this.interactionEvent = interactionEvent; }
private void notifyListenersAndVetoIfRequired(final InteractionResult interactionResult) { final InteractionEvent interactionEvent = interactionResult.getInteractionEvent(); notifyListeners(interactionEvent); if (interactionEvent.isVeto()) { throw toException(interactionEvent); } }
@Override public ParseValueEvent createInteractionEvent() { String proposedPojo = (String)unwrap(getProposed()); return new ParseValueEvent(unwrap(getTarget()), getIdentifier(), proposedPojo); }
/** * Returns the contained {@link InteractionEvent}, if necessary updated with the * {@link #advise(String, InteractionAdvisorFacet) advice} of the interactions. * * <p> * That is, if still {@link State#ADVISING advising}, then copies over the details from this result into * the contained {@link InteractionEvent}, and flips into {@link State#ADVISED advised (done)}. * * @return */ public InteractionEvent getInteractionEvent() { if (state == State.ADVISING) { interactionEvent.advised(getReason(), getAdvisorFacetClass()); state = State.ADVISED; } return interactionEvent; }
@Override public Object getSource() { return super.getSource(); } }
/** * 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(); }
public ParseValueEvent(final Object source, final Identifier classIdentifier, final String proposed) { super(coalesce(source, proposed), classIdentifier); this.proposed = proposed; }
public Object getProposed() { return getSource(); }
/** * As per {@link #getMemberName()}, but naturalized. */ public String getMemberNaturalName() { return NameUtils.naturalName(getMemberName()); }
/** * As per {@link #getClassName()}, but {@link NameUtils#naturalName(String) naturalized}. */ public String getClassNaturalName() { return NameUtils.naturalName(getClassName()); }
/** * As per {@link #getMemberParameterName()}, but naturalized. */ public String[] getMemberParameterNaturalNames() { return NameUtils.naturalNames(getMemberParameterNames()); }
public InteractionException(final InteractionEvent interactionEvent) { super(interactionEvent.getReason()); this.interactionEvent = interactionEvent; }
private void notifyListenersAndVetoIfRequired(final InteractionResult interactionResult) { final InteractionEvent interactionEvent = interactionResult.getInteractionEvent(); notifyListeners(interactionEvent); if (interactionEvent.isVeto()) { throw toException(interactionEvent); } }
/** * 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(); }
@Override public ParseValueEvent createInteractionEvent() { String proposedPojo = (String)unwrap(getProposed()); return new ParseValueEvent(unwrap(getTarget()), getIdentifier(), proposedPojo); }
/** * Returns the contained {@link InteractionEvent}, if necessary updated with the * {@link #advise(String, InteractionAdvisorFacet) advice} of the interactions. * * <p> * That is, if still {@link State#ADVISING advising}, then copies over the details from this result into * the contained {@link InteractionEvent}, and flips into {@link State#ADVISED advised (done)}. * * @return */ public InteractionEvent getInteractionEvent() { if (state == State.ADVISING) { interactionEvent.advised(getReason(), getAdvisorFacetClass()); state = State.ADVISED; } return interactionEvent; }