Package jodd.introspector

Examples of jodd.introspector.FieldDescriptor


  public void registerPetitePropertyInjectionPoint(String beanName, String property, String reference) {
    BeanDefinition beanDefinition = lookupExistingBeanDefinition(beanName);
    String[] references = reference == null ? null : new String[] {reference};

    ClassDescriptor cd = ClassIntrospector.lookup(beanDefinition.type);
    FieldDescriptor fieldDescriptor = cd.getFieldDescriptor(property, true);
    if (fieldDescriptor == null) {
      throw new PetiteException("Property not found: " + beanDefinition.type.getName() + '#' + property);
    }

    PropertyInjectionPoint pip =
        injectionPointFactory.createPropertyInjectionPoint(fieldDescriptor.getField(), references);

    beanDefinition.addPropertyInjectionPoint(pip);
  }
View Full Code Here


   * @param property set property name
   */
  public void registerPetiteSetInjectionPoint(String beanName, String property) {
    BeanDefinition beanDefinition = lookupExistingBeanDefinition(beanName);
    ClassDescriptor cd = ClassIntrospector.lookup(beanDefinition.type);
    FieldDescriptor fieldDescriptor = cd.getFieldDescriptor(property, true);
    if (fieldDescriptor == null) {
      throw new PetiteException("Property not found: " + beanDefinition.type.getName() + '#' + property);
    }

    SetInjectionPoint sip =
        injectionPointFactory.createSetInjectionPoint(fieldDescriptor.getField());

    beanDefinition.addSetInjectionPoint(sip);
  }
View Full Code Here

  /**
   * Process all annotations of provided properties.
   */
  protected void collectPropertyAnnotationChecks(List<Check> annChecks, PropertyDescriptor propertyDescriptor) {
    FieldDescriptor fd = propertyDescriptor.getFieldDescriptor();

    if (fd != null) {
      Annotation[] annotations = fd.getField().getAnnotations();
      collectAnnotationChecks(annChecks, propertyDescriptor.getType(), propertyDescriptor.getName(), annotations);
    }

    MethodDescriptor md = propertyDescriptor.getReadMethodDescriptor();
    if (md != null) {
View Full Code Here

      if (getter != null) {
        String propertyName = propertyDescriptor.getName();

        boolean isTransient = false;
        // check for transient flag
        FieldDescriptor fieldDescriptor = propertyDescriptor.getFieldDescriptor();

        if (fieldDescriptor != null) {
          isTransient = Modifier.isTransient(fieldDescriptor.getField().getModifiers());
        }

        onProperty(propertyName, propertyDescriptor, isTransient);
      }
    }
View Full Code Here

      if (md != null) {
        Method getter = md.getMethod();
        JSONAnnotationData data = jsonAnnotation.readAnnotationData(getter);

        if (data == null) {
          FieldDescriptor fd = pd.getFieldDescriptor();
          if (fd == null) {
            continue;
          }

          Field field = fd.getField();
          data = jsonAnnotation.readAnnotationData(field);
        }

        if (data != null) {
          // annotation found
View Full Code Here

    // resolve component type
    Class targetClass = null;

    MethodDescriptor writeMethodDescriptor = propertyDescriptor.getWriteMethodDescriptor();
    FieldDescriptor fieldDescriptor = propertyDescriptor.getFieldDescriptor();

    if (writeMethodDescriptor != null) {
      targetClass = writeMethodDescriptor.getSetterRawComponentType();
    }
    if (targetClass == null && fieldDescriptor != null) {
      targetClass = fieldDescriptor.getRawComponentType();
    }

    this.targetClass = targetClass;

    if (targetClass == null) {
View Full Code Here

      if (ReflectUtil.isTypeOf(propertyType, Collection.class)) {
        continue;
      }

      MethodDescriptor writeMethodDescriptor = propertyDescriptor.getWriteMethodDescriptor();
      FieldDescriptor fieldDescriptor = propertyDescriptor.getFieldDescriptor();

      PetiteInject ref = null;

      if (writeMethodDescriptor != null) {
        ref = writeMethodDescriptor.getMethod().getAnnotation(PetiteInject.class);
      }
      if (ref == null && fieldDescriptor != null) {
        ref = fieldDescriptor.getField().getAnnotation(PetiteInject.class);
      }

      if ((autowire == false) && (ref == null)) {
        continue;
      }
View Full Code Here

      if (!ReflectUtil.isTypeOf(propertyType, Collection.class)) {
        continue;
      }

      MethodDescriptor writeMethodDescriptor = propertyDescriptor.getWriteMethodDescriptor();
      FieldDescriptor fieldDescriptor = propertyDescriptor.getFieldDescriptor();

      PetiteInject ref = null;

      if (writeMethodDescriptor != null) {
        ref = writeMethodDescriptor.getMethod().getAnnotation(PetiteInject.class);
      }
      if (ref == null && fieldDescriptor != null) {
        ref = fieldDescriptor.getField().getAnnotation(PetiteInject.class);
      }

      if ((autowire == false) && (ref == null)) {
        continue;
      }
View Full Code Here

        if (getter.matchDeclared(declared)) {
          names.add(propertyDescriptor.getName());
        }
      }
      else if (includeFields) {
        FieldDescriptor field = propertyDescriptor.getFieldDescriptor();
        if (field != null) {
          if (field.matchDeclared(declared)) {
            names.add(field.getName());
          }
        }
      }
    }
View Full Code Here

TOP

Related Classes of jodd.introspector.FieldDescriptor

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.