01: /* Generated By:JJTree: Do not edit this line. ASTClassPattern.java */
02: package org.codehaus.aspectwerkz.expression.ast;
03:
04: import org.codehaus.aspectwerkz.expression.SubtypePatternType;
05: import org.codehaus.aspectwerkz.expression.regexp.Pattern;
06: import org.codehaus.aspectwerkz.expression.regexp.TypePattern;
07:
08: public class ASTClassPattern extends SimpleNode {
09: private TypePattern m_typePattern;
10:
11: public ASTClassPattern(int id) {
12: super (id);
13: }
14:
15: public ASTClassPattern(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_typePattern = Pattern.compileTypePattern(pattern,
27: SubtypePatternType.MATCH_ON_ALL_METHODS);
28: } else if (pattern.endsWith("#")) {
29: pattern = pattern.substring(0, pattern.length() - 1);
30: m_typePattern = Pattern.compileTypePattern(pattern,
31: SubtypePatternType.MATCH_ON_BASE_TYPE_METHODS_ONLY);
32: } else {
33: m_typePattern = Pattern.compileTypePattern(pattern,
34: SubtypePatternType.NOT_HIERARCHICAL);
35: }
36: }
37:
38: public TypePattern getTypePattern() {
39: return m_typePattern;
40: }
41: }
|