Package org.aspectj.weaver.patterns

Examples of org.aspectj.weaver.patterns.Pointcut.resolve()


           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());
View Full Code Here


    try {
      if (perClause != null && !perClause.equals("")) {
        ISourceContext context = new EclipseSourceContext(unit.compilationResult,pcLoc[0]);
        Pointcut pc = new PatternParser(perClause,context).maybeParsePerClause();
          FormalBinding[] bindings = new FormalBinding[0];
        if (pc != null) pc.resolve(new EclipseScope(bindings,typeDecl.scope));
      }
    } catch(ParserException pEx) {
      typeDecl.scope.problemReporter().parseError(
          pcLoc[0] + pEx.getLocation().getStart(),
          pcLoc[0] + pEx.getLocation().getEnd() ,
View Full Code Here

    if (pointcutExpression == null) pointcutExpression = getStringLiteralFor("value",adviceAnn,pcLocation);
    try {
      ISourceContext context = new EclipseSourceContext(unit.compilationResult,pcLocation[0]);
      Pointcut pc = new PatternParser(pointcutExpression,context).parsePointcut();
      FormalBinding[] bindings = buildFormalAdviceBindingsFrom(methodDeclaration);
      pc.resolve(new EclipseScope(bindings,methodDeclaration.scope));
      EclipseFactory factory = EclipseFactory.fromScopeLookupEnvironment(methodDeclaration.scope);
      // now create a ResolvedPointcutDefinition,make an attribute out of it, and add it to the method
      UnresolvedType[] paramTypes = new UnresolvedType[bindings.length];
      for (int i = 0; i < paramTypes.length; i++) paramTypes[i] = bindings[i].getType();
      ResolvedPointcutDefinition resPcutDef =
View Full Code Here

//              bindings[i] = new FormalBinding(type, name, i, arg.sourceStart, arg.sourceEnd, "unknown");
//          }
      swap(onType,methodDeclaration,pcDecl);
      if (pc != null) {
                // has an expression
                pc.resolve(new EclipseScope(bindings,methodDeclaration.scope));
                HasIfPCDVisitor ifFinder = new HasIfPCDVisitor();
                pc.traverse(ifFinder, null);
                containsIfPcd = ifFinder.containsIfPcd;
            }
        } catch(ParserException pEx) {
View Full Code Here

                    pc = preResolvedPointcut.getPointcut();
                    //pc.resolve(binding);
                } else {
                    pc = parsePointcut(beforeAdvice.getValue().stringifyValue(), struct, false);
                    if (pc == null) return false;//parse error
                    pc = pc.resolve(binding);
                }
                setIgnoreUnboundBindingNames(pc, bindings);

                ISourceLocation sl = struct.context.makeSourceLocation(struct.bMethod.getDeclarationLineNumber(), struct.bMethod.getDeclarationOffset());
                struct.ajAttributes.add(
View Full Code Here

                if (preResolvedPointcut != null) {
                    pc = preResolvedPointcut.getPointcut();
                } else {
                    pc = parsePointcut(afterAdvice.getValue().stringifyValue(), struct, false);
                    if (pc == null) return false;//parse error
                    pc.resolve(binding);
                }
                setIgnoreUnboundBindingNames(pc, bindings);

                ISourceLocation sl = struct.context.makeSourceLocation(struct.bMethod.getDeclarationLineNumber(), struct.bMethod.getDeclarationOffset());
                struct.ajAttributes.add(
View Full Code Here

            if (preResolvedPointcut != null) {
                pc = preResolvedPointcut.getPointcut();
            } else {
                pc = parsePointcut(pointcut, struct, false);
                if (pc == null) return false;//parse error
                pc.resolve(binding);
            }
            setIgnoreUnboundBindingNames(pc, bindings);

            ISourceLocation sl = struct.context.makeSourceLocation(struct.bMethod.getDeclarationLineNumber(), struct.bMethod.getDeclarationOffset());
            struct.ajAttributes.add(
View Full Code Here

            if (preResolvedPointcut != null) {
                pc = preResolvedPointcut.getPointcut();
            } else {
                pc = parsePointcut(pointcut, struct, false);
                if (pc == null) return false;//parse error
                pc.resolve(binding);
            }
            setIgnoreUnboundBindingNames(pc, bindings);

            ISourceLocation sl = struct.context.makeSourceLocation(struct.bMethod.getDeclarationLineNumber(), struct.bMethod.getDeclarationOffset());
            struct.ajAttributes.add(
View Full Code Here

                if (preResolvedPointcut != null) {
                    pc = preResolvedPointcut.getPointcut();
                } else {
                    pc = parsePointcut(aroundAdvice.getValue().stringifyValue(), struct, false);
                    if (pc == null) return false;//parse error
                    pc.resolve(binding);
                }
                setIgnoreUnboundBindingNames(pc, bindings);

                ISourceLocation sl = struct.context.makeSourceLocation(struct.bMethod.getDeclarationLineNumber(), struct.bMethod.getDeclarationOffset());
                struct.ajAttributes.add(
View Full Code Here

                );
                Pointcut pc = parsePointcut(declareError.getValue().stringifyValue(), struct, false);
                if (pc == null) {
                    hasError = false;//cannot parse pointcut
                } else {
                    pc .resolve(binding);
                    DeclareErrorOrWarning deow = new DeclareErrorOrWarning(true, pc, struct.field.getConstantValue().toString());
                    deow.setLocation(struct.context, -1, -1);
                    struct.ajAttributes.add(new AjAttribute.DeclareAttribute(deow));
                    hasError = true;
                }
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.