Package org.springframework.util.ReflectionUtils

Examples of org.springframework.util.ReflectionUtils.FieldCallback


    final Inner instance = INSTANCE.createInstance(entity, provider);

    assertThat(instance, is(notNullValue()));

    // Hack to check syntheic field as compiles create different field names (e.g. this$0, this$1)
    ReflectionUtils.doWithFields(Inner.class, new FieldCallback() {
      public void doWith(Field field) throws IllegalArgumentException, IllegalAccessException {
        if (field.isSynthetic() && field.getName().startsWith("this$")) {
          ReflectionUtils.makeAccessible(field);
          assertThat(ReflectionUtils.getField(field, instance), is(outer));
        }
View Full Code Here


  public ReflectionEntityInformation(Class<T> domainClass, final Class<? extends Annotation> annotation) {

    super(domainClass);
    Assert.notNull(annotation);

    ReflectionUtils.doWithFields(domainClass, new FieldCallback() {
      public void doWith(Field field) {
        if (field.getAnnotation(annotation) != null) {
          ReflectionEntityInformation.this.field = field;
          return;
        }
View Full Code Here

  private static Map<String, Object> discoverDeclaredProperties(Class<?> type, FieldFilter filter) {

    final Map<String, Object> map = new HashMap<String, Object>();

    ReflectionUtils.doWithFields(type, new FieldCallback() {

      @Override
      public void doWith(Field field) throws IllegalAccessException {
        map.put(field.getName(), field.get(null));
      }
View Full Code Here

            }
          }
        }
      }, PublicMethodAndFieldFilter.NON_STATIC);

      ReflectionUtils.doWithFields(type, new FieldCallback() {

        @Override
        public void doWith(Field field) {
          RootObjectInformation.this.fields.add(field);
        }
View Full Code Here

    }

    @Override
    public Object postProcessBeforeInitialization(final Object bean,
                                                  String beanName) throws BeansException {
        ReflectionUtils.doWithFields(bean.getClass(), new FieldCallback() {

            @Override
            public void doWith(Field field) throws IllegalArgumentException,
                    IllegalAccessException {
                // make the field accessible if defined private
View Full Code Here

    final Inner instance = INSTANCE.createInstance(entity, provider);

    assertThat(instance, is(notNullValue()));

    // Hack to check syntheic field as compiles create different field names (e.g. this$0, this$1)
    ReflectionUtils.doWithFields(Inner.class, new FieldCallback() {
      public void doWith(Field field) throws IllegalArgumentException, IllegalAccessException {
        if (field.isSynthetic() && field.getName().startsWith("this$")) {
          ReflectionUtils.makeAccessible(field);
          assertThat(ReflectionUtils.getField(field, instance), is(outer));
        }
View Full Code Here

                    .getEndpoint().getService().getServiceInfos().iterator()
                    .next()).build();
        } catch (WSDLException e) {
            throw new DeploymentException(e);
        }
        ReflectionUtils.doWithFields(getPojo().getClass(), new FieldCallback() {
            public void doWith(Field field) throws IllegalArgumentException,
                    IllegalAccessException {
                if (field.getAnnotation(WebServiceRef.class) != null) {
                    ServiceImpl s = new ServiceImpl(getBus(), null, null, field
                            .getType());
View Full Code Here

    }

    // fallback to field inspection (KF and Prosyst)
    final BundleContext[] ctx = new BundleContext[1];

    ReflectionUtils.doWithFields(bundle.getClass(), new FieldCallback() {

      public void doWith(final Field field) throws IllegalArgumentException, IllegalAccessException {
        ReflectionUtils.makeAccessible(field);
        ctx[0] = (BundleContext) field.get(bundle);
      }
View Full Code Here

                    .next()).build();
            description = WSDLFactory.newInstance().newWSDLWriter().getDocument(definition);
        } catch (WSDLException e) {
            throw new DeploymentException(e);
        }
        ReflectionUtils.doWithFields(getPojo().getClass(), new FieldCallback() {
            public void doWith(Field field) throws IllegalArgumentException,
                    IllegalAccessException {
                if (field.getAnnotation(WebServiceRef.class) != null) {
                    ServiceImpl s = new ServiceImpl(getBus(), null, null, field
                            .getType());
View Full Code Here

        if (modelValidation != null) {
          model.addValidation(modelValidation);
        }
      }

      ReflectionUtils.doWithFields(clazz, new FieldCallback() {

        @Override
        public void doWith(Field field) throws IllegalArgumentException,
            IllegalAccessException {
          if (!fields.contains(field.getName())
View Full Code Here

TOP

Related Classes of org.springframework.util.ReflectionUtils.FieldCallback

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.