Package org.aspectj.org.eclipse.jdt.internal.compiler.ast

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.ast.NormalAnnotation


    }
    final int typeIndex = constantPool.literalIndex(annotationTypeBinding.signature());
    contents[contentsOffset++] = (byte) (typeIndex >> 8);
    contents[contentsOffset++] = (byte) typeIndex;
    if (annotation instanceof NormalAnnotation) {
      NormalAnnotation normalAnnotation = (NormalAnnotation) annotation;
      MemberValuePair[] memberValuePairs = normalAnnotation.memberValuePairs;
      if (memberValuePairs != null) {
        final int memberValuePairsLength = memberValuePairs.length;
        contents[contentsOffset++] = (byte) (memberValuePairsLength >> 8);
        contents[contentsOffset++] = (byte) memberValuePairsLength;
View Full Code Here


   * @param annotation eclipse based annotation representation
   * @param annotationAJ AspectJ based annotation representation
   */
  private void generateAnnotation(Annotation annotation, StandardAnnotation annotationAJ) {
    if (annotation instanceof NormalAnnotation) {
      NormalAnnotation normalAnnotation = (NormalAnnotation) annotation;
      MemberValuePair[] memberValuePairs = normalAnnotation.memberValuePairs;
      if (memberValuePairs != null) {
        int memberValuePairsLength = memberValuePairs.length;
        for (int i = 0; i < memberValuePairsLength; i++) {
          MemberValuePair memberValuePair = memberValuePairs[i];
View Full Code Here

          // by
          // the
          // visitor
          // !
          // it is an @Aspect(...something...)
          NormalAnnotation theAnnotation = (NormalAnnotation) annotation;
          if (theAnnotation.memberValuePairs == null || theAnnotation.memberValuePairs.length < 1) {
            return PerClause.SINGLETON;
          }
          String clause = new String(((StringLiteral) theAnnotation.memberValuePairs[0].value).source());// TODO
          // cast
View Full Code Here

    }
  }

  private static void generateAnnotation(Annotation annotation, StandardAnnotation annotationAJ) {
    if (annotation instanceof NormalAnnotation) {
      NormalAnnotation normalAnnotation = (NormalAnnotation) annotation;
      MemberValuePair[] memberValuePairs = normalAnnotation.memberValuePairs;
      if (memberValuePairs != null) {
        int memberValuePairsLength = memberValuePairs.length;
        for (int i = 0; i < memberValuePairsLength; i++) {
          MemberValuePair memberValuePair = memberValuePairs[i];
View Full Code Here

    long[] positions = new long[typeName.length];
    for (int i = 0; i < positions.length; i++) {
      positions[i] = pos;
    }
    TypeReference annType = new QualifiedTypeReference(typeName, positions);
    NormalAnnotation ann = new NormalAnnotation(annType, pos);
    ann.resolvedType = tb; // yuck - is this OK in all cases?
    // We don't need membervalues...
    // Expression pcExpr = new
    // StringLiteral(pointcutExpression.toCharArray(),pos,pos);
    // MemberValuePair[] mvps = new MemberValuePair[2];
View Full Code Here

  /**
   * Create a copy of an annotation, not deep but deep enough so we don't copy across fields that will get us into trouble like
   * 'recipient'
   */
  private static Annotation createAnnotationCopy(Annotation ann) {
    NormalAnnotation ann2 = new NormalAnnotation(ann.type, ann.sourceStart);
    ann2.memberValuePairs = ann.memberValuePairs();
    ann2.resolvedType = ann.resolvedType;
    ann2.bits = ann.bits;
    return ann2;
    // String name = annX.getTypeName();
View Full Code Here

        return c.stringValue();
      }
    }
    if (!(inAnnotation instanceof NormalAnnotation))
      return null;
    NormalAnnotation ann = (NormalAnnotation) inAnnotation;
    MemberValuePair[] mvps = ann.memberValuePairs;
    if (mvps == null)
      return null;
    for (int i = 0; i < mvps.length; i++) {
      if (CharOperation.equals(memberName.toCharArray(), mvps[i].name)) {
View Full Code Here

   */
  public static Annotation createAspectAnnotation(String perclause, int pos) {
    char[][] typeName = new char[][] {org,aspectj,lang,annotation,aspect};
    long[] positions = new long[] {pos,pos,pos,pos,pos};
    TypeReference orgAspectJLangAnnotationAspect = new QualifiedTypeReference(typeName,positions);
    NormalAnnotation atAspectAnnotation = new NormalAnnotation(orgAspectJLangAnnotationAspect,pos);
    if (!perclause.equals("")) {
      // we have to set the value
      Expression perclauseExpr = new StringLiteral(perclause.toCharArray(),pos,pos,1);
      MemberValuePair[] mvps = new MemberValuePair[1];
      mvps[0] = new MemberValuePair(value,pos,pos,perclauseExpr);
View Full Code Here

 
  public static Annotation createPrivilegedAnnotation(int pos) {
    char[][] typeName = new char[][] {org,aspectj,internal,lang,annotation,privileged};
    long[] positions = new long[] {pos,pos,pos,pos,pos,pos};
    TypeReference annType = new QualifiedTypeReference(typeName,positions);
    NormalAnnotation ann = new NormalAnnotation(annType,pos);
    return ann;
  }
View Full Code Here

  public static Annotation createBeforeAnnotation(String pointcutExpression, String argNames, int pos) {
    char[][] typeName = new char[][] {org,aspectj,lang,annotation,before};
    long[] positions = new long[] {pos,pos,pos,pos,pos};
    TypeReference annType = new QualifiedTypeReference(typeName,positions);
    NormalAnnotation ann = new NormalAnnotation(annType,pos);
    Expression pcExpr = new StringLiteral(pointcutExpression.toCharArray(),pos,pos,1);
    MemberValuePair[] mvps = new MemberValuePair[2];
    mvps[0] = new MemberValuePair("value".toCharArray(),pos,pos,pcExpr);
    Expression argNamesExpr = new StringLiteral(argNames.toCharArray(),pos,pos,1);
    mvps[1] = new MemberValuePair("argNames".toCharArray(),pos,pos,argNamesExpr);
View Full Code Here

TOP

Related Classes of org.aspectj.org.eclipse.jdt.internal.compiler.ast.NormalAnnotation

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.