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

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


 
  private static Annotation makeSingleStringMemberAnnotation(char[][] name, int pos, String annValue) {
    long[] positions = new long[name.length];
    for (int i = 0; i < positions.length; i++) positions[i] = pos;
    TypeReference annType = new QualifiedTypeReference(name,positions);
    NormalAnnotation ann = new NormalAnnotation(annType,pos);
    Expression valueExpr = new StringLiteral(annValue.toCharArray(),pos,pos,1);
    MemberValuePair[] mvps = new MemberValuePair[1];
    mvps[0] = new MemberValuePair(value,pos,pos,valueExpr);
    ann.memberValuePairs = mvps;
    return ann;   
View Full Code Here


        location[1] = sv.sourceEnd;
        return new String(sv.source());
      }
    }
    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)) {
        if (mvps[i].value instanceof StringLiteral) {
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);
      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);
    MemberValuePair[] mvps = new MemberValuePair[2];
    mvps[0] = new MemberValuePair("value".toCharArray(),pos,pos,pcExpr);
    Expression argNamesExpr = new StringLiteral(argNames.toCharArray(),pos,pos);
    mvps[1] = new MemberValuePair("argNames".toCharArray(),pos,pos,argNamesExpr);
View Full Code Here

  public static Annotation createAfterAnnotation(String pointcutExpression, String argNames, int pos) {
    char[][] typeName = new char[][] {org,aspectj,lang,annotation,after};
    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);
    MemberValuePair[] mvps = new MemberValuePair[2];
    mvps[0] = new MemberValuePair("value".toCharArray(),pos,pos,pcExpr);
    Expression argNamesExpr = new StringLiteral(argNames.toCharArray(),pos,pos);
    mvps[1] = new MemberValuePair("argNames".toCharArray(),pos,pos,argNamesExpr);
View Full Code Here

  public static Annotation createAfterReturningAnnotation(String pointcutExpression,  String argNames, String extraArgumentName, int pos) {
    char[][] typeName = new char[][] {org,aspectj,lang,annotation,afterReturning};
    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);
    MemberValuePair[] mvps = new MemberValuePair[3];
    mvps[0] = new MemberValuePair("pointcut".toCharArray(),pos,pos,pcExpr);
    Expression argExpr = new StringLiteral(extraArgumentName.toCharArray(),pos,pos);
    mvps[1] = new MemberValuePair("returning".toCharArray(),pos,pos,argExpr);
View Full Code Here

  public static Annotation createAfterThrowingAnnotation(String pointcutExpression, String argNames, String extraArgumentName, int pos) {
    char[][] typeName = new char[][] {org,aspectj,lang,annotation,afterThrowing};
    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);
    MemberValuePair[] mvps = new MemberValuePair[3];
    mvps[0] = new MemberValuePair("pointcut".toCharArray(),pos,pos,pcExpr);
    Expression argExpr = new StringLiteral(extraArgumentName.toCharArray(),pos,pos);
    mvps[1] = new MemberValuePair("throwing".toCharArray(),pos,pos,argExpr);
View Full Code Here

  public static Annotation createAroundAnnotation(String pointcutExpression, String argNames, int pos) {
    char[][] typeName = new char[][] {org,aspectj,lang,annotation,around};
    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);
    MemberValuePair[] mvps = new MemberValuePair[2];
    mvps[0] = new MemberValuePair("value".toCharArray(),pos,pos,pcExpr);
    Expression argNamesExpr = new StringLiteral(argNames.toCharArray(),pos,pos);
    mvps[1] = new MemberValuePair("argNames".toCharArray(),pos,pos,argNamesExpr);
View Full Code Here

  public static Annotation createPointcutAnnotation(String pointcutExpression, String argNames, int pos) {
    char[][] typeName = new char[][] {org,aspectj,lang,annotation,pointcut};
    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);
    MemberValuePair[] mvps = new MemberValuePair[2];
    mvps[0] = new MemberValuePair("value".toCharArray(),pos,pos,pcExpr);
    Expression argExpr = new StringLiteral(argNames.toCharArray(),pos,pos);
    mvps[1] = new MemberValuePair("argNames".toCharArray(),pos,pos,argExpr);
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.