Package de.odysseus.calyxo.base.misc

Examples of de.odysseus.calyxo.base.misc.CalyxoVariableResolver


   */
  public boolean when(HttpServletRequest request) throws Exception {
    if (expression == null) {
      return true;
    } else {
      VariableResolver resolver = new CalyxoVariableResolver(request);
      try {
        Boolean result = (Boolean)expression.evaluate(resolver);
        return result == null ? false : result.booleanValue();
      } catch (ELException e) {
        throw new ConfigException("Could not evaluate 'when' condition '" + when + "' in filter '" + toInlineString() + "'", e);
View Full Code Here


  public FormResult validate(HttpServletRequest request, FormInputValues params) {
    log.trace("validate()");
    FormResultImpl result = new FormResultImpl(this);

    if (this.inputs != null) {
      VariableResolver resolver = new CalyxoVariableResolver(request);
      Iterator inputs = getFormInputs();
      while (inputs.hasNext()) {
        FormInput input = (FormInput)inputs.next();
        if (input.isIgnored(resolver)) {
          result.add(new IgnoredFormInputResult(input, params));
        } else {
          result.add(input.validate(request, params, resolver));
        }
      }
    }

    if (asserts != null) {
      AssertVariableResolver resolver =
        new AssertVariableResolver(request, params, result);
      Iterator asserts = this.asserts.iterator();
      while (asserts.hasNext()) {
        Assert azzert = (Assert)asserts.next();
        resolver.reset();
        boolean asserted = azzert.eval(resolver);
        if (!asserted && !resolver.isInvalidPropertyReferenced()) {
          result.assertionFailed(resolver, azzert.getMessage());
        }
      }
    }
View Full Code Here

  /* (non-Javadoc)
   * @see de.odysseus.calyxo.forms.Checker#check(javax.servlet.http.HttpServletRequest, java.lang.Object)
   */
  public boolean check(HttpServletRequest request, final Object value) {
    VariableResolver resolver = new CalyxoVariableResolver(request) {
      public Object resolveVariable(String variable) throws ELException {
        if ("property".equals(variable)) {
          return value;
        }
        return super.resolveVariable(variable);
View Full Code Here

TOP

Related Classes of de.odysseus.calyxo.base.misc.CalyxoVariableResolver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.