Examples of PetiteInject


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

Examples of jodd.petite.meta.PetiteInject

    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

Examples of jodd.petite.meta.PetiteInject

        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

Examples of jodd.petite.meta.PetiteInject

    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

Examples of jodd.petite.meta.PetiteInject

      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

Examples of jodd.petite.meta.PetiteInject

      }

      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

Examples of jodd.petite.meta.PetiteInject

      }

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