View Javadoc

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       private TypePattern m_declaringClassPattern;
9   
10      public ASTParameter(int id) {
11          super(id);
12      }
13  
14      public ASTParameter(ExpressionParser p, int id) {
15          super(p, id);
16      }
17  
18      public Object jjtAccept(ExpressionParserVisitor visitor, Object data) {
19          return visitor.visit(this, data);
20      }
21  
22      public void setTypePattern(String pattern) {
23          if (pattern.endsWith("+")) {
24              pattern = pattern.substring(0, pattern.length() - 1);
25              m_declaringClassPattern = Pattern.compileTypePattern(pattern, SubtypePatternType.MATCH_ON_ALL_METHODS);
26          } else if (pattern.endsWith("#")) {
27              pattern = pattern.substring(0, pattern.length() - 1);
28              m_declaringClassPattern = Pattern.compileTypePattern(
29                  pattern,
30                  SubtypePatternType.MATCH_ON_BASE_TYPE_METHODS_ONLY);
31          } else {
32              m_declaringClassPattern = Pattern.compileTypePattern(pattern, SubtypePatternType.NOT_HIERARCHICAL);
33          }
34      }
35  
36      public TypePattern getDeclaringClassPattern() {
37          return m_declaringClassPattern;
38      }
39  }