org.apache.jsieve.tests
Class AbstractTest

java.lang.Object
  extended by org.apache.jsieve.tests.AbstractTest
All Implemented Interfaces:
ExecutableTest
Direct Known Subclasses:
AbstractCompatatorTest, AllOf, AnyOf, Body, Exists, False, Header, Not, Size, True

public abstract class AbstractTest
extends java.lang.Object
implements ExecutableTest

Abstract class AbstractTest defines a framework of common behavior for Sieve Tests.


Constructor Summary
AbstractTest()
          Constructor for AbstractTest.
 
Method Summary
 boolean execute(MailAdapter mail, Arguments arguments, SieveContext context)
           Method execute executes a basic Sieve Test after first invoking framework methods to validate the Command arguments.
protected abstract  boolean executeBasic(MailAdapter mail, Arguments arguments, SieveContext context)
          Abstract method executeBasic invokes a Sieve Test.
protected  void validateArguments(Arguments arguments, SieveContext context)
          Framework method validateArguments is invoked before a Sieve Test is executed to validate its arguments.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractTest

public AbstractTest()
Constructor for AbstractTest.

Method Detail

execute

public boolean execute(MailAdapter mail,
                       Arguments arguments,
                       SieveContext context)
                throws SieveException

Method execute executes a basic Sieve Test after first invoking framework methods to validate the Command arguments.

Also,

Specified by:
execute in interface ExecutableTest
context - SieveContext giving contextual information, not null
Returns:
boolean
Throws:
SieveException
See Also:
ExecutableTest.execute(MailAdapter, Arguments, SieveContext)

executeBasic

protected abstract boolean executeBasic(MailAdapter mail,
                                        Arguments arguments,
                                        SieveContext context)
                                 throws SieveException
Abstract method executeBasic invokes a Sieve Test.

Parameters:
mail -
arguments -
context - SieveContext giving contextual information, not null
Returns:
boolean
Throws:
SieveException

validateArguments

protected void validateArguments(Arguments arguments,
                                 SieveContext context)
                          throws SieveException
Framework method validateArguments is invoked before a Sieve Test is executed to validate its arguments. Subclass methods are expected to override or extend this method to perform their own validation as appropriate.

Parameters:
arguments -
context - SieveContext giving comntextual information, not null
Throws:
SieveException


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