Package org.aspectj.weaver.patterns

Examples of org.aspectj.weaver.patterns.FormalBinding


    if (formalParameters == null) {
      formalParameters = new PointcutParameter[0];
    }
    FormalBinding[] formalBindings = new FormalBinding[formalParameters.length];
    for (int i = 0; i < formalBindings.length; i++) {
      formalBindings[i] = new FormalBinding(toUnresolvedType(formalParameters[i].getType()), formalParameters[i].getName(), i);
    }
    if (inScope == null) {
      return new SimpleScope(getWorld(), formalBindings);
    } else {
      ResolvedType inType = getWorld().resolve(inScope.getName());
View Full Code Here


          || AjcMemberMaker.TYPEX_ENCLOSINGSTATICJOINPOINT.equals(argumentType) || AjcMemberMaker.AROUND_CLOSURE_TYPE
          .equals(argumentType))) {
        // continue;// skip
        bindings.add(new FormalBinding.ImplicitFormalBinding(argumentType, argumentName, i));
      } else {
        bindings.add(new FormalBinding(argumentType, argumentName, i));
      }
    }

    return bindings.toArray(new FormalBinding[] {});
  }
View Full Code Here

  private static FormalBinding[] extractBindings(AjAttributeMethodStruct struct, String excludeFormal)
      throws UnreadableDebugInfoException {
    FormalBinding[] bindings = extractBindings(struct);
    // int excludeIndex = -1;
    for (int i = 0; i < bindings.length; i++) {
      FormalBinding binding = bindings[i];
      if (binding.getName().equals(excludeFormal)) {
        // excludeIndex = i;
        bindings[i] = new FormalBinding.ImplicitFormalBinding(binding.getType(), binding.getName(), binding.getIndex());
        break;
      }
    }
    return bindings;
    //
View Full Code Here

  private static void setIgnoreUnboundBindingNames(Pointcut pointcut, FormalBinding[] bindings) {
    // register ImplicitBindings as to be ignored since unbound
    // TODO is it likely to fail in a bad way if f.e. this(jp) etc ?
    List<String> ignores = new ArrayList<String>();
    for (int i = 0; i < bindings.length; i++) {
      FormalBinding formalBinding = bindings[i];
      if (formalBinding instanceof FormalBinding.ImplicitFormalBinding) {
        ignores.add(formalBinding.getName());
      }
    }
    pointcut.m_ignoreUnboundBindingForNames = ignores.toArray(new String[ignores.size()]);
  }
View Full Code Here

        // now, we resolve
        UnresolvedType[] types = m.getParameterTypes();
        FormalBinding[] bindings = new FormalBinding[ids.length];
        for (int j = 0, len = ids.length; j < len; j++) {
            bindings[j] = new FormalBinding(types[j], ids[j], j, 0, 0, "fromString");
        }

        Pointcut p =
          pointcut.resolve(new SimpleScope(this, bindings));
View Full Code Here

   
    private IScope buildResolutionScope(Class inScope, PointcutParameter[] formalParameters) {
      if (formalParameters == null) formalParameters = new PointcutParameter[0];
      FormalBinding[] formalBindings = new FormalBinding[formalParameters.length];
      for (int i = 0; i < formalBindings.length; i++) {
      formalBindings[i] = new FormalBinding(UnresolvedType.forName(formalParameters[i].getType().getName()),formalParameters[i].getName(),i);     
    }
      if (inScope == null) {
        return new SimpleScope(getWorld(),formalBindings);
      } else {
        ResolvedType inType = getWorld().resolve(inScope.getName());
View Full Code Here

        FormalBinding[] bindings = new FormalBinding[baseArgumentCount];
        for (int i = 0, len = baseArgumentCount; i < len; i++) {
            Argument arg = arguments[i];
            String name = new String(arg.name);
            UnresolvedType type = world.fromBinding(parameters[i]);
            bindings[i] = new FormalBinding(type, name, i, arg.sourceStart, arg.sourceEnd, "unknown");
        }
       
        EclipseScope scope = new EclipseScope(bindings, dec.scope);

        pointcut = pointcut.resolve(scope);
View Full Code Here

         CharOperation.equals(joinPointEnclosingStaticPart,argTypeBinding.signature()) ||
         CharOperation.equals(proceedingJoinPoint,argTypeBinding.signature()) ||
         name.equals(extraArgName)) {
        ret[i] = new FormalBinding.ImplicitFormalBinding(type,name,i);
      } else {
              ret[i] = new FormalBinding(type, name, i, arg.sourceStart, arg.sourceEnd, "unknown");           
      }
    }
    return ret;
  }
View Full Code Here

                    || AjcMemberMaker.TYPEX_ENCLOSINGSTATICJOINPOINT.equals(argumentType)
                    || AjcMemberMaker.AROUND_CLOSURE_TYPE.equals(argumentType))) {
                //continue;// skip
                bindings.add(new FormalBinding.ImplicitFormalBinding(argumentType, argumentName, i));
            } else {
                bindings.add(new FormalBinding(argumentType, argumentName, i));
            }
        }

        return (FormalBinding[]) bindings.toArray(new FormalBinding[]{});
    }
View Full Code Here

    private static FormalBinding[] extractBindings(AjAttributeMethodStruct struct, String excludeFormal)
            throws UnreadableDebugInfoException {
        FormalBinding[] bindings = extractBindings(struct);
        int excludeIndex = -1;
        for (int i = 0; i < bindings.length; i++) {
            FormalBinding binding = bindings[i];
            if (binding.getName().equals(excludeFormal)) {
                excludeIndex = i;
                bindings[i] = new FormalBinding.ImplicitFormalBinding(
                        binding.getType(), binding.getName(), binding.getIndex()
                );
                break;
            }
        }
        return bindings;
View Full Code Here

TOP

Related Classes of org.aspectj.weaver.patterns.FormalBinding

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.