Package java.lang.annotation

Examples of java.lang.annotation.Annotation


        Class claz = PutLastTradedPricePortType.class;
        TradePriceData priceData = new TradePriceData();
        Holder<TradePriceData> holder = new Holder<TradePriceData>(priceData);
        Method method = claz.getMethod("sayHi", holder.getClass());
        assertNotNull("Can not find SayHi method in generated class ", method);
        Annotation ann = method.getAnnotation(WebMethod.class);
        WebMethod webMethod = (WebMethod)ann;
        assertEquals(webMethod.operationName(), "SayHi");
        Annotation[][] paraAnns = method.getParameterAnnotations();
        for (Annotation[] paraType : paraAnns) {
            for (Annotation an : paraType) {
View Full Code Here


    if (!ctor.isAnnotationPresent(FooAnnotation.class)) {
      fail("Instance constructor is missing FooAnnotation.");
    }

    // check for parameter annotation
    Annotation paramAnnotation = ctor.getParameterAnnotations()[0][0];
    assertEquals(paramAnnotation.annotationType(), BarAnnotation.class);
  }
View Full Code Here

      ServiceAnnotationMetaData amd = annotations.get(0);
      assertNotNull(amd);
      String amdExp = amd.getAnnotation();
      assertEquals(exp, amdExp);
      Object expAnn = AnnotationCreator.createAnnotation(exp, c);
      Annotation ann = amd.getAnnotationInstance();
      assertEquals(expAnn, ann);
   }
View Full Code Here

      Set<AnnotationMetaData> annotations = attachment.getAnnotations();
      if(annotations != null)
      {
         for(AnnotationMetaData amd : annotations)
         {
            Annotation ann = amd.getAnnotationInstance();
            if(ann instanceof ManagementObjectClass)
            {
               ManagementObjectClass moc = (ManagementObjectClass) ann;
               mocClass = moc.code();
               log.debug("Saw ManagementObjectClass, "+mocClass+" for bean: "+attachment);
View Full Code Here

      AbstractKernelControllerContext akcc = (AbstractKernelControllerContext) context;
      BeanMetaData bmd = akcc.getBeanMetaData();
      Set<AnnotationMetaData> annotations = bmd.getAnnotations();
      for (AnnotationMetaData annotationMetaData : annotations)
      {
         Annotation annotation = annotationMetaData.getAnnotationInstance();
         if (annotation.annotationType() == Password.class)
         {
            passwordAnnotations.add((Password) annotation);
         }
      }
      return passwordAnnotations;
View Full Code Here

    @Test
    public void testAnnotationValidation() throws Exception {
        final AnnotationValidator testClass = new AnnotationValidator();
        Method method = testClass.getClass().getMethod("cacheMe1",null);
        Annotation annotation = method.getAnnotation(ReadThroughAssignCache.class);
        try {
            AnnotationDataBuilder.buildAnnotationData(annotation, ReadThroughAssignCache.class, method);
            fail("Expected Exception.");
        } catch (InvalidParameterException ex) {
            System.out.println(ex.getMessage());
View Full Code Here

    private AnnotatedType<Object> decorateType(final AnnotatedType<Object> type, final Class<? extends Annotation> jsfScope) {
        final Class<? extends Annotation> cdiScope = getCdiScopeFor(jsfScope);

        AnnotationInstanceProvider provider = new AnnotationInstanceProvider();
        final Annotation cdiScopeAnnotation = provider.get(cdiScope, Collections.EMPTY_MAP);

        AnnotatedTypeBuilder builder;
        builder = new AnnotatedTypeBuilder()
                .readFromType(type)
                .removeFromClass(jsfScope)
View Full Code Here

    public void testPopulateAssignedKey() throws Exception {
        final AnnotationData data = new AnnotationData();

        Class expected;
        String method;
        Annotation annotation;

        // Falls outside the set that assigns a key
        expected = InvalidateSingleCache.class;
        method = "populateAssign01";
        annotation = new Mirror().on(AnnotationDataDummy.class).reflect()
View Full Code Here

    public void testPopulateNamespace() throws Exception {
        final AnnotationData data = new AnnotationData();

        Class expected;
        String method;
        Annotation annotation;

        // Default Namespace
        expected = InvalidateAssignCache.class;
        method = "populateNamespace01";
        annotation = new Mirror().on(AnnotationDataDummy.class).reflect()
View Full Code Here

    public void testPopulateExpiration() throws Exception {
        final AnnotationData data = new AnnotationData();

        Class expected;
        String method;
        Annotation annotation;

        // Excluded from having an Expiration
        expected = InvalidateAssignCache.class;
        method = "populateExpiration01";
        annotation = new Mirror().on(AnnotationDataDummy.class).reflect()
View Full Code Here

TOP

Related Classes of java.lang.annotation.Annotation

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.