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