KickJava   Java API By Example, From Geeks To Geeks.

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


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.reflect.ClassInfo;
7
8 import java.util.ArrayList JavaDoc;
9 import java.util.Collection JavaDoc;
10 import java.util.Iterator JavaDoc;
11
12 public class CompoundExpressionMatcher implements ClassExpressionMatcher {
13
14   private final Collection JavaDoc matchers = new ArrayList JavaDoc();
15   
16   public boolean match(ClassInfo classInfo) {
17     for(Iterator JavaDoc i = matchers.iterator(); i.hasNext();) {
18       if (((ClassExpressionMatcher)i.next()).match(classInfo)) {
19         return true;
20       }
21     }
22     return false;
23   }
24
25   public void add(ClassExpressionMatcher matcher) {
26     matchers.add(matcher);
27   }
28
29 }
30
Popular Tags