Examples of FieldCallback


Examples of com.google.code.gaeom.util.ReflectionUtils.FieldCallback

  {
    this.os = store;
    this.kind = os.typeToKind(clazz);
    this.clazz = clazz;
    this.cacheInstances = clazz.getAnnotation(Cached.class) != null;
    ReflectionUtils.visitFields(clazz, new FieldCallback()
    {
      public boolean doWith(Field field)
      {
        if (!Modifier.isTransient(field.getModifiers()) && !Modifier.isStatic(field.getModifiers()))
        {
View Full Code Here

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

Examples of org.springframework.util.ReflectionUtils.FieldCallback

  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

Examples of org.springframework.util.ReflectionUtils.FieldCallback

  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

Examples of org.springframework.util.ReflectionUtils.FieldCallback

            }
          }
        }
      }, PublicMethodAndFieldFilter.NON_STATIC);

      ReflectionUtils.doWithFields(type, new FieldCallback() {

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

Examples of org.springframework.util.ReflectionUtils.FieldCallback

    }

    @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

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

Examples of org.springframework.util.ReflectionUtils.FieldCallback

                    .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

Examples of org.springframework.util.ReflectionUtils.FieldCallback

    }

    // 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

Examples of org.springframework.util.ReflectionUtils.FieldCallback

                    .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
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.