Package org.springframework.expression.spel.support

Examples of org.springframework.expression.spel.support.ReflectivePropertyAccessor


    }

    ExtensionAwarePropertyAccessor accessor = new ExtensionAwarePropertyAccessor(getExtensions());

    ec.addPropertyAccessor(accessor);
    ec.addPropertyAccessor(new ReflectivePropertyAccessor());
    ec.addMethodResolver(accessor);

    // Add parameters for indexed access
    ec.setRootObject(parameterValues);
    ec.setVariables(collectVariables(parameters, parameterValues));
View Full Code Here


    checkTemplateParsingError("Hello ${", "No ending suffix '}' for expression starting at character 6: ${");
  }

  @Test
  public void accessingNullPropertyViaReflection_SPR5663() throws AccessException {
    PropertyAccessor propertyAccessor = new ReflectivePropertyAccessor();
    EvaluationContext context = TestScenarioCreator.getTestEvaluationContext();
    assertFalse(propertyAccessor.canRead(context, null, "abc"));
    assertFalse(propertyAccessor.canWrite(context, null, "abc"));
    try {
      propertyAccessor.read(context, null, "abc");
      fail("Should have failed with an AccessException");
    }
    catch (AccessException ae) {
      // success
    }
    try {
      propertyAccessor.write(context, null, "abc", "foo");
      fail("Should have failed with an AccessException");
    }
    catch (AccessException ae) {
      // success
    }
View Full Code Here

    assertEquals(expectedResult, result);
  }

  @Test
  public void SPR9994_bridgeMethods() throws Exception {
    ReflectivePropertyAccessor accessor = new ReflectivePropertyAccessor();
    StandardEvaluationContext context = new StandardEvaluationContext();
    Object target = new GenericImplementation();
    TypedValue value = accessor.read(context, target, "property");
    assertEquals(Integer.class, value.getTypeDescriptor().getType());
  }
View Full Code Here

    assertEquals(Integer.class, value.getTypeDescriptor().getType());
  }

  @Test
  public void SPR10162_onlyBridgeMethod() throws Exception {
    ReflectivePropertyAccessor accessor = new ReflectivePropertyAccessor();
    StandardEvaluationContext context = new StandardEvaluationContext();
    Object target = new OnlyBridgeMethod();
    TypedValue value = accessor.read(context, target, "property");
    assertEquals(Integer.class, value.getTypeDescriptor().getType());
  }
View Full Code Here

TOP

Related Classes of org.springframework.expression.spel.support.ReflectivePropertyAccessor

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.