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

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


  public static Annotation createDeclareErrorOrWarningAnnotation(String pointcutExpression, String message, boolean isError, int pos) {
    char[][] typeName = new char[][] {org,aspectj,internal,lang,annotation,declareErrorOrWarning};
    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);
    Expression pcutExpr = new StringLiteral(pointcutExpression.toCharArray(),pos,pos);
    Expression msgExpr = new StringLiteral(message.toCharArray(),pos,pos);
    Expression isErrorExpr;
    if (isError) {
      isErrorExpr = new TrueLiteral(pos,pos);
View Full Code Here


  public static Annotation createDeclareParentsAnnotation(String childPattern, String parentPatterns, boolean isExtends, int pos) {
    char[][] typeName = new char[][] {org,aspectj,internal,lang,annotation,declareParents};
    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);
    Expression targetExpression = new StringLiteral(childPattern.toCharArray(),pos,pos);
    Expression parentsExpression = new StringLiteral(parentPatterns.toCharArray(),pos,pos);
    Expression isExtendsExpression;
    if (isExtends) {
      isExtendsExpression = new TrueLiteral(pos,pos);
View Full Code Here

  public static Annotation createDeclareSoftAnnotation(String pointcutExpression, String exceptionType, int pos) {
    char[][] typeName = new char[][] {org,aspectj,internal,lang,annotation,declareSoft};
    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);
    Expression pcutExpr = new StringLiteral(pointcutExpression.toCharArray(),pos,pos);
    Expression exExpr = new StringLiteral(exceptionType.toCharArray(),pos,pos);
    MemberValuePair[] mvps = new MemberValuePair[2];
    mvps[0] = new MemberValuePair("pointcut".toCharArray(),pos,pos,pcutExpr);
    mvps[1] = new MemberValuePair("exceptionType".toCharArray(),pos,pos,exExpr);
View Full Code Here

  public static Annotation createDeclareAnnAnnotation(String patternString, String annString, String kind, int pos) {
    char[][] typeName = new char[][] {org,aspectj,internal,lang,annotation,declareAnnotation};
    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);
    Expression pattExpr = new StringLiteral(patternString.toCharArray(),pos,pos);
    Expression annExpr = new StringLiteral(annString.toCharArray(),pos,pos);
    Expression kindExpr = new StringLiteral(kind.toCharArray(),pos,pos);
    MemberValuePair[] mvps = new MemberValuePair[3];
    mvps[0] = new MemberValuePair("pattern".toCharArray(),pos,pos,pattExpr);
View Full Code Here

  public static Annotation createITDAnnotation(char[] targetTypeName, int modifiers, char[] name, int pos) {
    char[][] typeName = new char[][] {org,aspectj,internal,lang,annotation,itdAnnotation};
    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);
    Expression targetExpr = new StringLiteral(targetTypeName,pos,pos);
    Expression nameExpr = new StringLiteral(name,pos,pos);
    Expression modsExpr = new IntLiteral(Integer.toString(modifiers).toCharArray(),pos,pos);
    MemberValuePair[] mvps = new MemberValuePair[3];
    mvps[0] = new MemberValuePair("targetType".toCharArray(),pos,pos,targetExpr);
View Full Code Here

 
  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);
    MemberValuePair[] mvps = new MemberValuePair[1];
    mvps[0] = new MemberValuePair(value,pos,pos,valueExpr);
    ann.memberValuePairs = mvps;
    return ann;   
View Full Code Here

                    SingleMemberAnnotation theAnnotation = (SingleMemberAnnotation)annotation;
                    String clause = new String(((StringLiteral)theAnnotation.memberValue).source());//TODO cast safe ?
                    return determinePerClause(typeDeclaration, clause);
                } else if (annotation instanceof NormalAnnotation) { // this kind if it was added 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 safe ?
                    return determinePerClause(typeDeclaration, clause);
                } else {
                    eclipseWorld().showMessage(IMessage.ABORT,
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.