KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > object > config > ClassExpressionMatcherImpl


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 package com.tc.object.config;
5
6 import com.tc.aspectwerkz.expression.ExpressionContext;
7 import com.tc.aspectwerkz.expression.ExpressionVisitor;
8 import com.tc.aspectwerkz.reflect.ClassInfo;
9 import com.tc.object.bytecode.aspectwerkz.ExpressionHelper;
10
11 public class ClassExpressionMatcherImpl implements ClassExpressionMatcher {
12
13   private final ExpressionHelper expressionHelper;
14   private ExpressionVisitor expressionVisitor;
15
16   public ClassExpressionMatcherImpl(ExpressionHelper expressionHelper, String JavaDoc classExpression) {
17     this.expressionVisitor = expressionHelper.createExpressionVisitor( //
18
ExpressionHelper.expressionPattern2WithinExpression(classExpression));
19     this.expressionHelper = expressionHelper;
20   }
21
22   public boolean match(ClassInfo classInfo) {
23     ExpressionContext ctxt = expressionHelper.createWithinExpressionContext(classInfo);
24     return expressionVisitor.match(ctxt);
25   }
26
27 }
28
Popular Tags