Examples of Var


Examples of org.aspectj.weaver.ast.Var

   * @see org.aspectj.weaver.Shadow#getKindedAnnotationVar(org.aspectj.weaver.UnresolvedType)
   */
  public Var getKindedAnnotationVar(UnresolvedType forAnnotationType) {
    ResolvedType annType = forAnnotationType.resolve(world);
    if (annotationVar.get(annType) == null) {
      Var v = ReflectionVar.createAtAnnotationVar(annType, this.annotationFinder);
      annotationVar.put(annType, v);
    }
    return (Var) annotationVar.get(annType);
  }
View Full Code Here

Examples of org.aspectj.weaver.ast.Var

   * @see org.aspectj.weaver.Shadow#getWithinAnnotationVar(org.aspectj.weaver.UnresolvedType)
   */
  public Var getWithinAnnotationVar(UnresolvedType forAnnotationType) {
    ResolvedType annType = forAnnotationType.resolve(world);
    if (withinAnnotationVar.get(annType) == null) {
      Var v = ReflectionVar.createWithinAnnotationVar(annType, this.annotationFinder);
      withinAnnotationVar.put(annType, v);
    }
    return (Var) withinAnnotationVar.get(annType);
  }
View Full Code Here

Examples of org.aspectj.weaver.ast.Var

   * @see org.aspectj.weaver.Shadow#getWithinCodeAnnotationVar(org.aspectj.weaver.UnresolvedType)
   */
  public Var getWithinCodeAnnotationVar(UnresolvedType forAnnotationType) {
    ResolvedType annType = forAnnotationType.resolve(world);
    if (withinCodeAnnotationVar.get(annType) == null) {
      Var v = ReflectionVar.createWithinCodeAnnotationVar(annType, this.annotationFinder);
      withinCodeAnnotationVar.put(annType, v);
    }
    return (Var) withinCodeAnnotationVar.get(annType);
  }
View Full Code Here

Examples of org.aspectj.weaver.ast.Var

    if (!hasThis()) {
      throw new IllegalStateException("no this");
    }
    initializeThisAnnotationVars(); // FIXME asc Why bother with this if we always return one?
    // Even if we can't find one, we have to return one as we might have this annotation at runtime
    Var v = thisAnnotationVars.get(forAnnotationType);
    if (v == null) {
      v = new TypeAnnotationAccessVar(forAnnotationType.resolve(world), (BcelVar) getThisVar());
    }
    return v;
  }
View Full Code Here

Examples of org.aspectj.weaver.ast.Var

  public Var getTargetAnnotationVar(UnresolvedType forAnnotationType) {
    if (!hasTarget()) {
      throw new IllegalStateException("no target");
    }
    initializeTargetAnnotationVars(); // FIXME asc why bother with this if we always return one?
    Var v = targetAnnotationVars.get(forAnnotationType);
    // Even if we can't find one, we have to return one as we might have this annotation at runtime
    if (v == null) {
      v = new TypeAnnotationAccessVar(forAnnotationType.resolve(world), (BcelVar) getTargetVar());
    }
    return v;
View Full Code Here

Examples of org.aspectj.weaver.ast.Var

  @Override
  public Var getArgAnnotationVar(int i, UnresolvedType forAnnotationType) {
    initializeArgAnnotationVars();

    Var v = (Var) argAnnotationVars[i].get(forAnnotationType);
    if (v == null) {
      v = new TypeAnnotationAccessVar(forAnnotationType.resolve(world), (BcelVar) getArgVar(i));
    }
    return v;
  }
View Full Code Here

Examples of org.aspectj.weaver.ast.Var

      BindingAnnotationFieldTypePattern btp = (BindingAnnotationFieldTypePattern) annotationTypePattern;
      ResolvedType formalType = btp.getFormalType().resolve(shadow.getIWorld());
      UnresolvedType annoType = btp.getAnnotationType();
      // TODO 2 need to sort out appropriate creation of the AnnotationAccessFieldVar - what happens for
      // reflective (ReflectionShadow) access to types?
      Var var = shadow.getKindedAnnotationVar(annoType);
      if (var == null) {
        throw new BCException("Unexpected problem locating annotation at join point '" + shadow + "'");
      }
      state.set(btp.getFormalIndex(), var.getAccessorForValue(formalType));
    } else if (annotationTypePattern instanceof BindingAnnotationTypePattern) {
      BindingAnnotationTypePattern btp = (BindingAnnotationTypePattern) annotationTypePattern;
      UnresolvedType annotationType = btp.getAnnotationType();
      Var var = shadow.getKindedAnnotationVar(annotationType);

      // At this point, var *could* be null. The only reason this could happen (if we aren't failing...)
      // is if another binding annotation designator elsewhere in the pointcut is going to expose the annotation
      // eg. (execution(* a*(..)) && @annotation(foo)) || (execution(* b*(..)) && @this(foo))
      // where sometimes @annotation will be providing the value, and sometimes
View Full Code Here

Examples of org.aspectj.weaver.ast.Var

          // in the call to residueSource.findResidue) to not be set (be null)
          // in an Or pointcut with if expressions in both branches, and where
          // one branch is known statically to not match. In this situation we
          // simply return Test.
          for (int i = 0; i < baseArgsCount; i++) {
            Var v = myState.get(i);
            if (v == null) {
              continue; // pr118149
            }
            args.add(v);
            ret = Test.makeAnd(ret, Test.makeInstanceof(v, pTypes[i].resolve(shadow.getIWorld())));
          }
        }

        // handle thisJoinPoint parameters
        if ((extraParameterFlags & Advice.ThisJoinPoint) != 0) {
          args.add(shadow.getThisJoinPointVar());
        }

        if ((extraParameterFlags & Advice.ThisJoinPointStaticPart) != 0) {
          args.add(shadow.getThisJoinPointStaticPartVar());
        }

        if ((extraParameterFlags & Advice.ThisEnclosingJoinPointStaticPart) != 0) {
          args.add(shadow.getThisEnclosingJoinPointStaticPartVar());
        }
      } else {
        // @style is slightly different
        int currentStateIndex = 0;
        // FIXME AV - "args(jp)" test(jp, thejp) will fail here
        for (int i = 0; i < testMethod.getParameterTypes().length; i++) {
          String argSignature = testMethod.getParameterTypes()[i].getSignature();
          if (AjcMemberMaker.TYPEX_JOINPOINT.getSignature().equals(argSignature)) {
            args.add(shadow.getThisJoinPointVar());
          } else if (AjcMemberMaker.TYPEX_PROCEEDINGJOINPOINT.getSignature().equals(argSignature)) {
            args.add(shadow.getThisJoinPointVar());
          } else if (AjcMemberMaker.TYPEX_STATICJOINPOINT.getSignature().equals(argSignature)) {
            args.add(shadow.getThisJoinPointStaticPartVar());
          } else if (AjcMemberMaker.TYPEX_ENCLOSINGSTATICJOINPOINT.getSignature().equals(argSignature)) {
            args.add(shadow.getThisEnclosingJoinPointStaticPartVar());
          } else {
            if (state.size() == 0 || currentStateIndex > state.size()) {
              String[] paramNames = testMethod.getParameterNames();
              StringBuffer errorParameter = new StringBuffer();
              if (paramNames != null) {
                errorParameter.append(testMethod.getParameterTypes()[i].getName()).append(" ");
                errorParameter.append(paramNames[i]);
                shadow.getIWorld().getMessageHandler().handleMessage(
                    MessageUtil.error("Missing binding for if() pointcut method.  Parameter " + (i + 1) + "("
                        + errorParameter.toString()
                        + ") must be bound - even in reference pointcuts  (compiler limitation)",
                        testMethod.getSourceLocation()));
              } else {
                shadow.getIWorld().getMessageHandler().handleMessage(
                    MessageUtil.error("Missing binding for if() pointcut method.  Parameter " + (i + 1)
                        + " must be bound - even in reference pointcuts (compiler limitation)", testMethod
                        .getSourceLocation()));
              }
              return Literal.TRUE; // exit quickly
            }
            // we don't use i as JoinPoint.* can be anywhere in the signature in @style
            Var v = state.get(currentStateIndex++);

            while (v == null && currentStateIndex < state.size()) { // pr162135
              v = state.get(currentStateIndex++);
            }
            args.add(v);
View Full Code Here

Examples of org.jboss.ws.tools.XSDTypeToJava.VAR

      List<VAR> vars = new ArrayList<VAR>();
      for (WrappedParameter wrapped : wrappedParameters)
      {
         String typeName = JavaUtils.convertJVMNameToSourceName(wrapped.getType(), classLoader);
         vars.add(new VAR(wrapped.getVariable(), typeName, false));
      }

      JavaWriter writer = new JavaWriter();
      writer.createJavaFile(new File(outDir), name + ".java", packageName, vars, null, null, false, false, null);
View Full Code Here

Examples of org.mizartools.dli.Var

      vid2.setId(vid.getId());
      for (org.mizartools.system.xml.Typ typ : fraenkel.getTypList()) {
        vid2.increment();
        Variable variable = new Variable(vid2.getId());
        Type type = getType(abstractSignature, typ);
        varList.add(new Var(variable, type));
      }
      Term term1 = getTerm(abstractSignature, fraenkel.getTerm(), vid2);
      termDli = new Fraenkel(varList, term1, getFormula(abstractSignature, fraenkel.getFormula(), vid2));
    } else throw new DliException();
    return termDli;
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.