org.apache.jsieve
Class TestList

java.lang.Object
  extended by org.apache.jsieve.TestList
All Implemented Interfaces:
Executable

public class TestList
extends java.lang.Object
implements Executable

A parsed representation of an RFC3028 testlist argument...

test-list = "(" test *("," test) ")"


Constructor Summary
TestList(java.util.List<Test> children)
          Constructor for TestList.
TestList(Test child)
          Constructor for TestList.
 
Method Summary
 boolean allTestsPass(MailAdapter mail, SieveContext context)
          Do all tests pass for the given mail?
 boolean anyTestsPass(MailAdapter mail, SieveContext context)
          Do any tests pass for the given mail?
 java.lang.Object execute(MailAdapter mail, SieveContext context)
           
 java.util.List<Test> getTests()
          Returns the children.
 boolean isEmpty()
          Is this test list empty?
protected  void setTests(java.util.List<Test> children)
          Sets the children.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TestList

public TestList(java.util.List<Test> children)
Constructor for TestList.

Parameters:
children - - A List of Tests

TestList

public TestList(Test child)
Constructor for TestList.

Parameters:
child - - A Test
Method Detail

execute

public java.lang.Object execute(MailAdapter mail,
                                SieveContext context)
                         throws SieveException
Specified by:
execute in interface Executable
Throws:
SieveException
See Also:
Executable.execute(MailAdapter, SieveContext)

allTestsPass

public boolean allTestsPass(MailAdapter mail,
                            SieveContext context)
                     throws SieveException
Do all tests pass for the given mail?

Parameters:
mail - not null
context - not null
Returns:
false when any test in the list fails when run against the given mail, true when no tests fail
Throws:
SieveException

anyTestsPass

public boolean anyTestsPass(MailAdapter mail,
                            SieveContext context)
                     throws SieveException
Do any tests pass for the given mail?

Parameters:
mail - not null
context - not null
Returns:
true when any test in this list passes, false otherwise
Throws:
SieveException

getTests

public java.util.List<Test> getTests()
Returns the children.

Returns:
List

setTests

protected void setTests(java.util.List<Test> children)
Sets the children.

Parameters:
children - The children to set

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

isEmpty

public boolean isEmpty()
Is this test list empty?

Returns:
true when empty, false when tests exist


Copyright © 2008-2009 The Apache Software Foundation. All Rights Reserved.