Package java.lang.reflect

Examples of java.lang.reflect.Member


                  Class<?> paramClass = PrimitiveClassLoadingUtil.loadClass(param, di.getClassLoader());
                  methodSignature[paramIndex++] = paramClass;
               }
               if(log.isTraceEnabled())
                  log.trace("Looking for method " + methodName + Arrays.toString(methodSignature) + " on class " + ejbClass);
               Member member = ClassHelper.getPrivateMethod(ejbClass, methodName, methodSignature);
               log.debug("adding " + annotationClass.getName()
                     + " method annotation to " + member);
               annotations.addAnnotation(member, annotationClass, annotation);
               overrideAnnotations(container, member, annotationClass.getName(),
                     annotation);
View Full Code Here


      String ident = x.getIdent();
      JsExpression q = x.getQualifier();
      if (ident.startsWith("@")) {
        int dispId = dispatchInfo.getDispId(ident);

        Member member;
        if (dispId < 0) {
          // We've already emitted a warning from getDispId; just fake the jsni
          member = null;
        } else {
          member = dispatchInfo.getClassInfoByDispId(dispId).getMember(dispId);
View Full Code Here

        JsNameRef ref = (JsNameRef) x.getQualifier();
        String ident = ref.getIdent();
        if (ident.startsWith("@")) {
          int dispId = dispatchInfo.getDispId(ident);

          Member member;
          if (dispId < 0) {
            member = null;
          } else {
            member = dispatchInfo.getClassInfoByDispId(dispId).getMember(dispId);
          }
View Full Code Here

      StringBuffer logMsg = new StringBuffer();
      logMsg.append("Client invoke of ");
      logMsg.append(methodDispatchId);
      DispatchClassInfo classInfo = cl.getClassInfoByDispId(methodDispatchId);
      if (classInfo != null) {
        Member member = classInfo.getMember(methodDispatchId);
        if (member != null) {
          logMsg.append(" (");
          logMsg.append(member.getName());
          logMsg.append(")");
        }
      }
      logMsg.append(" on ");
      logMsg.append(jsThis.toString());
View Full Code Here

    @Test
    @SpecAssertions({ @SpecAssertion(section = "5.5.7", id = "caa"), @SpecAssertion(section = "5.5.7", id = "cba"),
            @SpecAssertion(section = "5.5.7", id = "cca") })
    public void testInjectionPointGetMember() {

        Member fieldMember = bar.getFoo().getInjectionPoint().getMember();
        assertNotNull(fieldMember);
        assertTrue(fieldMember instanceof Field);
        Field field = (Field) fieldMember;
        assertEquals(field.getName(), "fooInstance");
        assertEquals(field.getType(), Instance.class);
        assertEquals(field.getDeclaringClass(), Bar.class);

        Member methodMember = bar.getInitializerFoo().getInjectionPoint().getMember();
        assertNotNull(methodMember);
        assertTrue(methodMember instanceof Method);
        Method method = (Method) methodMember;
        assertEquals(method.getName(), "setInitializerInjectionFooInstance");
        assertEquals(method.getParameterTypes().length, 1);
        assertEquals(method.getDeclaringClass(), Bar.class);

        Member constructorMember = bar.getConstructorInjectionFoo().getInjectionPoint().getMember();
        assertNotNull(constructorMember);
        assertTrue(constructorMember instanceof Constructor);
        Constructor<?> constructor = (Constructor<?>) constructorMember;
        // See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6294399
        assertTrue("org.jboss.cdi.tck.tests.lookup.injectionpoint.dynamic.Bar".equals(constructor.getName())
View Full Code Here

    else {
      PropertyDescriptorImpl propertyDescriptor = (PropertyDescriptorImpl) propertyDescriptors.get(
          metaConstraint.getLocation().getPropertyName()
      );
      if ( propertyDescriptor == null ) {
        Member member = metaConstraint.getLocation().getMember();
        propertyDescriptor = addPropertyDescriptorForMember( member, isValidAnnotationPresent( member ) );
      }
      propertyDescriptor.addConstraintDescriptor( metaConstraint.getDescriptor() );
    }
  }
View Full Code Here

                     paramClass = di.getClassLoader().loadClass(param);
                  methodSignature[paramIndex++] = paramClass;
               }
               if(log.isTraceEnabled())
                  log.trace("Looking for method " + methodName + Arrays.toString(methodSignature) + " on class " + ejbClass);
               Member member = ClassHelper.getPrivateMethod(ejbClass, methodName, methodSignature);
               log.debug("adding " + annotationClass.getName()
                     + " method annotation to " + member);
               annotations.addAnnotation(member, annotationClass, annotation);
               overrideAnnotations(container, member, annotationClass.getName(),
                     annotation);
View Full Code Here

    if ( property.length() == 0 ) {
      throw new IllegalArgumentException( "The property name must not be empty." );
    }

    Member member = ReflectionHelper.getMember(
        beanClass, property, elementType
    );

    if ( member == null ) {
      throw new ValidationException(
View Full Code Here

    if ( !( ElementType.FIELD.equals( elementType ) || ElementType.METHOD.equals( elementType ) ) ) {
      throw new IllegalArgumentException( "Element type has to be FIELD or METHOD" );
    }

    Member member = null;
    if ( ElementType.FIELD.equals( elementType ) ) {
      GetDeclaredField action = GetDeclaredField.action( clazz, property );
      if ( System.getSecurityManager() != null ) {
        member = AccessController.doPrivileged( action );
      }
View Full Code Here

      ConstraintOrigin definedIn = definedIn( rootClass, hierarchyClass );
      ConstraintDescriptorImpl<A> constraintDescriptor = new ConstraintDescriptorImpl<A>(
          annotation, constraintHelper, config.getLocation().getElementType(), definedIn
      );

      Member member = config.getLocation().getMember();

      BeanMetaConstraint<A> metaConstraint = new BeanMetaConstraint<A>(
          constraintDescriptor, config.getLocation().getBeanClass(), member
      );
      addConstraintToMap( hierarchyClass, metaConstraint, constraints );
View Full Code Here

TOP

Related Classes of java.lang.reflect.Member

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.