Package java.lang.reflect

Examples of java.lang.reflect.AccessibleObject


        Class[] argClasses = new Class[arguments.length];
        for(int i = 0; i < arguments.length; i++) {
            argClasses[i] = (arguments[i] == null) ? null : arguments[i].getClass();
        }

        AccessibleObject m = null;
        if (target instanceof Class) {
            /*
            For class methods, simluate the effect of a meta class
            by taking the union of the static methods of the
            actual class, with the instance methods of "Class.class"
View Full Code Here


      if(injectionTargets == null)
         return;

      for(ResourceInjectionTargetMetaData injectionTarget : injectionTargets)
      {
         AccessibleObject ao = findInjectionTarget(classLoader, injectionTarget);
         BeanProperty property = BeanPropertyFactory.create(ao);
         injectors.add(factory.create(property));
      }
   }
View Full Code Here

         return injectionType;

      ClassLoader loader = container.getClassloader();
      for(ResourceInjectionTargetMetaData injectionTarget : ref.getInjectionTargets())
      {
         AccessibleObject ao = findInjectionTarget(loader, injectionTarget);
         BeanProperty prop = BeanPropertyFactory.create(ao);
         JndiPropertyInjector propInjector = new JndiPropertyInjector(prop, encName, container.getEnc());
         container.getInjectors().add(propInjector);
         // Validate all the injection types are consistent
         Class<?> type;
View Full Code Here

      if (!encName.startsWith("env/"))
      {
         encName = "env/" + encName;
      }

      AccessibleObject accObj = property.getAccessibleObject();
     
      Class<?> type = property.getType();
      if (!ref.type().equals(Object.class))
      {
         type = ref.type();
View Full Code Here

         {
            map = new HashMap<AccessibleObject, Injector>();
            injectors.put(injectionTarget.getInjectionTargetClass(), map);
         }
        
         AccessibleObject ao = InjectionUtil.findInjectionTarget(classLoader, injectionTarget);
         BeanProperty property = BeanPropertyFactory.create(ao);
         map.put(ao, factory.create(property));
      }
   }
View Full Code Here

      if (!encName.startsWith("env/"))
      {
         encName = "env/" + encName;
      }

      AccessibleObject accObj = property.getAccessibleObject();

      Class<?> type = property.getType();
      if (!ref.type().equals(Object.class))
      {
         type = ref.type();
View Full Code Here

            // If there are @Addressing, @RespectBinding or @MTOM annotations present on injection targets,
            // these annotations must be equivalent for all the injection targets.
         }
         final InjectionTarget injectionTarget = serviceRefSBMD.getInjectionTargets().iterator().next();

         AccessibleObject anAlement = this.findInjectionTarget(loader, injectionTarget);
         this.processAnnotatedElement(anAlement, serviceRefUMDM);
      }

      // propagate port compoments
      final Collection<? extends PortComponent> portComponentsSBMD = serviceRefSBMD.getPortComponents();
View Full Code Here

      for (int i = 0; i < method.getParameterTypes().length; i++)
      {
         Class<?> type = method.getParameterTypes()[i];
         Annotation[] annotations = method.getParameterAnnotations()[i];
         Type genericType = method.getGenericParameterTypes()[i];
         AccessibleObject target = method;
         params[i] = ClientMarshallerFactory.createMarshaller(declaringClass, providerFactory, type, annotations, genericType, target, false);
      }
      return params;
   }
View Full Code Here

   *
   * @return True iff the attribute's Java Member is annotated with {@code ManyToMany},
   *         {@code ManyToOne}, {@code OneToMany}, or {@code OneToOne}.
   */
  private boolean isAssociation(SingularAttribute<?, ?> attr) {
    AccessibleObject member = (AccessibleObject) getJavaMember(attr);
    return (member.getAnnotation(ManyToMany.class) != null
        || member.getAnnotation(ManyToOne.class) != null
        || member.getAnnotation(OneToMany.class) != null || member.getAnnotation(OneToOne.class) != null);
  }
View Full Code Here

    if (!(javaMember instanceof AccessibleObject)) {
      Class<? extends Member> memberType = javaMember == null ? null : javaMember.getClass();
      throw new GenerationException(
          "Found a SingularAttribute whose Java Member is not a field or a method (it is a " + memberType + ")");
    }
    AccessibleObject member = (AccessibleObject) javaMember;

    if (member.getAnnotation(ManyToMany.class) != null) {
      ManyToMany anno = member.getAnnotation(ManyToMany.class);
      return anno.cascade();
    }
    if (member.getAnnotation(ManyToOne.class) != null) {
      ManyToOne anno = member.getAnnotation(ManyToOne.class);
      return anno.cascade();
    }
    if (member.getAnnotation(OneToMany.class) != null) {
      OneToMany anno = member.getAnnotation(OneToMany.class);
      return anno.cascade();
    }
    if (member.getAnnotation(OneToOne.class) != null) {
      OneToOne anno = member.getAnnotation(OneToOne.class);
      return anno.cascade();
    }

    // the member must not be a relationship (or at least not the owning side of one)
    return null;
View Full Code Here

TOP

Related Classes of java.lang.reflect.AccessibleObject

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.