1 package org.codehaus.aspectwerkz.expression.ast; 2 3 import org.codehaus.aspectwerkz.expression.SubtypePatternType; 4 import org.codehaus.aspectwerkz.expression.regexp.Pattern; 5 import org.codehaus.aspectwerkz.expression.regexp.TypePattern; 6 7 public class ASTParameter extends SimpleNode { 8 9 private TypePattern m_declaringClassPattern; 10 11 public ASTParameter(int id) { 12 super(id); 13 } 14 15 public ASTParameter(ExpressionParser p, int id) { 16 super(p, id); 17 } 18 19 public Object jjtAccept(ExpressionParserVisitor visitor, Object data) { 20 return visitor.visit(this, data); 21 } 22 23 public void setTypePattern(String pattern) { 24 if (pattern.endsWith("+")) { 25 pattern = pattern.substring(0, pattern.length() - 1); 26 m_declaringClassPattern = Pattern.compileTypePattern(pattern, SubtypePatternType.MATCH_ON_ALL_METHODS); 27 } else if (pattern.endsWith("#")) { 28 pattern = pattern.substring(0, pattern.length() - 1); 29 m_declaringClassPattern = Pattern.compileTypePattern( 30 pattern, 31 SubtypePatternType.MATCH_ON_BASE_TYPE_METHODS_ONLY 32 ); 33 } else { 34 m_declaringClassPattern = Pattern.compileTypePattern(pattern, SubtypePatternType.NOT_HIERARCHICAL); 35 } 36 } 37 38 public TypePattern getDeclaringClassPattern() { 39 return m_declaringClassPattern; 40 } 41 } | Popular Tags |