KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > aspectwerkz > expression > ast > ASTClassPattern


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4
5 /* Generated By:JJTree: Do not edit this line. ASTClassPattern.java */
6 package com.tc.aspectwerkz.expression.ast;
7
8 import com.tc.aspectwerkz.expression.regexp.Pattern;
9 import com.tc.aspectwerkz.expression.regexp.TypePattern;
10 import com.tc.aspectwerkz.expression.SubtypePatternType;
11
12 public class ASTClassPattern extends SimpleNode {
13   private TypePattern m_typePattern;
14
15   public ASTClassPattern(int id) {
16     super(id);
17   }
18
19   public ASTClassPattern(ExpressionParser p, int id) {
20     super(p, id);
21   }
22
23   public Object JavaDoc jjtAccept(ExpressionParserVisitor visitor, Object JavaDoc data) {
24     return visitor.visit(this, data);
25   }
26
27   public void setTypePattern(String JavaDoc pattern) {
28     if (pattern.endsWith("+")) {
29       pattern = pattern.substring(0, pattern.length() - 1);
30       m_typePattern = Pattern.compileTypePattern(pattern, SubtypePatternType.MATCH_ON_ALL_METHODS);
31     } else if (pattern.endsWith("#")) {
32       pattern = pattern.substring(0, pattern.length() - 1);
33       m_typePattern = Pattern.compileTypePattern(pattern, SubtypePatternType.MATCH_ON_BASE_TYPE_METHODS_ONLY);
34     } else {
35       m_typePattern = Pattern.compileTypePattern(pattern, SubtypePatternType.NOT_HIERARCHICAL);
36     }
37   }
38
39   public TypePattern getTypePattern() {
40     return m_typePattern;
41   }
42 }
Popular Tags