Package org.aspectj.weaver.internal.tools

Examples of org.aspectj.weaver.internal.tools.PointcutExpressionImpl


   *         supported by this PointcutParser.
   * @throws IllegalArgumentException if the expression is not a well-formed pointcut expression
   */
  public PointcutExpression parsePointcutExpression(String expression, Class inScope, PointcutParameter[] formalParameters)
      throws UnsupportedPointcutPrimitiveException, IllegalArgumentException {
    PointcutExpressionImpl pcExpr = null;
    try {
      Pointcut pc = resolvePointcutExpression(expression, inScope, formalParameters);
      pc = concretizePointcutExpression(pc, inScope, formalParameters);
      validateAgainstSupportedPrimitives(pc, expression); // again, because we have now followed any ref'd pcuts
      pcExpr = new PointcutExpressionImpl(pc, expression, formalParameters, getWorld());
    } catch (ParserException pEx) {
      throw new IllegalArgumentException(buildUserMessageFromParserException(expression, pEx));
    } catch (ReflectionWorld.ReflectionWorldException rwEx) {
      throw new IllegalArgumentException(rwEx.getMessage());
    }
View Full Code Here


        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());
        }
        pointcuts[i] = new ResolvedPointcutDefinition(getResolvedTypeX(),pcs[i].getModifiers(),pcs[i].getName(),weaverPTypes,pc);
View Full Code Here

    public PointcutExpression parsePointcutExpression(
        String expression,
        Class inScope,
        PointcutParameter[] formalParameters)
    throws UnsupportedPointcutPrimitiveException, IllegalArgumentException {
       PointcutExpressionImpl pcExpr = null;
         try {
           PatternParser parser = new PatternParser(expression);
           parser.setPointcutDesignatorHandlers(pointcutDesignators, world);
             Pointcut pc = parser.parsePointcut();
             validateAgainstSupportedPrimitives(pc,expression);
             IScope resolutionScope = buildResolutionScope((inScope == null ? Object.class : inScope),formalParameters);
             pc = pc.resolve(resolutionScope);
             ResolvedType declaringTypeForResolution = null;
             if (inScope != null) {
               declaringTypeForResolution = getWorld().resolve(inScope.getName());
             } else {
               declaringTypeForResolution = ResolvedType.OBJECT.resolve(getWorld());
             }
             IntMap arity = new IntMap(formalParameters.length);
             for (int i = 0; i < formalParameters.length; i++) {
               arity.put(i, i);
             }            
             pc = pc.concretize(declaringTypeForResolution, declaringTypeForResolution, arity);
             validateAgainstSupportedPrimitives(pc,expression); // again, because we have now followed any ref'd pcuts
             pcExpr = new PointcutExpressionImpl(pc,expression,formalParameters,getWorld());
         } catch (ParserException pEx) {
             throw new IllegalArgumentException(buildUserMessageFromParserException(expression,pEx));
         } catch (ReflectionWorld.ReflectionWorldException rwEx) {
             throw new IllegalArgumentException(rwEx.getMessage());
         }
View Full Code Here

TOP

Related Classes of org.aspectj.weaver.internal.tools.PointcutExpressionImpl

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.