org.apache.jsieve
Class ConditionManager

java.lang.Object
  extended byorg.apache.jsieve.ConditionManager

public class ConditionManager
extends java.lang.Object

Thread singleton class ConditionManager manages Conditional Commands during a Sieve evaluation.


Method Summary
protected static ConditionManager computeInstance()
          Answers a new instance of the manager.
static ConditionManager getInstance()
           Returns the conditionManager, lazily intialised if required.
protected  void initialize()
          Initialize the receiver.
 boolean isElseAllowed()
          Method isElseAllowed answers a boolean indicating if an Else Command is allowed.
 boolean isElseRunnable()
          Method isElseRunnable answers a boolean indicating if an Else Command is runnable based upon the current evaluation state.
 boolean isElsifAllowed()
          Method isElsifAllowed answers a boolean indicating if an Elsif Command is allowed.
 boolean isElsifRunnable()
          Method isElsifRunnable answers a boolean indicating if an Elsif Command is runnable based upon the current evaluation state.
 boolean isIfAllowed()
          Method isIfAllowed answers a boolean indicating if an If Command is allowed.
 boolean isIfRunnable()
          Method isIfRunnable answers a boolean indicating if an If Command is runnable based upon the current evaluation state.
protected  boolean isTestResult()
          Returns the testResult.
static void resetInstance()
          resets the current conditionManager.
protected  void setElseAllowed(boolean elseAllowed)
          Sets the elseAllowed.
 void setElseTestResult(boolean result)
          Method setElseTestResult disables a following Else Command and records the test result.
 void setElsifTestResult(boolean result)
          Method setElsifTestResult enables a following Else Command and records the test result.
 void setIfTestResult(boolean result)
          Method setIfTestResult enables a following Else Command and records the test result.
static void setInstance(ConditionManager conditionManager)
          Sets the current conditionManager.
protected  void setTestResult(boolean testResult)
          Sets the testResult.
protected static void updateInstance()
          Updates the current conditionManager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

initialize

protected void initialize()
Initialize the receiver.


setIfTestResult

public void setIfTestResult(boolean result)
Method setIfTestResult enables a following Else Command and records the test result.

Parameters:
result -

setElsifTestResult

public void setElsifTestResult(boolean result)
Method setElsifTestResult enables a following Else Command and records the test result.

Parameters:
result -

setElseTestResult

public void setElseTestResult(boolean result)
Method setElseTestResult disables a following Else Command and records the test result.

Parameters:
result -

isIfAllowed

public boolean isIfAllowed()
Method isIfAllowed answers a boolean indicating if an If Command is allowed.

Returns:
boolean

isElsifAllowed

public boolean isElsifAllowed()
Method isElsifAllowed answers a boolean indicating if an Elsif Command is allowed.

Returns:
boolean

isElseAllowed

public boolean isElseAllowed()
Method isElseAllowed answers a boolean indicating if an Else Command is allowed.

Returns:
boolean

isIfRunnable

public boolean isIfRunnable()
Method isIfRunnable answers a boolean indicating if an If Command is runnable based upon the current evaluation state.

Returns:
boolean

isElsifRunnable

public boolean isElsifRunnable()
Method isElsifRunnable answers a boolean indicating if an Elsif Command is runnable based upon the current evaluation state.

Returns:
boolean

isElseRunnable

public boolean isElseRunnable()
Method isElseRunnable answers a boolean indicating if an Else Command is runnable based upon the current evaluation state.

Returns:
boolean

computeInstance

protected static ConditionManager computeInstance()
Answers a new instance of the manager.

Returns:
ConditionManager

getInstance

public static ConditionManager getInstance()

Returns the conditionManager, lazily intialised if required.

Note that this must be synchronized to prevent another thread detecting the null state while this thread is initialising.

Returns:
ConditionManager

setInstance

public static void setInstance(ConditionManager conditionManager)
Sets the current conditionManager.

Parameters:
conditionManager - The conditionManager to set

resetInstance

public static void resetInstance()
resets the current conditionManager.


updateInstance

protected static void updateInstance()
Updates the current conditionManager.


isTestResult

protected boolean isTestResult()
Returns the testResult.

Returns:
boolean

setElseAllowed

protected void setElseAllowed(boolean elseAllowed)
Sets the elseAllowed.

Parameters:
elseAllowed - The elseAllowed to set

setTestResult

protected void setTestResult(boolean testResult)
Sets the testResult.

Parameters:
testResult - The testResult to set


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