/** Validate the given resource. * * @param validationState the current validation state. * @param messageAcceptor the message acceptor. */ public void validate(StateAccess validationState, ValidationMessageAcceptor messageAcceptor) { if (isResponsible(validationState.getState().context, validationState.getState().currentObject)) { try { for (final MethodWrapper method : getMethods(validationState.getState().currentObject)) { final Context ctx = new Context(validationState, this, method, messageAcceptor); this.currentContext.set(ctx); initializeContext(ctx); method.invoke(ctx); } } finally { this.currentContext.set(null); } } }
public AssertableDiagnostics diagnose() { if (!validatorCalled) throw new IllegalStateException("You have to call validator() before you call diagnose()"); validatorCalled = false; AssertableDiagnostics ad = new AssertableDiagnostics((Diagnostic) validator.setMessageAcceptor(validator) .getState().chain); validator.setMessageAcceptor(validator).getState().chain = new BasicDiagnostic(); return ad; }
public AssertableDiagnostics diagnose() { if (!validatorCalled) throw new IllegalStateException("You have to call validator() before you call diagnose()"); validatorCalled = false; AssertableDiagnostics ad = new AssertableDiagnostics((Diagnostic) validator.setMessageAcceptor(validator) .getState().chain); validator.setMessageAcceptor(validator).getState().chain = new BasicDiagnostic(); return ad; }
public T validator() { State s = validator.setMessageAcceptor(validator).getState(); if (s.chain == null) s.chain = new BasicDiagnostic(); validatorCalled = true; return validator; }
public AssertableDiagnostics diagnose() { if (!validatorCalled) throw new IllegalStateException("You have to call validator() before you call diagnose()"); validatorCalled = false; AssertableDiagnostics ad = new AssertableDiagnostics((Diagnostic) validator.setMessageAcceptor(validator) .getState().chain); validator.setMessageAcceptor(validator).getState().chain = new BasicDiagnostic(); return ad; }
public T validator() { State s = validator.setMessageAcceptor(validator).getState(); if (s.chain == null) s.chain = new BasicDiagnostic(); validatorCalled = true; return validator; }
/** Replies the current check mode. * * @return the mode. */ public CheckMode getCheckMode() { return this.validationState.getState().checkMode; }
/** Replies the diagnostic chain. * * @return the diagnostic chain. */ public DiagnosticChain getChain() { return this.validationState.getState().chain; }
public T validator() { State s = validator.setMessageAcceptor(validator).getState(); if (s.chain == null) s.chain = new BasicDiagnostic(); validatorCalled = true; return validator; }
/** Replies the current check type. * * @return the type. */ public CheckType getCheckType() { return this.validationState.getState().currentCheckType; }
/** Replies the object under validation. * * @return the object under validation. */ public EObject getCurrentObject() { return this.validationState.getState().currentObject; }
/** Replies the current validation context. * * @return the context. */ public Map<Object, Object> getContext() { return this.validationState.getState().context; }