Examples of MappingResult


Examples of io.fabric8.gateway.support.MappingResult

    private MappingRuleResolver resolver = new MappingRuleResolver();

    public HttpMappingResult findMappingRule(HttpServletRequest request, HttpServletResponse response) {
        String requestURI = request.getRequestURI();
        String contextPath = request.getContextPath();
        MappingResult answer = null;
        if (contextPath != null && contextPath.length() > 0 && !contextPath.equals("/")) {
            String requestWithoutContextPath = requestURI.substring(contextPath.length());
            answer = resolver.findMappingRule(requestWithoutContextPath);
        }
        if (answer == null) {
View Full Code Here

Examples of org.springframework.binding.mapping.MappingResult

  public Object getFieldValue(String field) {
    if (mappingResults != null) {
      List results = mappingResults.getResults(new FieldErrorResult(field));
      if (!results.isEmpty()) {
        MappingResult fieldError = (MappingResult) results.get(0);
        return fieldError.getOriginalValue();
      }
    }
    return getFormattedValue(parseFieldExpression(field));
  }
View Full Code Here

Examples of org.springframework.binding.mapping.MappingResult

  public Object getFieldValue(String field) {
    // requires boundObject, and expressionParser to work
    if (mappingResults != null) {
      List results = mappingResults.getResults(new PropertyErrorMappingResult(field));
      if (!results.isEmpty()) {
        MappingResult fieldError = (MappingResult) results.get(0);
        return fieldError.getOriginalValue();
      }
    }
    return parseFieldExpression(field).getValue(boundObject);
  }
View Full Code Here

Examples of org.springframework.binding.mapping.MappingResult

  }

  public boolean hasErrorResults() {
    Iterator it = mappingResults.iterator();
    while (it.hasNext()) {
      MappingResult result = (MappingResult) it.next();
      if (result.isError()) {
        return true;
      }
    }
    return false;
  }
View Full Code Here

Examples of org.springframework.binding.mapping.MappingResult

  public List getErrorResults() {
    List errorResults = new ArrayList();
    Iterator it = mappingResults.iterator();
    while (it.hasNext()) {
      MappingResult result = (MappingResult) it.next();
      if (result.isError()) {
        errorResults.add(result);
      }
    }
    return Collections.unmodifiableList(errorResults);
  }
View Full Code Here

Examples of org.springframework.binding.mapping.MappingResult

  public List getResults(MappingResultsCriteria criteria) {
    List results = new ArrayList();
    Iterator it = mappingResults.iterator();
    while (it.hasNext()) {
      MappingResult result = (MappingResult) it.next();
      if (criteria.test(result)) {
        results.add(result);
      }
    }
    return Collections.unmodifiableList(results);
View Full Code Here

Examples of org.springframework.binding.mapping.MappingResult

  }

  private void addErrorMessages(MappingResults results) {
    List errors = results.getResults(MAPPING_ERROR);
    for (Iterator it = errors.iterator(); it.hasNext();) {
      MappingResult error = (MappingResult) it.next();
      requestContext.getMessageContext().addMessage(createMessageResolver(error));
    }
  }
View Full Code Here

Examples of org.springframework.binding.mapping.MappingResult

  }

  private void addErrorMessages(MappingResults results) {
    List errors = results.getResults(MAPPING_ERROR);
    for (Iterator it = errors.iterator(); it.hasNext();) {
      MappingResult error = (MappingResult) it.next();
      requestContext.getMessageContext().addMessage(createMessageResolver(error));
    }
  }
View Full Code Here

Examples of org.springframework.binding.mapping.MappingResult

  public Object getUserValue(String property) {
    if (mappingResults != null) {
      List results = mappingResults.getResults(new PropertyMappingResult(property));
      if (!results.isEmpty()) {
        MappingResult result = (MappingResult) results.get(0);
        return result.getOriginalValue();
      }
    }
    return null;
  }
View Full Code Here

Examples of org.springframework.binding.mapping.MappingResult

  public Principal getUserPrincipal() {
    return requestContext.getExternalContext().getCurrentUser();
  }

  public Object getUserValue(String property) {
    MappingResult result = getMappingResult(property);
    return result != null ? result.getOriginalValue() : null;
  }
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.