Package jodd.petite.meta

Examples of jodd.petite.meta.PetiteInject


    MethodDescriptor[] allMethods = cd.getAllMethodDescriptors();

    for (MethodDescriptor methodDescriptor : allMethods) {
      Method method = methodDescriptor.getMethod();

      PetiteInject ref = method.getAnnotation(PetiteInject.class);
      if (ref == null) {
        continue;
      }
      String[][] references = PetiteUtil.convertAnnValueToReferences(ref.value());
      list.add(injectionPointFactory.createMethodInjectionPoint(method, references));
    }

    MethodInjectionPoint[] methods;
View Full Code Here


    FieldDescriptor[] allFields = cd.getAllFieldDescriptors();

    for (FieldDescriptor fieldDescriptor : allFields) {
      Field field = fieldDescriptor.getField();

      PetiteInject ref = field.getAnnotation(PetiteInject.class);
      if ((autowire == false) && (ref == null)) {
        continue;
      }

      Class fieldType = field.getType();
      if (fieldType == Collection.class || ReflectUtil.isSubclass(fieldType, Collection.class)) {
        continue;
      }

      String[] refName = null;

      if (ref != null) {
        String name = ref.value().trim();
        if (name.length() != 0) {
          refName = new String[] {name};
        }
      }
View Full Code Here

        defaultCtor = ctor;  // detects default ctors
      }
      if (useAnnotation == false) {
        continue;
      }
      PetiteInject ref = ctor.getAnnotation(PetiteInject.class);
      if (ref == null) {
        continue;
      }
      if (foundedCtor != null) {
        throw new PetiteException("Two or more constructors are annotated as injection points in bean: " + type.getName());
      }
      foundedCtor = ctor;
      refValues = ref.value().trim();
    }
    if (foundedCtor == null) {
      if (allCtors.length == 1) {
        foundedCtor = allCtors[0].getConstructor();
      } else {
View Full Code Here

    FieldDescriptor[] allFields = cd.getAllFieldDescriptors();

    for (FieldDescriptor fieldDescriptor : allFields) {
      Field field = fieldDescriptor.getField();

      PetiteInject ref = field.getAnnotation(PetiteInject.class);
      if ((autowire == false) && (ref == null)) {
        continue;
      }

      Class fieldType = field.getType();
View Full Code Here

      if (method.getParameterTypes().length == 0) {
        // ignore methods with no argument
        continue;
      }

      PetiteInject ref = method.getAnnotation(PetiteInject.class);
      if (ref == null) {
        continue;
      }

      String[][] references = PetiteUtil.convertAnnValueToReferences(ref.value());
      list.add(injectionPointFactory.createMethodInjectionPoint(method, references));
    }

    MethodInjectionPoint[] methods;
View Full Code Here

      }

      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;
      }

      String[] refName = null;

      if (ref != null) {
        String name = ref.value().trim();
        if (name.length() != 0) {
          refName = new String[] {name};
        }
      }
View Full Code Here

      }

      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) {
View Full Code Here

TOP

Related Classes of jodd.petite.meta.PetiteInject

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.