You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by no...@apache.org on 2010/02/14 18:02:28 UTC
svn commit: r910040 - in /james/mailet/base/trunk: pom.xml
src/main/java/org/apache/mailet/base/CompositeMatcherBase.java
Author: norman
Date: Sun Feb 14 17:02:28 2010
New Revision: 910040
URL: http://svn.apache.org/viewvc?rev=910040&view=rev
Log:
Add CompositeMatcherBase class as part of JAMES-948. Thx to Ralph B Holland for the patch!
Added:
james/mailet/base/trunk/src/main/java/org/apache/mailet/base/CompositeMatcherBase.java
Modified:
james/mailet/base/trunk/pom.xml
Modified: james/mailet/base/trunk/pom.xml
URL: http://svn.apache.org/viewvc/james/mailet/base/trunk/pom.xml?rev=910040&r1=910039&r2=910040&view=diff
==============================================================================
--- james/mailet/base/trunk/pom.xml (original)
+++ james/mailet/base/trunk/pom.xml Sun Feb 14 17:02:28 2010
@@ -94,7 +94,7 @@
<dependency>
<groupId>org.apache.james</groupId>
<artifactId>apache-mailet</artifactId>
- <version>2.4</version>
+ <version>2.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>junit</groupId>
Added: james/mailet/base/trunk/src/main/java/org/apache/mailet/base/CompositeMatcherBase.java
URL: http://svn.apache.org/viewvc/james/mailet/base/trunk/src/main/java/org/apache/mailet/base/CompositeMatcherBase.java?rev=910040&view=auto
==============================================================================
--- james/mailet/base/trunk/src/main/java/org/apache/mailet/base/CompositeMatcherBase.java (added)
+++ james/mailet/base/trunk/src/main/java/org/apache/mailet/base/CompositeMatcherBase.java Sun Feb 14 17:02:28 2010
@@ -0,0 +1,56 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one *
+ * or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information *
+ * regarding copyright ownership. The ASF licenses this file *
+ * to you under the Apache License, Version 2.0 (the *
+ * "License"); you may not use this file except in compliance *
+ * with the License. You may obtain a copy of the License at *
+ * *
+ * http://www.apache.org/licenses/LICENSE-2.0 *
+ * *
+ * Unless required by applicable law or agreed to in writing, *
+ * software distributed under the License is distributed on an *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
+ * KIND, either express or implied. See the License for the *
+ * specific language governing permissions and limitations *
+ * under the License. *
+ ****************************************************************/
+
+
+package org.apache.mailet.base;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.ArrayList;
+
+import org.apache.mailet.CompositeMatcher;
+import org.apache.mailet.Matcher;
+
+/**
+ * Abstract base class for CompositeMatchers. This class handles the child
+ * collection of Matchers associated with the CompositeMatcher.
+ */
+public abstract class CompositeMatcherBase extends GenericMatcher implements CompositeMatcher {
+ /**
+ * This lets the SpoolManager configuration code build up the composition
+ * (which might be composed of other composites).
+ *
+ * @param matcher
+ * Matcher child of the CompositeMatcher.
+ */
+ public void add(Matcher matcher) {
+ matchers.add(matcher);
+ }
+
+ /**
+ * @return Iterator for the child matchers
+ */
+ public Iterator iterator() {
+ return matchers.iterator();
+ }
+
+ // the collection used to store the child-matchers
+ private Collection matchers = new ArrayList();
+
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org