Examples of AnnotationParser


Examples of org.apache.aries.transaction.parsing.AnnotationParser

        helper = Skeleton.newMock(TxComponentMetaDataHelper.class);
        Skeleton.getSkeleton(helper).setReturnValue(new MethodCall(TxComponentMetaDataHelper.class,
          "getComponentMethodTxAttribute", ComponentMetadata.class, String.class), null);
        cdr = Skeleton.newMock(ComponentDefinitionRegistry.class);
        i = Skeleton.newMock(Interceptor.class);
        parser = new AnnotationParser(cdr, i, helper);
  }
View Full Code Here

Examples of org.apache.aries.transaction.parsing.AnnotationParser

     
     
      PassThroughMetadata pmd = (PassThroughMetadata) cdr.getComponentDefinition(Constants.ANNOTATION_PARSER_BEAN_NAME);
      assertNotNull(pmd);
     
      AnnotationParser parser  = (AnnotationParser) pmd.getObject();
      parser.beforeInit(new AnnotatedPojo(), "top", null, compTop);
     
      assertEquals("Required", txenhancer.getComponentMethodTxAttribute(compTop, "increment"));
      assertEquals(1, cdr.getInterceptors(compTop).size());
    }
View Full Code Here

Examples of org.apache.felix.ipojo.manipulator.metadata.annotation.model.parser.AnnotationParser

            m_reporter.trace("Could not read bytecode for @%s because the bundle is not in a state allowing read " +
                            "operations.",
                    type.getClassName());
            return emptyList();
        }
        AnnotationParser parser = new AnnotationParser();
        AnnotationType annotationType = parser.read(bytes);

        // Search meta-annotations
        ChainedAnnotationDiscovery chain = new ChainedAnnotationDiscovery();
        StereotypeDiscovery stereotypeDiscovery = new StereotypeDiscovery();
        HandlerBindingDiscovery handlerBindingDiscovery = new HandlerBindingDiscovery();
View Full Code Here

Examples of org.codehaus.aspectwerkz.annotation.expression.ast.AnnotationParser

*/
public class Main {
    public static final int CONSTANT = 98;

    public static void main(String[] args) throws Throwable {
        AnnotationParser parser = new AnnotationParser(System.in); // can be only one
        Annotation annotation = new Annotation();

        //        AnnotationVisitor.parse(annotation, parser.parse("@Annotation(hex=0xCAFEBABE)"));
        //        AnnotationVisitor.parse(annotation, parser.parse("@Annotation(cArr={java.lang.String.class, int.class, double[].class})"));
        AnnotationVisitor.parse(annotation, parser.parse("@Annotation(lng=3)"));
        AnnotationVisitor.parse(annotation, parser.parse("@Annotation(lng=33598476398762L)"));
        AnnotationVisitor.parse(annotation, parser.parse("@Annotation(lng=-33598476398762L)"));
        AnnotationVisitor.parse(annotation, parser.parse("@Annotation(flt=33.345F)"));
        AnnotationVisitor.parse(annotation, parser.parse("@Annotation(flt=-33.345f)"));
        AnnotationVisitor.parse(annotation, parser.parse("@Annotation(dbl=33.345d)"));
        AnnotationVisitor.parse(annotation, parser.parse("@Annotation(dbl=-33.345d)"));
        AnnotationVisitor.parse(annotation, parser.parse("@Annotation(\"value\")"));
        AnnotationVisitor.parse(annotation, parser.parse("@Annotation(key=true)"));
        AnnotationVisitor.parse(
                annotation,
                parser.parse(
                        "@Annotation(constant=org.codehaus.aspectwerkz.annotation.expression.Main.CONSTANT lng=54543 flt=76.7F key=FALSE)"
                )
        );
        AnnotationVisitor.parse(annotation, parser.parse("@Annotation(sArr={\"hej\", \"hey\"})"));
        AnnotationVisitor.parse(annotation, parser.parse("@Annotation(bArr={TRUE, false})"));
        AnnotationVisitor.parse(annotation, parser.parse("@Annotation(klass=java.lang.String.class)"));
        AnnotationVisitor.parse(
                annotation,
                parser.parse("@Annotation(cArr={java.lang.String.class, int.class, double.class})")
        );

        //        DumpVisitor.dumpAST(parser.parse("@Annotation(level=3)"));
        //        DumpVisitor.dumpAST(parser.parse("@Annotation(level=0xCAFEBABE)"));
        //        DumpVisitor.dumpAST(parser.parse("@Annotation(level=33598476398762L)"));
View Full Code Here

Examples of org.eclipse.jetty.annotations.AnnotationParser

  @Before
  public void setUp() throws Exception
  {
    _context = new SipAppContext();
    _parser = new AnnotationParser();
    _handler = new SipApplicationKeyAnnotationHandler(_context);
        _parser.registerAnnotationHandler("javax.servlet.sip.annotation.SipApplicationKey",
            _handler);
  }
View Full Code Here

Examples of org.eclipse.jetty.annotations.AnnotationParser

  @Before
  public void setUp() throws Exception
  {
    _sac = new SipAppContext();
    _parser = new AnnotationParser();
        _parser.registerAnnotationHandler("javax.servlet.sip.annotation.SipServlet",
            new SipServletAnnotationHandler(_sac));
  }
View Full Code Here

Examples of org.eclipse.jetty.annotations.AnnotationParser

    @Override
    public void configure(WebAppContext context) throws Exception
    {
      context.addDecorator(new AnnotationDecorator(context));
      
        AnnotationParser parser = new AnnotationParser();

        SipAppContext sac = (SipAppContext) context;
        if (sac.getSpecVersion() == SipAppContext.VERSION_10)
          return;
       
        if (Log.isDebugEnabled())
          Log.debug("parsing annotations");
       
        SipApplicationAnnotationHandler sipApplicationAnnotationHandler = new SipApplicationAnnotationHandler(sac);
        parser.registerAnnotationHandler("javax.servlet.sip.annotation.SipApplication", sipApplicationAnnotationHandler);
        parser.registerAnnotationHandler("javax.servlet.sip.annotation.SipApplicationKey", new SipApplicationKeyAnnotationHandler(sac));
        parser.registerAnnotationHandler("javax.servlet.sip.annotation.SipListener", new SipListenerAnnotationHandler(sac));
        parser.registerAnnotationHandler("javax.servlet.sip.annotation.SipServlet", new SipServletAnnotationHandler(sac));
               

        clearAnnotationList(parser.getAnnotationHandlers());
        parseContainerPath(context, parser);
        parseWebInfLib (context, parser);
        parseWebInfClasses(context, parser);
       
        //gather together all annotations discovered
        List<DiscoveredAnnotation> annotations = new ArrayList<DiscoveredAnnotation>();
        gatherAnnotations(annotations, parser.getAnnotationHandlers());
        ((SipAppContext) context).getSipMetaData().addDiscoveredAnnotations (annotations);
       
     }
View Full Code Here

Examples of org.jboss.annotation.factory.ast.AnnotationParser

                  expr = StringPropertyReplacer.replaceProperties(annotationExpr, properties);
               else if (replace != null && replace)
                  expr = StringPropertyReplacer.replaceProperties(annotationExpr);
               else
                  expr = annotationExpr;
               AnnotationParser parser = new AnnotationParser(new StringReader(expr));
               ASTStart start = parser.Start();
               return (ASTAnnotation)start.jjtGetChild(0);
            }
         });
      }
      catch (PrivilegedActionException e)
View Full Code Here

Examples of org.jboss.annotation.factory.ast.AnnotationParser

      {
         if (AspectManager.verbose && logger.isTraceEnabled())
         {
            logger.trace("Creating annotation from " + originalAnnotationExpr);
         }
         AnnotationParser parser = new AnnotationParser(new StringReader(originalAnnotationExpr));
         org.jboss.annotation.factory.ast.ASTStart start = parser.Start();
         annotation = (ASTAnnotation) start.jjtGetChild(0);
      }
      catch (ParseException e)
      {
         throw new RuntimeException(annotationExpr, e)//To change body of catch statement use Options | File Templates.
      }
      try
      {
         TypeExpressionParser parser = new TypeExpressionParser(new StringReader(expr));
         target = parser.Start();
      }
      catch (org.jboss.aop.pointcut.ast.ParseException e)
      {
         throw new RuntimeException(expr, e)//To change body of catch statement use Options | File Templates.
      }
View Full Code Here

Examples of org.jboss.annotation.factory.ast.AnnotationParser

         return AccessController.doPrivileged(new PrivilegedExceptionAction<ASTAnnotation>()
         {
           public ASTAnnotation run() throws Exception
           {
              AnnotationParser parser = new AnnotationParser(new StringReader(annotationExpr));
              ASTStart start = parser.Start();
              return (ASTAnnotation) start.jjtGetChild(0);
           }
         });
      }
      catch (PrivilegedActionException e)
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.