Examples of BeanResolver


Examples of com.totsp.gwittir.rebind.beans.BeanResolver

                ((type.isPrimitive() != null) &&
                JPrimitiveType.BOOLEAN.equals(type.isPrimitive()))) {
            return innerExpression + ".isBoolean().booleanValue() ";
        }

        BeanResolver child = findType(type);

        if (child != null) {
            this.children.add(child);

            return "CODEC_" +
            child.getType().getQualifiedSourceName().replaceAll("\\.", "_") +
            ".deserializeFromJSONObject(" + innerExpression + ".isObject())";
        }

        throw new RuntimeException(""+type);
    }
View Full Code Here

Examples of com.totsp.gwittir.rebind.beans.BeanResolver

        JClassType subtype = type.asParameterizationOf((JGenericType) jsonCodec)
                                 .getTypeArgs()[0];
        this.types = this.getIntrospectableTypes(logger, context.getTypeOracle());

        BeanResolver thisType = null;

        for (BeanResolver r : this.types) {
            if (r.getType().equals(subtype)) {
                thisType = r;
View Full Code Here

Examples of com.totsp.gwittir.rebind.beans.BeanResolver

                    ").doubleValue())");
        } else if (type.getQualifiedSourceName().equals("java.lang.Boolean")) {
            sb.append(" JSONBoolean.getInstance( " + innerExpression + " ) ");
        } else {
      
            BeanResolver child = findType(type);
            if (child == null) {
                throw new RuntimeException(type+" is not introspectable!");
            }
            this.children.add(child);
            sb = sb.append("CODEC_" +
View Full Code Here

Examples of org.springframework.expression.BeanResolver

    this.beanname = beanname;
  }

  @Override
  public TypedValue getValueInternal(ExpressionState state) throws EvaluationException {
    BeanResolver beanResolver = state.getEvaluationContext().getBeanResolver();
    if (beanResolver==null) {
      throw new SpelEvaluationException(getStartPosition(),SpelMessage.NO_BEAN_RESOLVER_REGISTERED, beanname);
    }
    try {
       TypedValue bean = new TypedValue(beanResolver.resolve(state.getEvaluationContext(),beanname));
       return bean;
    } catch (AccessException ae) {
      throw new SpelEvaluationException( getStartPosition(), ae, SpelMessage.EXCEPTION_DURING_BEAN_RESOLUTION,
        beanname, ae.getMessage());
    }
View Full Code Here

Examples of org.springframework.expression.BeanResolver

  @Test
  public void invokeMethodWithoutConversion() throws Exception {
    final BytesService service = new BytesService();
    byte[] bytes = new byte[100];
    StandardEvaluationContext context = new StandardEvaluationContext(bytes);
    context.setBeanResolver(new BeanResolver() {
      @Override
      public Object resolve(EvaluationContext context, String beanName)
          throws AccessException {
        if ("service".equals(beanName)) {
          return service;
View Full Code Here

Examples of org.springframework.expression.BeanResolver

  }


  @Override
  public TypedValue getValueInternal(ExpressionState state) throws EvaluationException {
    BeanResolver beanResolver = state.getEvaluationContext().getBeanResolver();
    if (beanResolver == null) {
      throw new SpelEvaluationException(
          getStartPosition(), SpelMessage.NO_BEAN_RESOLVER_REGISTERED, this.beanName);
    }

    try {
      return new TypedValue(beanResolver.resolve(state.getEvaluationContext(), this.beanName));
    }
    catch (AccessException ex) {
      throw new SpelEvaluationException(getStartPosition(), ex, SpelMessage.EXCEPTION_DURING_BEAN_RESOLUTION,
        this.beanName, ex.getMessage());
    }
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.