Examples of BindStatus


Examples of org.springframework.web.servlet.support.BindStatus

            return null;
        }


        if (!optional) {
            return new BindStatus(requestContext, completeExpression, false);
        }


        if (isBound(requestContext, expression, completeExpression)) {
            // Creating an instance of BindStatus for an unbound object results in an exception,
            // so we avoid it by checking first.
            return new BindStatus(requestContext, completeExpression, false);
        }

        return null;

    }
View Full Code Here

Examples of org.springframework.web.servlet.support.BindStatus

                    // The "local variable override" check avoid scenarios where a locally defined variable
                    // (e.g. the iterated variable in a th:each) has the same name as a bound object (e.g. a
                    // form-backing bean). If this was not detected, the bound object value would be always used
                    // instead of the local variable's

                    final BindStatus bindStatus =
                            FieldUtils.getBindStatusFromParsedExpression(
                                    configuration, processingContext, true, useSelectionAsRoot, spelExpression);

                    if (bindStatus != null) {
                        // The expression goes against a bound object! Let Spring do its magic for displaying it...
                        return ValueFormatterWrapper.getDisplayString(bindStatus.getValue(), bindStatus.getEditor(), false);
                    }

                }

            }
View Full Code Here

Examples of org.springframework.web.servlet.support.BindStatus

    public ProcessorResult processAttribute(
            final Arguments arguments, final Element element, final String attributeName) {
       
        final String attributeValue = element.getAttributeValue(attributeName);
       
        final BindStatus bindStatus =
            FieldUtils.getBindStatus(arguments.getConfiguration(), arguments, attributeValue);
       
        if (bindStatus.isError()) {
           
            final Map<String,Object> localVariables = new HashMap<String,Object>(2, 1.0f);
            localVariables.put(SpringContextVariableNames.SPRING_FIELD_BIND_STATUS, bindStatus);
           
            final StringBuilder strBuilder = new StringBuilder();
            final String[] errorMsgs = bindStatus.getErrorMessages();
           
            for (int i = 0; i < errorMsgs.length; i++) {
                if (i > 0) {
                    strBuilder.append(ERROR_DELIMITER);
                }
View Full Code Here

Examples of org.springframework.web.servlet.support.BindStatus

    public final ProcessorResult processAttribute(
            final Arguments arguments, final Element element, final String attributeName) {
       
        final String attributeValue = element.getAttributeValue(attributeName);
       
        final BindStatus bindStatus =
            FieldUtils.getBindStatus(arguments.getConfiguration(), arguments, attributeValue);
       
        final Map<String,Object> localVariables =
                Collections.singletonMap(SpringContextVariableNames.SPRING_FIELD_BIND_STATUS, (Object)bindStatus);
       
View Full Code Here

Examples of org.springframework.web.servlet.support.BindStatus

        resolvedPath = nestedPath + resolvedPath;
      }
    }

    try {
      this.status = new BindStatus(getRequestContext(), resolvedPath, isHtmlEscape());
    }
    catch (IllegalStateException ex) {
      throw new JspTagException(ex.getMessage());
    }
View Full Code Here

Examples of org.springframework.web.servlet.support.BindStatus

      String nestedPath = getNestedPath();
      String pathToUse = (nestedPath != null ? nestedPath + getPath() : getPath());
      if (pathToUse.endsWith(PropertyAccessor.NESTED_PROPERTY_SEPARATOR)) {
        pathToUse = pathToUse.substring(0, pathToUse.length() - 1);
      }
      this.bindStatus = new BindStatus(getRequestContext(), pathToUse, false);
    }
    return this.bindStatus;
  }
View Full Code Here

Examples of org.springframework.web.servlet.support.BindStatus

  /**
   * Returns '<code>true</code>' if the bound value requires the
   * resultant '<code>select</code>' tag to be multi-select.
   */
  private boolean forceMultiple() throws JspException {
    BindStatus bindStatus = getBindStatus();
    Class valueType = bindStatus.getValueType();
    if (valueType != null && typeRequiresMultiple(valueType)) {
      return true;
    }
    else if (bindStatus.getEditor() != null) {
      Object editorValue = bindStatus.getEditor().getValue();
      if (editorValue != null && typeRequiresMultiple(editorValue.getClass())) {
        return true;
      }
    }
    return false;
View Full Code Here

Examples of org.springframework.web.servlet.support.BindStatus

      String nestedPath = getNestedPath();
      String pathToUse = (nestedPath != null ? nestedPath + getPath() : getPath());
      if (pathToUse.endsWith(PropertyAccessor.NESTED_PROPERTY_SEPARATOR)) {
        pathToUse = pathToUse.substring(0, pathToUse.length() - 1);
      }
      this.bindStatus = new BindStatus(getRequestContext(), pathToUse, false);
    }
    return this.bindStatus;
  }
View Full Code Here

Examples of org.springframework.web.servlet.support.BindStatus

  /**
   * Returns '<code>true</code>' if the bound value requires the
   * resultant '<code>select</code>' tag to be multi-select.
   */
  private boolean forceMultiple() throws JspException {
    BindStatus bindStatus = getBindStatus();
    Class valueType = bindStatus.getValueType();
    if (valueType != null && typeRequiresMultiple(valueType)) {
      return true;
    }
    else if (bindStatus.getEditor() != null) {
      Object editorValue = bindStatus.getEditor().getValue();
      if (editorValue != null && typeRequiresMultiple(editorValue.getClass())) {
        return true;
      }
    }
    return false;
View Full Code Here

Examples of org.springframework.web.servlet.support.BindStatus

      String nestedPath = getNestedPath();
      String pathToUse = (nestedPath != null ? nestedPath + getPath() : getPath());
      if (pathToUse.endsWith(PropertyAccessor.NESTED_PROPERTY_SEPARATOR)) {
        pathToUse = pathToUse.substring(0, pathToUse.length() - 1);
      }
      this.bindStatus = new BindStatus(getRequestContext(), pathToUse, false);
    }
    return this.bindStatus;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.