Package org.aspectj.weaver.tools

Examples of org.aspectj.weaver.tools.PointcutParser


  /**
   * Build the underlying AspectJ pointcut expression.
   */
  private PointcutExpression buildPointcutExpression(ClassLoader classLoader) {
    PointcutParser parser = initializePointcutParser(classLoader);
    PointcutParameter[] pointcutParameters = new PointcutParameter[this.pointcutParameterNames.length];
    for (int i = 0; i < pointcutParameters.length; i++) {
      pointcutParameters[i] = parser.createPointcutParameter(
          this.pointcutParameterNames[i],
          this.pointcutParameterTypes[i]);
    }
    return parser.parsePointcutExpression(
        replaceBooleanOperators(getExpression()),
        this.pointcutDeclarationScope, pointcutParameters);
  }
View Full Code Here


  /**
   * Initialize the underlying AspectJ pointcut parser.
   */
  private PointcutParser initializePointcutParser(ClassLoader cl) {
    PointcutParser parser = PointcutParser
        .getPointcutParserSupportingSpecifiedPrimitivesAndUsingSpecifiedClassLoaderForResolution(
            SUPPORTED_PRIMITIVES, cl);
    parser.registerPointcutDesignatorHandler(new BeanNamePointcutDesignatorHandler());
    return parser;
  }
View Full Code Here

  /**
   * Build the underlying AspectJ pointcut expression.
   */
  private PointcutExpression buildPointcutExpression(ClassLoader classLoader) {
    PointcutParser parser = initializePointcutParser(classLoader);
    PointcutParameter[] pointcutParameters = new PointcutParameter[this.pointcutParameterNames.length];
    for (int i = 0; i < pointcutParameters.length; i++) {
      pointcutParameters[i] = parser.createPointcutParameter(
          this.pointcutParameterNames[i], this.pointcutParameterTypes[i]);
    }
    return parser.parsePointcutExpression(
        replaceBooleanOperators(getExpression()),
        this.pointcutDeclarationScope, pointcutParameters);
  }
View Full Code Here

  /**
   * Initialize the underlying AspectJ pointcut parser.
   */
  private PointcutParser initializePointcutParser(ClassLoader cl) {
    PointcutParser parser = PointcutParser
        .getPointcutParserSupportingSpecifiedPrimitivesAndUsingSpecifiedClassLoaderForResolution(
            SUPPORTED_PRIMITIVES, cl);
    parser.registerPointcutDesignatorHandler(new BeanNamePointcutDesignatorHandler());
    return parser;
  }
View Full Code Here

  public ResolvedMember[] getDeclaredPointcuts() {
    if (pointcuts == null) {
      Pointcut[] pcs = this.myType.getDeclaredPointcuts();
      pointcuts = new ResolvedMember[pcs.length];
      PointcutParser parser = PointcutParser.getPointcutParserSupportingAllPrimitivesAndUsingSpecifiedClassloaderForResolution(classLoader);
      for (int i = 0; i < pcs.length; i++) {
        AjType<?>[] ptypes = pcs[i].getParameterTypes();
        String[] pnames = pcs[i].getParameterNames();
        if (pnames.length != ptypes.length) {
          throw new IllegalStateException("Required parameter names not available when parsing pointcut " + pcs[i].getName() + " in type " + getResolvedTypeX().getName());
        }
        PointcutParameter[] parameters = new PointcutParameter[ptypes.length];
        for (int j = 0; j < parameters.length; j++) {
          parameters[j] = parser.createPointcutParameter(pnames[j],ptypes[j].getJavaClass());
        }
        String pcExpr = pcs[i].getPointcutExpression().toString();
        PointcutExpressionImpl pEx = (PointcutExpressionImpl) parser.parsePointcutExpression(pcExpr,getBaseClass(),parameters);
        org.aspectj.weaver.patterns.Pointcut pc = pEx.getUnderlyingPointcut();
        UnresolvedType[] weaverPTypes = new UnresolvedType[ptypes.length];
        for (int j = 0; j < weaverPTypes.length; j++) {
          weaverPTypes[j] = UnresolvedType.forName(ptypes[j].getName());
        }
View Full Code Here

TOP

Related Classes of org.aspectj.weaver.tools.PointcutParser

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.