View Javadoc

    1   /* Generated By:JJTree: Do not edit this line. ASTClassPattern.java */
    2   package org.codehaus.aspectwerkz.expression.ast;
    3
    4   import org.codehaus.aspectwerkz.expression.SubtypePatternType;
    5   import org.codehaus.aspectwerkz.expression.regexp.Pattern;
    6   import org.codehaus.aspectwerkz.expression.regexp.TypePattern;
    7
    8   public class ASTClassPattern extends SimpleNode {
    9       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, SubtypePatternType.MATCH_ON_ALL_METHODS);
    27          } else if (pattern.endsWith("#")) {
    28              pattern = pattern.substring(0, pattern.length() - 1);
    29              m_typePattern = Pattern.compileTypePattern(pattern, SubtypePatternType.MATCH_ON_BASE_TYPE_METHODS_ONLY);
    30          } else {
    31              m_typePattern = Pattern.compileTypePattern(pattern, SubtypePatternType.NOT_HIERARCHICAL);
    32          }
    33      }
    34
    35      public TypePattern getTypePattern() {
    36          return m_typePattern;
    37      }
    38  }