01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04:
05: package com.tc.aspectwerkz.expression.ast;
06:
07: import com.tc.aspectwerkz.expression.regexp.Pattern;
08: import com.tc.aspectwerkz.expression.regexp.TypePattern;
09: import com.tc.aspectwerkz.expression.SubtypePatternType;
10:
11: public class ASTParameter extends SimpleNode {
12:
13: private TypePattern m_declaringClassPattern;
14:
15: public ASTParameter(int id) {
16: super (id);
17: }
18:
19: public ASTParameter(ExpressionParser p, int id) {
20: super (p, id);
21: }
22:
23: public Object jjtAccept(ExpressionParserVisitor visitor, Object data) {
24: return visitor.visit(this , data);
25: }
26:
27: public void setTypePattern(String pattern) {
28: if (pattern.endsWith("+")) {
29: pattern = pattern.substring(0, pattern.length() - 1);
30: m_declaringClassPattern = Pattern.compileTypePattern(
31: pattern, SubtypePatternType.MATCH_ON_ALL_METHODS);
32: } else if (pattern.endsWith("#")) {
33: pattern = pattern.substring(0, pattern.length() - 1);
34: m_declaringClassPattern = Pattern.compileTypePattern(
35: pattern,
36: SubtypePatternType.MATCH_ON_BASE_TYPE_METHODS_ONLY);
37: } else {
38: m_declaringClassPattern = Pattern.compileTypePattern(
39: pattern, SubtypePatternType.NOT_HIERARCHICAL);
40: }
41: }
42:
43: public TypePattern getDeclaringClassPattern() {
44: return m_declaringClassPattern;
45: }
46: }
|