1 12 package org.aspectj.internal.lang.reflect; 13 14 import java.util.StringTokenizer ; 15 16 import org.aspectj.lang.reflect.AjType; 17 import org.aspectj.lang.reflect.DeclarePrecedence; 18 import org.aspectj.lang.reflect.TypePattern; 19 20 24 public class DeclarePrecedenceImpl implements DeclarePrecedence { 25 26 private AjType<?> declaringType; 27 private TypePattern[] precedenceList; 28 private String precedenceString; 29 30 public DeclarePrecedenceImpl(String precedenceList, AjType declaring) { 31 this.declaringType = declaring; 32 this.precedenceString = precedenceList; 33 String toTokenize = precedenceList; 34 if (toTokenize.startsWith("(")) { 35 toTokenize = toTokenize.substring(1,toTokenize.length() - 1); 36 } 37 StringTokenizer strTok = new StringTokenizer (toTokenize,","); 38 this.precedenceList = new TypePattern[strTok.countTokens()]; 39 for (int i = 0; i < this.precedenceList.length; i++) { 40 this.precedenceList[i] = new TypePatternImpl(strTok.nextToken().trim()); 41 } 42 } 43 44 47 public AjType getDeclaringType() { 48 return this.declaringType; 49 } 50 51 54 public TypePattern[] getPrecedenceOrder() { 55 return this.precedenceList; 56 } 57 58 public String toString() { 59 return "declare precedence : " + this.precedenceString; 60 } 61 62 } 63 | Popular Tags |