01: package org.codehaus.aspectwerkz.expression.ast;
02:
03: import org.codehaus.aspectwerkz.expression.SubtypePatternType;
04: import org.codehaus.aspectwerkz.expression.regexp.Pattern;
05: import org.codehaus.aspectwerkz.expression.regexp.TypePattern;
06:
07: public class ASTParameter extends SimpleNode {
08:
09: 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(
27: pattern, SubtypePatternType.MATCH_ON_ALL_METHODS);
28: } else if (pattern.endsWith("#")) {
29: pattern = pattern.substring(0, pattern.length() - 1);
30: m_declaringClassPattern = Pattern.compileTypePattern(
31: pattern,
32: SubtypePatternType.MATCH_ON_BASE_TYPE_METHODS_ONLY);
33: } else {
34: m_declaringClassPattern = Pattern.compileTypePattern(
35: pattern, SubtypePatternType.NOT_HIERARCHICAL);
36: }
37: }
38:
39: public TypePattern getDeclaringClassPattern() {
40: return m_declaringClassPattern;
41: }
42: }
|