Package java.lang.reflect

Examples of java.lang.reflect.AccessibleObject


   {
      for (Injector injector : injectors)
      {
         if (injector instanceof JndiPropertyInjector)
         {
            AccessibleObject field = ((JndiPropertyInjector) injector).getAccessibleObject();
           
            if (field.isAnnotationPresent(javax.ejb.EJB.class))
            {
               continue; // skip nested EJB injection since the local proxy will be (de)serialized correctly
            }
           
            if (field instanceof Field)
View Full Code Here


   {
      for (Injector injector : injectors)
      {
         if (injector instanceof JndiPropertyInjector)
         {
            AccessibleObject field = ((JndiPropertyInjector) injector).getAccessibleObject();
           
            if (field.isAnnotationPresent(javax.ejb.EJB.class))
            {
               continue; // skip nested EJB injection since the local proxy will be (de)serialized correctly
            }
           
            if (field instanceof Field)
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

   {
      for (Injector injector : injectors)
      {
         if (injector instanceof JndiPropertyInjector)
         {
            AccessibleObject field = ((JndiPropertyInjector) injector).getAccessibleObject();

            if (field.isAnnotationPresent(javax.ejb.EJB.class))
            {
               continue; // skip nested EJB injection since the local proxy will be (de)serialized correctly
            }

            if (field instanceof Field)
View Full Code Here

    member.setAccessible(true);
    return member;
  }

  protected AccessibleObject findMember(Class sClass, String name) {
    AccessibleObject ao;
    try {
      ao = getMethod(sClass, name);
    } catch (NoSuchMethodException e) {
      String propertyname = name.substring(0, 1).toUpperCase() +
              (name.length() > 1 ? name.substring(1) : "");
View Full Code Here

        if (!areMethodsAccessible(map)) {
          return null;
        }
      }
    }
    AccessibleObject member = findMember(scope.getClass(), name);
    return member == null ? null : createWrapper(scopeIndex, wrappers, guards, member, null);
  }
View Full Code Here

    */
   public static void createInjectors(List<Injector> injectors, ClassLoader classLoader, InjectorFactory<?> factory, Collection<ResourceInjectionTargetMetaData> injectionTargets)
   {
      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;
     
      for(ResourceInjectionTargetMetaData injectionTarget : ref.getInjectionTargets())
      {
         // todo, get injection target class
         AccessibleObject ao = findInjectionTarget(container.getClassloader(), injectionTarget);
         Map<AccessibleObject, Injector> injectors = classInjectors.get(injectionTarget.getInjectionTargetClass());
         if (injectors == null)
         {
            injectors = new HashMap<AccessibleObject, Injector>();
            classInjectors.put(injectionTarget.getInjectionTargetClass(), injectors);
View Full Code Here

   {
      for (Injector injector : injectors)
      {
         if (injector instanceof JndiPropertyInjector)
         {
            AccessibleObject field = ((JndiPropertyInjector) injector).getAccessibleObject();

            if (field.isAnnotationPresent(javax.ejb.EJB.class))
            {
               continue; // skip nested EJB injection since the local proxy will be (de)serialized correctly
            }

            if (field instanceof Field)
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.