Package org.jboss.metadata.spi.signature

Examples of org.jboss.metadata.spi.signature.Signature


    * @param annotations the actual annotations
    * @param resource the resource we're visiting
    */
   protected void handleAnnotations(ElementType type, CtMember member, Object[] annotations, ResourceContext resource)
   {
      Signature signature = null;
      if (member != null)
         signature = JavassistSignatureFactory.getSignature(member);
      handleAnnotations(type, signature, annotations, resource);
   }
View Full Code Here


    * @param className the className
    * @param commit the commit list
    */
   protected static void handleAnnotations(ElementType type, CtMember member, Object[] annotations, String className, List<CommitElement> commit)
   {
      Signature signature = null;
      if (member != null)
         signature = JavassistSignatureFactory.getSignature(member);
      handleAnnotations(type, signature, annotations, className, commit);
   }
View Full Code Here

            assertSame(annotation, cmmd.removeAnnotation(sig, TestAnnotation.class));
         }
      }
      Constructor<?> c = getConstructor();
      ConstructorInfo ci = getConstructorInfo();
      Signature sc = new ConstructorSignature(c);
      checkAnnotationCycle(sc, c, ci);
      Method m = getMethod();
      MethodInfo mi = getMethodInfo();
      Signature sm = new MethodSignature(m);
      checkAnnotationCycle(sm, m, mi);
      Field f = getField();
      FieldInfo fi = getFieldInfo();
      Signature sf = new FieldSignature(f);
      checkAnnotationCycle(sf, f, fi);
   }
View Full Code Here

            assertSame(metadata, object);
         }
      }
      Constructor<?> c = getConstructor();
      ConstructorInfo ci = getConstructorInfo();
      Signature sc = new ConstructorSignature(c);
      checkMetaDataCycle(sc, c, ci);
      Method m = getMethod();
      MethodInfo mi = getMethodInfo();
      Signature sm = new MethodSignature(m);
      checkMetaDataCycle(sm, m, mi);
      Field f = getField();
      FieldInfo fi = getFieldInfo();
      Signature sf = new FieldSignature(f);
      checkMetaDataCycle(sf, f, fi);
   }
View Full Code Here

   {
      AnnotatedElementMetaDataLoader annotatedElementLoader = new AnnotatedElementMetaDataLoader(BridgeMethodBean.class);

      Method method = BridgeMethodBean.class.getMethod("unambiguous", Object.class);
      assertTrue(method.isBridge());
      Signature methodSignature = new DeclaredMethodSignature(method);
      MetaDataRetrieval retrieval = annotatedElementLoader.getComponentMetaDataRetrieval(methodSignature);
      assertNotNull("Expected a MetaDataRetrieval for method " + method, retrieval);
      MetaData metadata = new MetaDataRetrievalToMetaDataBridge(retrieval);
      Annotation[] annotations = metadata.getAnnotations();
      assertTrue("Expected one annotation on unambiguous method of " + BridgeMethodBean.class, annotations.length == 1);
View Full Code Here

   {
      AnnotatedElementMetaDataLoader annotatedElementLoader = new AnnotatedElementMetaDataLoader(BridgeMethodChildBean.class);

      Method method = BridgeMethodChildBean.class.getMethod("unambiguous", Object.class);
      assertTrue(method.isBridge());
      Signature methodSignature = new DeclaredMethodSignature(method);
      MetaDataRetrieval retrieval = annotatedElementLoader.getComponentMetaDataRetrieval(methodSignature);
      assertNotNull("Expected a MetaDataRetrieval for method " + method, retrieval);
      MetaData metadata = new MetaDataRetrievalToMetaDataBridge(retrieval);
      Annotation[] annotations = metadata.getAnnotations();
      assertTrue("Expected one annotation on unambiguous method of " + BridgeMethodChildBean.class, annotations.length == 1);
View Full Code Here

      // Ensure that the bridged method was picked up
      assertTrue("Method " + method + " was expected to be a bridged method", method.isBridge());

      // now just get the ComponentMetaDataRetrieval (which internally triggers the call to search for the
      // non-bridged method).
      Signature methodSignature = new DeclaredMethodSignature(method);
      MetaDataRetrieval retrieval = annotatedElementLoader.getComponentMetaDataRetrieval(methodSignature);
      assertNotNull("Expected a MetaDataRetrieval for method " + method, retrieval);
   }
View Full Code Here

   }

   public void testConstructor() throws Exception
   {
      CtClass ctClass = getCtClass(SignatureTester.class);
      Signature jpcs = JavassistSignatureFactory.getSignature(ctClass.getDeclaredConstructor(new CtClass[]{getCtClass(Calendar.class)}));
      assertEquals(getClassParameterConstructorSignature(), jpcs);
      assertEquals(getClassInfoParameterConstructorSignature(), jpcs);
   }
View Full Code Here

   }

   public void testConstructorParams() throws Exception
   {
      CtClass ctClass = getCtClass(SignatureTester.class);
      Signature jpcs = new JavassistConstructorParametersSignature(ctClass.getDeclaredConstructor(new CtClass[]{getCtClass(Calendar.class)}), 0);
      assertEquals(getConstructorParametersSignature(), jpcs);
      assertEquals(getConstructorInfoParametersSignature(), jpcs);
   }
View Full Code Here

   public void testMethod() throws Exception
   {
      CtClass ctClass = getCtClass(SignatureTester.class);
      CtMethod ctMethod = ctClass.getDeclaredMethod("applyTimeZone", new CtClass[]{getCtClass(Calendar.class), getCtClass(TimeZone.class)});
      Signature sig = JavassistSignatureFactory.getSignature(ctMethod);
      assertEquals(getClassMethodSignature(), sig);
      assertEquals(getStringMethodSignature(), sig);
      assertEquals(getMethodSignature(), sig);
      assertEquals(getMethodInfoSignature(), sig);
   }
View Full Code Here

TOP

Related Classes of org.jboss.metadata.spi.signature.Signature

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.