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 ba...@apache.org on 2007/09/21 11:32:05 UTC
svn commit: r578033 [2/5] - in
/james/jsieve/trunk/src/main/java/org/apache/jsieve: ./ commands/
commands/extensions/ commands/optional/ comparators/ exception/ mail/
mail/optional/ parser/ parser/address/ samples/james/ tests/
tests/optional/ util/check/
Modified: james/jsieve/trunk/src/main/java/org/apache/jsieve/ScriptCoordinate.java
URL: http://svn.apache.org/viewvc/james/jsieve/trunk/src/main/java/org/apache/jsieve/ScriptCoordinate.java?rev=578033&r1=578032&r2=578033&view=diff
==============================================================================
--- james/jsieve/trunk/src/main/java/org/apache/jsieve/ScriptCoordinate.java (original)
+++ james/jsieve/trunk/src/main/java/org/apache/jsieve/ScriptCoordinate.java Fri Sep 21 02:32:00 2007
@@ -24,67 +24,75 @@
import org.apache.jsieve.exception.SyntaxException;
/**
- * Specifies the positional extent of an element
- * within the script being executed.
- * In other words, this gives the line and column at which
- * the elment starts and at which it ends.
+ * Specifies the positional extent of an element within the script being
+ * executed. In other words, this gives the line and column at which the elment
+ * starts and at which it ends.
*/
public final class ScriptCoordinate {
private final int startLineNumber;
+
private final int startColumnNumber;
+
private final int endLineNumber;
+
private final int endColumnNumber;
-
- public ScriptCoordinate(final int startLineNumber, final int startColumnNumber,
- final int endLineNumber, final int endColumnNumber) {
+
+ public ScriptCoordinate(final int startLineNumber,
+ final int startColumnNumber, final int endLineNumber,
+ final int endColumnNumber) {
super();
this.startLineNumber = startLineNumber;
this.startColumnNumber = startColumnNumber;
this.endLineNumber = endLineNumber;
this.endColumnNumber = endColumnNumber;
}
-
+
/**
* Gets the number of the column where the elements ends.
+ *
* @return column number
*/
public int getEndColumnNumber() {
return endColumnNumber;
}
-
+
/**
* Gets the number of the line where the element ends.
+ *
* @return line number
*/
public int getEndLineNumber() {
return endLineNumber;
}
-
+
/**
* Gets the number of the column where the element start.
+ *
* @return column number
*/
public int getStartColumnNumber() {
return startColumnNumber;
}
-
+
/**
* Gets the number of the line where the element starts.
+ *
* @return line number
*/
public int getStartLineNumber() {
return startLineNumber;
}
-
+
/**
- * Creates a syntax exception based on the given message
- * containing details of the script position.
- * The message should end with a full stop.
- * @param message <code>CharSequence</code> containing the base message,
- * not null
- * @return <code>SyntaxException</code> with details of the script position
- * appended to the message, not null
+ * Creates a syntax exception based on the given message containing details
+ * of the script position. The message should end with a full stop.
+ *
+ * @param message
+ * <code>CharSequence</code> containing the base message,
+ * not null
+ * @return <code>SyntaxException</code> with details of the script
+ * position appended to the message, not null
*/
public SyntaxException syntaxException(CharSequence message) {
final Log logger = Logger.getLog();
@@ -96,16 +104,16 @@
final SyntaxException result = new SyntaxException(fullMessage);
return result;
}
-
-
+
/**
- * Creates a command exception based on the given message
- * containing details of the script position.
- * The message should end with a full stop.
- * @param message <code>CharSequence</code> containing the base message,
- * not null
- * @return <code>CommandException</code> with details of the script position
- * appended to the message, not null
+ * Creates a command exception based on the given message containing details
+ * of the script position. The message should end with a full stop.
+ *
+ * @param message
+ * <code>CharSequence</code> containing the base message,
+ * not null
+ * @return <code>CommandException</code> with details of the script
+ * position appended to the message, not null
*/
public CommandException commandException(CharSequence message) {
final Log logger = Logger.getLog();
@@ -117,13 +125,15 @@
final CommandException result = new CommandException(fullMessage);
return result;
}
-
+
/**
- * Appends a standard position phrase to the given message.
- * This message should end with a full stop.
- * @param message <code>CharSequence</code> message, not null
- * @return <code>String</code> containing the original message
- * with positional phrase appended, not null
+ * Appends a standard position phrase to the given message. This message
+ * should end with a full stop.
+ *
+ * @param message
+ * <code>CharSequence</code> message, not null
+ * @return <code>String</code> containing the original message with
+ * positional phrase appended, not null
*/
public String addStartLineAndColumn(CharSequence message) {
final StringBuffer buffer;
@@ -139,26 +149,34 @@
buffer.append(".");
return buffer.toString();
}
-
+
/**
* Logs diagnotic information about the script coordinate.
- * @param logger <code>Log</code>, not null
+ *
+ * @param logger
+ * <code>Log</code>, not null
*/
public void logDiagnosticsInfo(Log logger) {
if (logger.isInfoEnabled()) {
- logger.info("Expression starts line " + startLineNumber + " column " + startColumnNumber);
- logger.info("Expression ends line " + endLineNumber + " column " + endColumnNumber);
+ logger.info("Expression starts line " + startLineNumber
+ + " column " + startColumnNumber);
+ logger.info("Expression ends line " + endLineNumber + " column "
+ + endColumnNumber);
}
}
-
+
/**
* Logs diagnotic information about the script coordinate.
- * @param logger <code>Log</code>, not null
+ *
+ * @param logger
+ * <code>Log</code>, not null
*/
public void debugDiagnostics(Log logger) {
if (logger.isDebugEnabled()) {
- logger.debug("Expression starts line " + startLineNumber + " column " + startColumnNumber);
- logger.debug("Expression ends line " + endLineNumber + " column " + endColumnNumber);
+ logger.debug("Expression starts line " + startLineNumber
+ + " column " + startColumnNumber);
+ logger.debug("Expression ends line " + endLineNumber + " column "
+ + endColumnNumber);
}
}
}
Modified: james/jsieve/trunk/src/main/java/org/apache/jsieve/SieveConfigurationException.java
URL: http://svn.apache.org/viewvc/james/jsieve/trunk/src/main/java/org/apache/jsieve/SieveConfigurationException.java?rev=578033&r1=578032&r2=578033&view=diff
==============================================================================
--- james/jsieve/trunk/src/main/java/org/apache/jsieve/SieveConfigurationException.java (original)
+++ james/jsieve/trunk/src/main/java/org/apache/jsieve/SieveConfigurationException.java Fri Sep 21 02:32:00 2007
@@ -17,52 +17,49 @@
* under the License. *
****************************************************************/
-
package org.apache.jsieve;
import org.apache.jsieve.exception.SieveException;
/**
- * Class <code>SieveConfigurationException</code> indicates an exceptional condition
- * encountered while evaluating the Sieve configuration.
+ * Class <code>SieveConfigurationException</code> indicates an exceptional
+ * condition encountered while evaluating the Sieve configuration.
*
*/
-public class SieveConfigurationException extends SieveException
-{
+public class SieveConfigurationException extends SieveException {
/**
* Constructor for SieveConfigurationException.
*/
- public SieveConfigurationException()
- {
+ public SieveConfigurationException() {
super();
}
/**
* Constructor for SieveConfigurationException.
+ *
* @param message
*/
- public SieveConfigurationException(String message)
- {
+ public SieveConfigurationException(String message) {
super(message);
}
/**
* Constructor for SieveConfigurationException.
+ *
* @param message
* @param cause
*/
- public SieveConfigurationException(String message, Throwable cause)
- {
+ public SieveConfigurationException(String message, Throwable cause) {
super(message, cause);
}
/**
* Constructor for SieveConfigurationException.
+ *
* @param cause
*/
- public SieveConfigurationException(Throwable cause)
- {
+ public SieveConfigurationException(Throwable cause) {
super(cause);
}
Modified: james/jsieve/trunk/src/main/java/org/apache/jsieve/SieveContext.java
URL: http://svn.apache.org/viewvc/james/jsieve/trunk/src/main/java/org/apache/jsieve/SieveContext.java?rev=578033&r1=578032&r2=578033&view=diff
==============================================================================
--- james/jsieve/trunk/src/main/java/org/apache/jsieve/SieveContext.java (original)
+++ james/jsieve/trunk/src/main/java/org/apache/jsieve/SieveContext.java Fri Sep 21 02:32:00 2007
@@ -21,19 +21,22 @@
/**
* Context for sieve operations.
- *
+ *
*/
public abstract class SieveContext {
/**
* Gets the script position of the current operation.
+ *
* @return <code>ScriptCoordinate</code>, not null
*/
public abstract ScriptCoordinate getCoordinate();
-
+
/**
* Sets the script position of the current operation.
- * @param coordinate <code>ScriptCoordinate</code>, not null
+ *
+ * @param coordinate
+ * <code>ScriptCoordinate</code>, not null
*/
public abstract void setCoordinate(ScriptCoordinate coordinate);
}
Modified: james/jsieve/trunk/src/main/java/org/apache/jsieve/SieveFactory.java
URL: http://svn.apache.org/viewvc/james/jsieve/trunk/src/main/java/org/apache/jsieve/SieveFactory.java?rev=578033&r1=578032&r2=578033&view=diff
==============================================================================
--- james/jsieve/trunk/src/main/java/org/apache/jsieve/SieveFactory.java (original)
+++ james/jsieve/trunk/src/main/java/org/apache/jsieve/SieveFactory.java Fri Sep 21 02:32:00 2007
@@ -17,7 +17,6 @@
* under the License. *
****************************************************************/
-
package org.apache.jsieve;
import java.io.InputStream;
@@ -33,66 +32,59 @@
import org.apache.jsieve.parser.generated.SieveParserVisitor;
/**
- * <p>Singleton class SieveFactory is the primary invocation point for all Sieve
+ * <p>
+ * Singleton class SieveFactory is the primary invocation point for all Sieve
* operations. Theses are...
* <dl>
* <dt>parse</dt>
- * <dd>
- * Parse a Sieve script into a hierarchy of parsed nodes. A succesful parse means the
- * script is lexically and gramatically valid according to RFC 3028, section 8. The
- * result is the start node of the parsed Sieve script. The start node is resuable.
- * Typically it is stored for reuse in all subsequent evaluations of the script.
- * </dd>
+ * <dd> Parse a Sieve script into a hierarchy of parsed nodes. A succesful parse
+ * means the script is lexically and gramatically valid according to RFC 3028,
+ * section 8. The result is the start node of the parsed Sieve script. The start
+ * node is resuable. Typically it is stored for reuse in all subsequent
+ * evaluations of the script. </dd>
* <dt>evaluate</dt>
- * <dd>
- * Evaluate an RFC 822 compliant mail message wrapped in a MailAdapter against the
- * parse result referenced by the start node from the Parse operation above. As
- * evaluation proceeds a List of Actions is added to the MailAdapter. At the end of
- * evaluation, each Action in the List is executed in the order they were added.
- * </dd>
+ * <dd> Evaluate an RFC 822 compliant mail message wrapped in a MailAdapter
+ * against the parse result referenced by the start node from the Parse
+ * operation above. As evaluation proceeds a List of Actions is added to the
+ * MailAdapter. At the end of evaluation, each Action in the List is executed in
+ * the order they were added. </dd>
* <dt>interpret/dt>
- * <dd>A concatenation of parse and evaluate. Useful for testing, but generally the
- * parse result should be stored for reuse in subsequent evaluations.
- * </dd>
+ * <dd>A concatenation of parse and evaluate. Useful for testing, but generally
+ * the parse result should be stored for reuse in subsequent evaluations. </dd>
* </dl>
* </p>
*
*
*/
-public class SieveFactory
-{
-
+public class SieveFactory {
+
/**
* The sole instance of the receiver.
- */
+ */
private static SieveFactory fieldInstance;
/**
* Constructor for SieveFactory.
*/
- public SieveFactory()
- {
+ public SieveFactory() {
super();
}
-
+
/**
- * Method parse parses a Sieve script into a hierarchy of parsed nodes. A
- * successful parse means the script is lexically and grammatically valid
- * according to RFC 3028, section 8. The result is the start node of the parsed
- * Sieve script. The start node is reusable. Typically it is stored for reuse in
- * subsequent evaluations of the script.
+ * Method parse parses a Sieve script into a hierarchy of parsed nodes. A
+ * successful parse means the script is lexically and grammatically valid
+ * according to RFC 3028, section 8. The result is the start node of the
+ * parsed Sieve script. The start node is reusable. Typically it is stored
+ * for reuse in subsequent evaluations of the script.
+ *
* @param inputStream
* @return Node
* @throws ParseException
*/
- public Node parse(InputStream inputStream) throws ParseException
- {
- try
- {
+ public Node parse(InputStream inputStream) throws ParseException {
+ try {
return new SieveParser(inputStream, "UTF-8").start();
- }
- catch (ParseException ex)
- {
+ } catch (ParseException ex) {
Log log = Logger.getLog();
if (log.isErrorEnabled())
log.error("Parse failed. Reason: " + ex.getMessage());
@@ -101,41 +93,39 @@
throw ex;
}
}
-
+
/**
- * <p>Method evaluate evaluates an RFC 822 compliant mail message wrapped in a
- * MailAdapter by visting each node of the parsed script beginning at the
- * passed start node. As evaluation proceeds a List of Actions is added to the
- * MailAdapter.<p>
- *
- * <p>At the start of evaluation an 'implicitKeep' state is set. This can be
- * cancelled by a Command during evaluation. If 'implicitKeep' is still set at
- * the end of evaluation, a Keep Action is added to the List of Actions.
- * Finally, each Action in the List is executed in the order they were added.
+ * <p>
+ * Method evaluate evaluates an RFC 822 compliant mail message wrapped in a
+ * MailAdapter by visting each node of the parsed script beginning at the
+ * passed start node. As evaluation proceeds a List of Actions is added to
+ * the MailAdapter.
+ * <p>
+ *
+ * <p>
+ * At the start of evaluation an 'implicitKeep' state is set. This can be
+ * cancelled by a Command during evaluation. If 'implicitKeep' is still set
+ * at the end of evaluation, a Keep Action is added to the List of Actions.
+ * Finally, each Action in the List is executed in the order they were
+ * added.
* </p>
+ *
* @param mail
* @param startNode
* @throws SieveException
*/
public void evaluate(MailAdapter mail, Node startNode)
- throws SieveException
- {
+ throws SieveException {
SieveParserVisitor visitor = new SieveParserVisitorImpl();
reset();
- try
- {
- try
- {
+ try {
+ try {
// Evaluate the Nodes
startNode.jjtAccept(visitor, mail);
- }
- catch (StopException ex)
- {
+ } catch (StopException ex) {
// Stop is OK
- }
- catch (SieveException ex)
- {
+ } catch (SieveException ex) {
Log log = Logger.getLog();
if (log.isErrorEnabled())
log.error("Evaluation failed. Reason: " + ex.getMessage());
@@ -144,18 +134,16 @@
throw ex;
}
- // If after evaluating all of the nodes or stopping, implicitKeep is still
+ // If after evaluating all of the nodes or stopping, implicitKeep is
+ // still
// in effect, add a Keep to the list of Actions.
if (CommandStateManager.getInstance().isImplicitKeep())
mail.addAction(new ActionKeep());
- // Execute the List of Actions
- try
- {
+ // Execute the List of Actions
+ try {
mail.executeActions();
- }
- catch (SieveException ex)
- {
+ } catch (SieveException ex) {
Log log = Logger.getLog();
if (log.isErrorEnabled())
log.error("Evaluation failed. Reason: " + ex.getMessage());
@@ -163,9 +151,7 @@
log.debug("Evaluation failed.", ex);
throw ex;
}
- }
- finally
- {
+ } finally {
// Tidy up managers stored in thread local variables
reset();
}
@@ -175,70 +161,68 @@
ConditionManager.resetInstance();
CommandStateManager.resetInstance();
}
-
-
+
/**
- * Method interpret parses a Sieve script and then evaluates the result against
- * a mail.
+ * Method interpret parses a Sieve script and then evaluates the result
+ * against a mail.
+ *
* @param mail
* @param inputStream
* @throws ParseException
* @throws SieveException
*/
public void interpret(MailAdapter mail, InputStream inputStream)
- throws ParseException, SieveException
- {
+ throws ParseException, SieveException {
evaluate(mail, parse(inputStream));
- }
+ }
/**
* Returns the instance of the receiver, lazily initialised if required.
+ *
* @return SieveFactory
*/
- public static synchronized SieveFactory getInstance()
- {
+ public static synchronized SieveFactory getInstance() {
SieveFactory instance = null;
- if (null == (instance = getInstanceBasic()))
- {
+ if (null == (instance = getInstanceBasic())) {
updateInstance();
return getInstance();
}
return instance;
}
-
+
/**
* Computes an instance of the receiver.
+ *
* @return SieveFactory
*/
- public static SieveFactory computeInstance()
- {
+ public static SieveFactory computeInstance() {
return new SieveFactory();
- }
-
+ }
+
/**
* Returns the instance of the receiver.
+ *
* @return SieveFactory
*/
- private static SieveFactory getInstanceBasic()
- {
+ private static SieveFactory getInstanceBasic() {
return fieldInstance;
- }
+ }
/**
* Sets the instance of the receiver.
- * @param instance The instance to set
+ *
+ * @param instance
+ * The instance to set
*/
- protected static void setInstance(SieveFactory instance)
- {
+ protected static void setInstance(SieveFactory instance) {
fieldInstance = instance;
}
-
+
/**
* Updates the instance of the receiver.
*/
- protected static void updateInstance()
- {
+ protected static void updateInstance() {
setInstance(computeInstance());
- }
+ }
}
Modified: james/jsieve/trunk/src/main/java/org/apache/jsieve/SieveParserVisitorImpl.java
URL: http://svn.apache.org/viewvc/james/jsieve/trunk/src/main/java/org/apache/jsieve/SieveParserVisitorImpl.java?rev=578033&r1=578032&r2=578033&view=diff
==============================================================================
--- james/jsieve/trunk/src/main/java/org/apache/jsieve/SieveParserVisitorImpl.java (original)
+++ james/jsieve/trunk/src/main/java/org/apache/jsieve/SieveParserVisitorImpl.java Fri Sep 21 02:32:00 2007
@@ -17,7 +17,6 @@
* under the License. *
****************************************************************/
-
package org.apache.jsieve;
import java.util.ArrayList;
@@ -28,81 +27,79 @@
import org.apache.jsieve.mail.*;
import org.apache.jsieve.parser.generated.*;
-
-
/**
- * <p>Class SieveParserVisitorImpl defines the behaviour for each visited node in the
- * Sieve grammar. Each method corresponds to a node type and is invoked when a node
- * of that type is evaluated.</p>
+ * <p>
+ * Class SieveParserVisitorImpl defines the behaviour for each visited node in
+ * the Sieve grammar. Each method corresponds to a node type and is invoked when
+ * a node of that type is evaluated.
+ * </p>
*
- * <p>In essence, this class translates between the nodes operated on by the JavaCC
- * generated classes and the Sieve classes operated upon by the Commands, Tests and
- * Comparators. A visit to the start node, ASTstart, triggers evaluation of all of
- * its descendants.
+ * <p>
+ * In essence, this class translates between the nodes operated on by the JavaCC
+ * generated classes and the Sieve classes operated upon by the Commands, Tests
+ * and Comparators. A visit to the start node, ASTstart, triggers evaluation of
+ * all of its descendants.
* </p>
*
- * <p>See https://javacc.dev.java.net/doc/JJTree.html for indepth information about
- * Visitor support.</p>
+ * <p>
+ * See https://javacc.dev.java.net/doc/JJTree.html for indepth information about
+ * Visitor support.
+ * </p>
*
- * <p><strong>Note</strong> that this class is not thread safe. It's use should
- * be restricted to a single thread for the duration of a visit.
- * </p>
+ * <p>
+ * <strong>Note</strong> that this class is not thread safe. It's use should be
+ * restricted to a single thread for the duration of a visit.
+ * </p>
*/
-public class SieveParserVisitorImpl implements SieveParserVisitor
-{
+public class SieveParserVisitorImpl implements SieveParserVisitor {
private BaseSieveContext context = new BaseSieveContext();
-
+
/**
* Constructor for NodeVisitor.
*/
- public SieveParserVisitorImpl()
- {
+ public SieveParserVisitorImpl() {
super();
}
-
+
/**
* Method visitChildren adds the children of the node to the passed List.
+ *
* @param node
- * @param data - Assumes a List
- * @return Object - A List
+ * @param data -
+ * Assumes a List
+ * @return Object - A List
* @throws SieveException
*/
protected Object visitChildren(SimpleNode node, Object data)
- throws SieveException
- {
+ throws SieveException {
List children = new ArrayList(node.jjtGetNumChildren());
node.childrenAccept(this, children);
- ((List) data).addAll(children);
+ ((List) data).addAll(children);
return data;
- }
+ }
/**
* @see SieveParserVisitor#visit(ASTargument, Object)
*/
- public Object visit(ASTargument node, Object data) throws SieveException
- {
+ public Object visit(ASTargument node, Object data) throws SieveException {
List children = new ArrayList(node.jjtGetNumChildren());
Argument argument = null;
- if (null != node.getValue())
- {
- argument = (Argument)node.getValue();
- }
- else
- {
- argument =
- new StringListArgument(
- ((List) node.childrenAccept(this, children)));
+ if (null != node.getValue()) {
+ argument = (Argument) node.getValue();
+ } else {
+ argument = new StringListArgument(((List) node.childrenAccept(this,
+ children)));
}
((List) data).add(argument);
return data;
}
+
/**
* @see SieveParserVisitor#visit(ASTarguments, Object)
*/
- public Object visit(ASTarguments node, Object data) throws SieveException
- {
+ public Object visit(ASTarguments node, Object data) throws SieveException {
List children = new ArrayList(node.jjtGetNumChildren());
children = ((List) node.childrenAccept(this, children));
@@ -110,8 +107,7 @@
Iterator childrenIter = children.iterator();
TestList testList = null;
List argList = new ArrayList(children.size());
- while (childrenIter.hasNext())
- {
+ while (childrenIter.hasNext()) {
Object next = childrenIter.next();
if (next instanceof Test)
testList = new TestList((Test) next);
@@ -129,13 +125,12 @@
/**
* @see SieveParserVisitor#visit(ASTblock, Object)
*/
- public Object visit(ASTblock node, Object data) throws SieveException
- {
- // if (node.jjtGetNumChildren() != 1)
- // throw new ParseException("Expecting exactly one 1 child");
+ public Object visit(ASTblock node, Object data) throws SieveException {
+ // if (node.jjtGetNumChildren() != 1)
+ // throw new ParseException("Expecting exactly one 1 child");
List children = new ArrayList(node.jjtGetNumChildren());
- Commands commands =
- (Commands) ((List) node.childrenAccept(this, children)).get(0);
+ Commands commands = (Commands) ((List) node.childrenAccept(this,
+ children)).get(0);
Block block = new Block(commands);
((List) data).add(block);
return data;
@@ -144,8 +139,7 @@
/**
* @see SieveParserVisitor#visit(ASTcommand, Object)
*/
- public Object visit(ASTcommand node, Object data) throws SieveException
- {
+ public Object visit(ASTcommand node, Object data) throws SieveException {
List children = new ArrayList(node.jjtGetNumChildren());
children = ((List) node.childrenAccept(this, children));
@@ -153,8 +147,7 @@
Iterator childrenIter = children.iterator();
Arguments arguments = null;
Block block = null;
- while (childrenIter.hasNext())
- {
+ while (childrenIter.hasNext()) {
Object next = childrenIter.next();
if (next instanceof Arguments)
arguments = (Arguments) next;
@@ -171,11 +164,10 @@
/**
* @see SieveParserVisitor#visit(ASTcommands, Object)
*/
- public Object visit(ASTcommands node, Object data) throws SieveException
- {
+ public Object visit(ASTcommands node, Object data) throws SieveException {
List children = new ArrayList(node.jjtGetNumChildren());
- Commands commands =
- new Commands(((List) node.childrenAccept(this, children)));
+ Commands commands = new Commands(((List) node.childrenAccept(this,
+ children)));
((List) data).add(commands);
return data;
}
@@ -183,12 +175,10 @@
/**
* @see SieveParserVisitor#visit(ASTstart, Object)
*/
- public Object visit(ASTstart node, Object data) throws SieveException
- {
+ public Object visit(ASTstart node, Object data) throws SieveException {
// The data object must be the MailAdapter to process
if (!(data instanceof MailAdapter))
- throw new SieveException(
- "Expecting an instance of "
+ throw new SieveException("Expecting an instance of "
+ MailAdapter.class.getName()
+ " as data, received an instance of "
+ (data == null ? "<null>" : data.getClass().getName())
@@ -197,45 +187,42 @@
// Start is an implicit Block
// There will be one child, an instance of Commands
List children = new ArrayList(node.jjtGetNumChildren());
- Commands commands =
- (Commands) ((List) node.childrenAccept(this, children)).get(0);
+ Commands commands = (Commands) ((List) node.childrenAccept(this,
+ children)).get(0);
Block block = new Block(commands);
context.setCoordinate(node.getCoordinate());
// Answer the result of executing the Block
- return block.execute((MailAdapter)data);
+ return block.execute((MailAdapter) data);
}
/**
* @see SieveParserVisitor#visit(ASTstring_list, Object)
*/
- public Object visit(ASTstring_list node, Object data) throws SieveException
- {
+ public Object visit(ASTstring_list node, Object data) throws SieveException {
return visitChildren(node, data);
}
/**
* @see SieveParserVisitor#visit(ASTstring, Object)
*/
- public Object visit(ASTstring node, Object data)
- {
+ public Object visit(ASTstring node, Object data) {
// Strings are always surround by double-quotes
- String value = (String)node.getValue();
+ String value = (String) node.getValue();
String string = value.substring(1, value.length() - 1);
-
+
// A String is terminal, add it
- ((List)data).add(string);
+ ((List) data).add(string);
return data;
}
/**
* @see SieveParserVisitor#visit(ASTtest_list, Object)
*/
- public Object visit(ASTtest_list node, Object data) throws SieveException
- {
- // return visitChildren(node, data);
+ public Object visit(ASTtest_list node, Object data) throws SieveException {
+ // return visitChildren(node, data);
List children = new ArrayList(node.jjtGetNumChildren());
- TestList testList =
- new TestList(((List) node.childrenAccept(this, children)));
+ TestList testList = new TestList(((List) node.childrenAccept(this,
+ children)));
((List) data).add(testList);
return data;
}
@@ -243,16 +230,14 @@
/**
* @see SieveParserVisitor#visit(ASTtest, Object)
*/
- public Object visit(ASTtest node, Object data) throws SieveException
- {
+ public Object visit(ASTtest node, Object data) throws SieveException {
List children = new ArrayList(node.jjtGetNumChildren());
children = ((List) node.childrenAccept(this, children));
// Extract the Arguments from the children
Iterator childrenIter = children.iterator();
Arguments arguments = null;
- while (childrenIter.hasNext())
- {
+ while (childrenIter.hasNext()) {
Object next = childrenIter.next();
if (next instanceof Arguments)
arguments = (Arguments) next;
@@ -267,8 +252,7 @@
/**
* @see SieveParserVisitor#visit(SimpleNode, Object)
*/
- public Object visit(SimpleNode node, Object data) throws SieveException
- {
+ public Object visit(SimpleNode node, Object data) throws SieveException {
return visitChildren(node, data);
}
Modified: james/jsieve/trunk/src/main/java/org/apache/jsieve/StringListArgument.java
URL: http://svn.apache.org/viewvc/james/jsieve/trunk/src/main/java/org/apache/jsieve/StringListArgument.java?rev=578033&r1=578032&r2=578033&view=diff
==============================================================================
--- james/jsieve/trunk/src/main/java/org/apache/jsieve/StringListArgument.java (original)
+++ james/jsieve/trunk/src/main/java/org/apache/jsieve/StringListArgument.java Fri Sep 21 02:32:00 2007
@@ -17,101 +17,95 @@
* under the License. *
****************************************************************/
-
package org.apache.jsieve;
import java.util.ArrayList;
import java.util.List;
/**
- * Class StringListArgument is a parsed representation of the RFC3028 BNF...</p>
+ * Class StringListArgument is a parsed representation of the RFC3028 BNF...
+ * </p>
*
* <code>string-list = "[" string *("," string) "]" / string</code>
*/
-public class StringListArgument implements Argument
-{
+public class StringListArgument implements Argument {
private List fieldList;
/**
* Constructor for StringListArgument.
*/
- private StringListArgument()
- {
+ private StringListArgument() {
super();
}
-
+
/**
* Constructor for StringListArgument.
*/
- public StringListArgument(List stringList)
- {
+ public StringListArgument(List stringList) {
this();
setList(stringList);
}
/**
* Returns the list, lazy initialised if required.
+ *
* @return List
*/
- public List getList()
- {
+ public List getList() {
List list = null;
- if (null == (list = getListBasic()))
- {
+ if (null == (list = getListBasic())) {
updateList();
return getList();
- }
+ }
return list;
}
-
+
/**
* Returns the list.
+ *
* @return List
*/
- private List getListBasic()
- {
+ private List getListBasic() {
return fieldList;
- }
-
+ }
+
/**
* Returns a new list.
+ *
* @return List
*/
- protected List computeList()
- {
+ protected List computeList() {
return new ArrayList();
- }
+ }
/**
* Sets the list.
- * @param list The list to set
+ *
+ * @param list
+ * The list to set
*/
- protected void setList(List list)
- {
+ protected void setList(List list) {
fieldList = list;
}
-
+
/**
* Updates the list.
*/
- protected void updateList()
- {
+ protected void updateList() {
setList(computeList());
- }
+ }
/**
* @see org.apache.jsieve.Argument#getValue()
*/
- public Object getValue()
- {
+ public Object getValue() {
return getList();
}
/**
* @see java.lang.Object#toString()
*/
- public String toString()
- {
+ public String toString() {
return (getValue() == null) ? "null" : getValue().toString();
}
Modified: james/jsieve/trunk/src/main/java/org/apache/jsieve/TagArgument.java
URL: http://svn.apache.org/viewvc/james/jsieve/trunk/src/main/java/org/apache/jsieve/TagArgument.java?rev=578033&r1=578032&r2=578033&view=diff
==============================================================================
--- james/jsieve/trunk/src/main/java/org/apache/jsieve/TagArgument.java (original)
+++ james/jsieve/trunk/src/main/java/org/apache/jsieve/TagArgument.java Fri Sep 21 02:32:00 2007
@@ -17,83 +17,80 @@
* under the License. *
****************************************************************/
-
package org.apache.jsieve;
import org.apache.jsieve.parser.generated.Token;
/**
- * <p>A parsed representation of an RFC3028 TAG argument...</p>
+ * <p>
+ * A parsed representation of an RFC3028 TAG argument...
+ * </p>
*
* <code>tag = ":" identifier</code>
*/
-public class TagArgument implements Argument
-{
-
+public class TagArgument implements Argument {
+
/**
* The Tag
- */
+ */
private String fieldTag;
/**
* Constructor for TagArgument.
*/
- private TagArgument()
- {
+ private TagArgument() {
super();
}
-
+
/**
* Constructor for TagArgument.
+ *
* @param token
*/
- public TagArgument(Token token)
- {
+ public TagArgument(Token token) {
this();
setTag(token);
}
/**
* Method setTag.
+ *
* @param token
*/
- protected void setTag(Token token)
- {
+ protected void setTag(Token token) {
setTag(token.image);
}
-
/**
* Returns the tag.
+ *
* @return String
*/
- public String getTag()
- {
+ public String getTag() {
return fieldTag;
}
/**
* Sets the tag.
- * @param tag The tag to set
+ *
+ * @param tag
+ * The tag to set
*/
- protected void setTag(String tag)
- {
+ protected void setTag(String tag) {
fieldTag = tag;
}
/**
* @see org.apache.jsieve.Argument#getValue()
*/
- public Object getValue()
- {
+ public Object getValue() {
return getTag();
}
/**
* @see java.lang.Object#toString()
*/
- public String toString()
- {
+ public String toString() {
return (getValue() == null) ? "null" : getValue().toString();
}
Modified: james/jsieve/trunk/src/main/java/org/apache/jsieve/Test.java
URL: http://svn.apache.org/viewvc/james/jsieve/trunk/src/main/java/org/apache/jsieve/Test.java?rev=578033&r1=578032&r2=578033&view=diff
==============================================================================
--- james/jsieve/trunk/src/main/java/org/apache/jsieve/Test.java (original)
+++ james/jsieve/trunk/src/main/java/org/apache/jsieve/Test.java Fri Sep 21 02:32:00 2007
@@ -17,7 +17,6 @@
* under the License. *
****************************************************************/
-
package org.apache.jsieve;
import org.apache.commons.logging.Log;
@@ -26,101 +25,97 @@
import org.apache.jsieve.mail.*;
/**
- * <p>A parsed representation of an RFC3028 test argument...</p>
+ * <p>
+ * A parsed representation of an RFC3028 test argument...
+ * </p>
*
* <code>test = identifier arguments</code>
*/
-public class Test implements Executable
-{
+public class Test implements Executable {
private SieveContext context;
-
+
// The name of this Test
private String fieldName;
-
+
// The arguments for this Test
private Arguments fieldArguments;
-
+
/**
* @see org.apache.jsieve.Executable#execute(MailAdapter)
*/
- public Object execute(MailAdapter mail) throws SieveException
- {
+ public Object execute(MailAdapter mail) throws SieveException {
Log log = Logger.getLog();
if (log.isDebugEnabled()) {
log.debug(toString());
}
- return new Boolean(
- TestManager.getInstance().newInstance(getName()).execute(
- mail,
- getArguments(), context));
+ return new Boolean(TestManager.getInstance().newInstance(getName())
+ .execute(mail, getArguments(), context));
}
/**
* Constructor for Test.
*/
- private Test()
- {
+ private Test() {
super();
}
-
+
/**
* Constructor for Test.
+ *
* @param name
* @param arguments
*/
- public Test(String name, Arguments arguments, SieveContext context)
- {
+ public Test(String name, Arguments arguments, SieveContext context) {
this();
this.context = context;
setName(name);
setArguments(arguments);
- }
+ }
/**
* Returns the arguments.
+ *
* @return Arguments
*/
- public Arguments getArguments()
- {
+ public Arguments getArguments() {
return fieldArguments;
}
/**
* Returns the name.
+ *
* @return String
*/
- public String getName()
- {
+ public String getName() {
return fieldName;
}
/**
* Sets the arguments.
- * @param arguments The arguments to set
+ *
+ * @param arguments
+ * The arguments to set
*/
- protected void setArguments(Arguments arguments)
- {
+ protected void setArguments(Arguments arguments) {
fieldArguments = arguments;
}
/**
* Sets the name.
- * @param name The name to set
+ *
+ * @param name
+ * The name to set
*/
- protected void setName(String name)
- {
+ protected void setName(String name) {
fieldName = name;
}
/**
* @see java.lang.Object#toString()
*/
- public String toString()
- {
- return "Test name: "
- + getName()
- + " "
- + (getArguments() == null ? "null" : getArguments().toString());
+ public String toString() {
+ return "Test name: " + getName() + " "
+ + (getArguments() == null ? "null" : getArguments().toString());
}
}
Modified: james/jsieve/trunk/src/main/java/org/apache/jsieve/TestList.java
URL: http://svn.apache.org/viewvc/james/jsieve/trunk/src/main/java/org/apache/jsieve/TestList.java?rev=578033&r1=578032&r2=578033&view=diff
==============================================================================
--- james/jsieve/trunk/src/main/java/org/apache/jsieve/TestList.java (original)
+++ james/jsieve/trunk/src/main/java/org/apache/jsieve/TestList.java Fri Sep 21 02:32:00 2007
@@ -17,7 +17,6 @@
* under the License. *
****************************************************************/
-
package org.apache.jsieve;
import java.util.ArrayList;
@@ -28,78 +27,79 @@
import org.apache.jsieve.mail.*;
/**
- * <p>A parsed representation of an RFC3028 testlist argument...</p>
+ * <p>
+ * A parsed representation of an RFC3028 testlist argument...
+ * </p>
*
* <code>test-list = "(" test *("," test) ")"</code>
*/
-public class TestList implements Executable
-{
+public class TestList implements Executable {
/**
* List of Tests
- */
+ */
private List fieldTests;
/**
* Constructor for TestList.
*/
- private TestList()
- {
+ private TestList() {
super();
}
-
+
/**
* Constructor for TestList.
- * @param children - A List of Tests
+ *
+ * @param children -
+ * A List of Tests
*/
- public TestList(List children)
- {
+ public TestList(List children) {
this();
setTests(children);
}
-
+
/**
* Constructor for TestList.
- * @param child - A Test
+ *
+ * @param child -
+ * A Test
*/
- public TestList(Test child)
- {
+ public TestList(Test child) {
this();
List children = new ArrayList();
children.add(child);
- setTests( children);
- }
+ setTests(children);
+ }
/**
* @see org.apache.jsieve.Executable#execute(MailAdapter)
*/
- public Object execute(MailAdapter mail) throws SieveException
- {
+ public Object execute(MailAdapter mail) throws SieveException {
boolean result = true;
Iterator testsIter = getTests().iterator();
- while (result && testsIter.hasNext())
- {
- result =
- ((Boolean) ((Test) testsIter.next()).execute(mail)).booleanValue();
+ while (result && testsIter.hasNext()) {
+ result = ((Boolean) ((Test) testsIter.next()).execute(mail))
+ .booleanValue();
}
return new Boolean(result);
}
/**
* Returns the children.
+ *
* @return List
*/
- public List getTests()
- {
+ public List getTests() {
return fieldTests;
}
/**
* Sets the children.
- * @param children The children to set
+ *
+ * @param children
+ * The children to set
*/
- protected void setTests(List children)
- {
+ protected void setTests(List children) {
fieldTests = children;
}
@@ -107,5 +107,4 @@
return "TEST LIST: " + fieldTests;
}
-
}
Modified: james/jsieve/trunk/src/main/java/org/apache/jsieve/TestManager.java
URL: http://svn.apache.org/viewvc/james/jsieve/trunk/src/main/java/org/apache/jsieve/TestManager.java?rev=578033&r1=578032&r2=578033&view=diff
==============================================================================
--- james/jsieve/trunk/src/main/java/org/apache/jsieve/TestManager.java (original)
+++ james/jsieve/trunk/src/main/java/org/apache/jsieve/TestManager.java Fri Sep 21 02:32:00 2007
@@ -17,204 +17,184 @@
* under the License. *
****************************************************************/
-
package org.apache.jsieve;
+
import java.util.Map;
import org.apache.jsieve.exception.LookupException;
import org.apache.jsieve.tests.ExecutableTest;
/**
- * Singleton class <code>TestManager</code> maps Test names to configured
- * Test implementation classes.
+ * Singleton class <code>TestManager</code> maps Test names to configured Test
+ * implementation classes.
*/
-public class TestManager
-{
+public class TestManager {
/**
* The sole instance of the receiver.
- */
+ */
static private TestManager fieldInstance;
/**
* Constructor for TestManager.
*/
- public TestManager()
- {
+ public TestManager() {
super();
}
/**
- * Returns the sole instance of the reciever, lazily initialised if required.
+ * Returns the sole instance of the reciever, lazily initialised if
+ * required.
+ *
* @return CommandManager
*/
- public static TestManager getInstance()
- {
+ public static TestManager getInstance() {
TestManager current = null;
- if (null == (current = getInstanceBasic()))
- {
+ if (null == (current = getInstanceBasic())) {
updateInstance();
return getInstance();
- }
+ }
return current;
}
-
+
/**
* Returns the sole instance of the reciever.
+ *
* @return CommandManager
*/
- private static TestManager getInstanceBasic()
- {
+ private static TestManager getInstanceBasic() {
return fieldInstance;
}
-
+
/**
* Computes a new instance of the receiver.
+ *
* @return CommandManager
*/
- protected static TestManager computeInstance()
- {
+ protected static TestManager computeInstance() {
return new TestManager();
- }
+ }
/**
* Sets the sole instance of the reciever.
- * @param instance The instance to set
+ *
+ * @param instance
+ * The instance to set
*/
- protected static void setInstance(TestManager instance)
- {
+ protected static void setInstance(TestManager instance) {
fieldInstance = instance;
}
-
+
/**
* Resets the sole instance of the reciever.
*/
- public static void resetInstance()
- {
+ public static void resetInstance() {
setInstance(null);
- }
-
+ }
-
-
/**
* Updates the sole instance of the reciever.
*/
- protected static void updateInstance()
- {
+ protected static void updateInstance() {
setInstance(computeInstance());
}
-
+
/**
- * <p>Method lookup answers the class to which a Test name is mapped.</p>
+ * <p>
+ * Method lookup answers the class to which a Test name is mapped.
+ * </p>
*
- * @param name - The name of the Test
+ * @param name -
+ * The name of the Test
* @return Class - The class of the Test
* @throws LookupException
*/
- public Class lookup(String name) throws LookupException
- {
+ public Class lookup(String name) throws LookupException {
Class testClass = null;
- try
- {
- testClass =
- getClass().getClassLoader().loadClass(getClassName(name));
- }
- catch (ClassNotFoundException e)
- {
+ try {
+ testClass = getClass().getClassLoader().loadClass(
+ getClassName(name));
+ } catch (ClassNotFoundException e) {
throw new LookupException("Test named '" + name + "' not found.");
- }
+ }
if (!ExecutableTest.class.isAssignableFrom(testClass))
- throw new LookupException(
- "Class "
- + testClass.getName()
- + " must implement "
- + ExecutableTest.class.getName());
+ throw new LookupException("Class " + testClass.getName()
+ + " must implement " + ExecutableTest.class.getName());
return testClass;
}
-
+
/**
- * <p>Method newInstance answers an instance of the class to which a Test name
- * is mapped.</p>
+ * <p>
+ * Method newInstance answers an instance of the class to which a Test name
+ * is mapped.
+ * </p>
*
- * @param name - The name of the Test
+ * @param name -
+ * The name of the Test
* @return Class - The class of the Test
* @throws LookupException
- */
- public ExecutableTest newInstance(String name) throws LookupException
- {
- try
- {
- return (ExecutableTest)lookup(name).newInstance();
- }
- catch (InstantiationException e)
- {
+ */
+ public ExecutableTest newInstance(String name) throws LookupException {
+ try {
+ return (ExecutableTest) lookup(name).newInstance();
+ } catch (InstantiationException e) {
throw new LookupException(e.getMessage());
- }
- catch (IllegalAccessException e)
- {
+ } catch (IllegalAccessException e) {
throw new LookupException(e.getMessage());
}
- }
-
+ }
+
/**
- * Method isSupported answers a boolean indicating if a Test name is
+ * Method isSupported answers a boolean indicating if a Test name is
* configured.
- * @param name - The Test name
+ *
+ * @param name -
+ * The Test name
* @return boolean - True if the Test name is configured.
*/
- public boolean isSupported(String name)
- {
+ public boolean isSupported(String name) {
boolean isSupported = true;
- try
- {
+ try {
lookup(name);
- }
- catch (LookupException e)
- {
+ } catch (LookupException e) {
isSupported = false;
}
return isSupported;
- }
-
+ }
+
/**
- * <p>Method getClassName answers the name of the class to which a Test name is
- * mapped.</p>
+ * <p>
+ * Method getClassName answers the name of the class to which a Test name is
+ * mapped.
+ * </p>
*
- * @param name - The name of the Test
+ * @param name -
+ * The name of the Test
* @return String - The name of the class
* @throws LookupException
*/
- protected String getClassName(String name)
- throws LookupException
- {
+ protected String getClassName(String name) throws LookupException {
String className;
- try
- {
+ try {
className = (String) getClassNameMap().get(name.toLowerCase());
- }
- catch (SieveConfigurationException e)
- {
+ } catch (SieveConfigurationException e) {
throw new LookupException(
- "Lookup failed due to a Configuration Exception: "
- + e.getMessage());
+ "Lookup failed due to a Configuration Exception: "
+ + e.getMessage());
}
if (null == className)
throw new LookupException("Test named '" + name + "' not mapped.");
return className;
}
-
/**
* Method getClassNameMap answers a Map of Test names and their class names.
+ *
* @return Map
* @throws SieveConfigurationException
*/
- protected Map getClassNameMap() throws SieveConfigurationException
- {
+ protected Map getClassNameMap() throws SieveConfigurationException {
return ConfigurationManager.getInstance().getTestMap();
- }
-
-
+ }
}
Modified: james/jsieve/trunk/src/main/java/org/apache/jsieve/commands/AbstractActionCommand.java
URL: http://svn.apache.org/viewvc/james/jsieve/trunk/src/main/java/org/apache/jsieve/commands/AbstractActionCommand.java?rev=578033&r1=578032&r2=578033&view=diff
==============================================================================
--- james/jsieve/trunk/src/main/java/org/apache/jsieve/commands/AbstractActionCommand.java (original)
+++ james/jsieve/trunk/src/main/java/org/apache/jsieve/commands/AbstractActionCommand.java Fri Sep 21 02:32:00 2007
@@ -17,7 +17,6 @@
* under the License. *
****************************************************************/
-
package org.apache.jsieve.commands;
import org.apache.jsieve.CommandStateManager;
@@ -25,43 +24,51 @@
import org.apache.jsieve.exception.CommandException;
/**
- * Abstract class AbstractActionCommand defines the common state validation and state
- * update behavior for Action Commands as per RFC 3028, section 8.
+ * Abstract class AbstractActionCommand defines the common state validation and
+ * state update behavior for Action Commands as per RFC 3028, section 8.
*/
-public abstract class AbstractActionCommand extends AbstractBodyCommand
-{
+public abstract class AbstractActionCommand extends AbstractBodyCommand {
/**
* Constructor for AbstractActionCommand.
*/
- public AbstractActionCommand()
- {
+ public AbstractActionCommand() {
super();
}
-
+
/**
- * <p>Method updateState() updates the CommandStateManager to indicate an Action
- * Command has been processed and to cancel implicit keep.</p>
+ * <p>
+ * Method updateState() updates the CommandStateManager to indicate an
+ * Action Command has been processed and to cancel implicit keep.
+ * </p>
+ *
+ * <p>
+ * Also,
*
- * <p>Also, @see org.apache.jsieve.commands.AbstractCommand#updateState()</p>
+ * @see org.apache.jsieve.commands.AbstractCommand#updateState()
+ * </p>
*/
- protected void updateState()
- {
+ protected void updateState() {
super.updateState();
CommandStateManager.getInstance().setHasActions(true);
- CommandStateManager.getInstance().setImplicitKeep(false);
+ CommandStateManager.getInstance().setImplicitKeep(false);
}
/**
- * <p>Method validateState() validates via the CommandStateManager that an
- * Action Command is legal at this time.</p>
+ * <p>
+ * Method validateState() validates via the CommandStateManager that an
+ * Action Command is legal at this time.
+ * </p>
*
- * <p>Also, @see org.apache.jsieve.commands.AbstractCommand#validateState()
+ * <p>
+ * Also,
+ *
+ * @see org.apache.jsieve.commands.AbstractCommand#validateState()
*/
- protected void validateState(SieveContext context) throws CommandException
- {
+ protected void validateState(SieveContext context) throws CommandException {
if (CommandStateManager.getInstance().isRejected())
- throw context.getCoordinate().commandException("Cannot perform Actions on a rejected message.");
- }
-
+ throw context.getCoordinate().commandException(
+ "Cannot perform Actions on a rejected message.");
+ }
+
}
Modified: james/jsieve/trunk/src/main/java/org/apache/jsieve/commands/AbstractBodyCommand.java
URL: http://svn.apache.org/viewvc/james/jsieve/trunk/src/main/java/org/apache/jsieve/commands/AbstractBodyCommand.java?rev=578033&r1=578032&r2=578033&view=diff
==============================================================================
--- james/jsieve/trunk/src/main/java/org/apache/jsieve/commands/AbstractBodyCommand.java (original)
+++ james/jsieve/trunk/src/main/java/org/apache/jsieve/commands/AbstractBodyCommand.java Fri Sep 21 02:32:00 2007
@@ -17,36 +17,37 @@
* under the License. *
****************************************************************/
-
package org.apache.jsieve.commands;
import org.apache.jsieve.CommandStateManager;
-
/**
- * Abstract class AbstractBodyCommand defines the common state update behavior for
- * Body Commands. All Commands which are not PrologCommands are Body Commands.
+ * Abstract class AbstractBodyCommand defines the common state update behavior
+ * for Body Commands. All Commands which are not PrologCommands are Body
+ * Commands.
*/
-public abstract class AbstractBodyCommand extends AbstractCommand
-{
+public abstract class AbstractBodyCommand extends AbstractCommand {
/**
* Constructor for AbstractBodyCommand.
*/
- public AbstractBodyCommand()
- {
+ public AbstractBodyCommand() {
super();
}
-
+
/**
- * <p>Method updateState() updates the CommandStateManager to indicate a Body
- * Command has been processed.</p>
+ * <p>
+ * Method updateState() updates the CommandStateManager to indicate a Body
+ * Command has been processed.
+ * </p>
*
- * <p>Also, @see org.apache.jsieve.commands.AbstractCommand#updateState()
+ * <p>
+ * Also,
+ *
+ * @see org.apache.jsieve.commands.AbstractCommand#updateState()
*/
- protected void updateState()
- {
- CommandStateManager.getInstance().setInProlog(false);
- }
+ protected void updateState() {
+ CommandStateManager.getInstance().setInProlog(false);
+ }
}
Modified: james/jsieve/trunk/src/main/java/org/apache/jsieve/commands/AbstractCommand.java
URL: http://svn.apache.org/viewvc/james/jsieve/trunk/src/main/java/org/apache/jsieve/commands/AbstractCommand.java?rev=578033&r1=578032&r2=578033&view=diff
==============================================================================
--- james/jsieve/trunk/src/main/java/org/apache/jsieve/commands/AbstractCommand.java (original)
+++ james/jsieve/trunk/src/main/java/org/apache/jsieve/commands/AbstractCommand.java Fri Sep 21 02:32:00 2007
@@ -17,7 +17,6 @@
* under the License. *
****************************************************************/
-
package org.apache.jsieve.commands;
import org.apache.jsieve.Arguments;
@@ -29,105 +28,114 @@
import org.apache.jsieve.mail.MailAdapter;
/**
- * Abstract class AbstractCommand defines a framework of common behavior for
- * Sieve Commands.
+ * Abstract class AbstractCommand defines a framework of common behavior for
+ * Sieve Commands.
*/
-public abstract class AbstractCommand implements ExecutableCommand
-{
+public abstract class AbstractCommand implements ExecutableCommand {
/**
* Constructor for AbstractCommand.
*/
- public AbstractCommand()
- {
+ public AbstractCommand() {
super();
}
-
+
/**
- * Framework method validateState is invoked before a Sieve Command is
+ * Framework method validateState is invoked before a Sieve Command is
* executed to validate its state. Subclass methods are expected to override
* or extend this method to perform their own validation as appropriate.
- * @param context <code>SieveContext</code> giving contextual information,
- * not null
+ *
+ * @param context
+ * <code>SieveContext</code> giving contextual information,
+ * not null
* @throws CommandException
*/
- protected void validateState(SieveContext context)
- throws CommandException
- {
- }
-
- /**
- * Framework method updateState is invoked after a Sieve Command has executed to
- * update the Sieve state. Subclass methods are expected to override or extend
- * this method to update state as appropriate.
- */
- protected void updateState()
- {
- }
-
+ protected void validateState(SieveContext context) throws CommandException {
+ }
+
+ /**
+ * Framework method updateState is invoked after a Sieve Command has
+ * executed to update the Sieve state. Subclass methods are expected to
+ * override or extend this method to update state as appropriate.
+ */
+ protected void updateState() {
+ }
+
/**
- * Framework method validateArguments is invoked before a Sieve Command is
- * executed to validate its arguments. Subclass methods are expected to override
- * or extend this method to perform their own validation as appropriate.
+ * Framework method validateArguments is invoked before a Sieve Command is
+ * executed to validate its arguments. Subclass methods are expected to
+ * override or extend this method to perform their own validation as
+ * appropriate.
*
* @param arguments
- * @param context <code>SieveContext</code> giving contextual information,
- * not null
+ * @param context
+ * <code>SieveContext</code> giving contextual information,
+ * not null
* @throws SieveException
*/
- protected void validateArguments(Arguments arguments, SieveContext context) throws SieveException
- {
+ protected void validateArguments(Arguments arguments, SieveContext context)
+ throws SieveException {
if (!arguments.getArgumentList().isEmpty())
- throw context.getCoordinate().syntaxException("Found unexpected arguments");
+ throw context.getCoordinate().syntaxException(
+ "Found unexpected arguments");
}
-
+
/**
- * Framework method validateBlock is invoked before a Sieve Command is
+ * Framework method validateBlock is invoked before a Sieve Command is
* executed to validate its Block. Subclass methods are expected to override
* or extend this method to perform their own validation as appropriate.
*
* @param block
- * @param context <code>ScriptCoordinate</code> giving positional information,
- * not null
+ * @param context
+ * <code>ScriptCoordinate</code> giving positional
+ * information, not null
* @throws SieveException
*/
protected void validateBlock(Block block, SieveContext context)
- throws SieveException
- {
+ throws SieveException {
if (null != block)
- throw context.getCoordinate().syntaxException("Found unexpected Block. Missing ';'?");
- }
-
- /**
- * <p>Method execute executes a basic Sieve Command after first invoking framework
- * methods to validate that Sieve is in a legal state to invoke the Command and
- * that the Command arguments are legal. After invocation, a framework method is
- * invoked to update the state.</p>
- *
- * <p>Also, @see org.apache.jsieve.Executable#execute()</p>
- */
- public Object execute(MailAdapter mail, Arguments arguments, Block block, SieveContext context)
- throws SieveException
- {
+ throw context.getCoordinate().syntaxException(
+ "Found unexpected Block. Missing ';'?");
+ }
+
+ /**
+ * <p>
+ * Method execute executes a basic Sieve Command after first invoking
+ * framework methods to validate that Sieve is in a legal state to invoke
+ * the Command and that the Command arguments are legal. After invocation, a
+ * framework method is invoked to update the state.
+ * </p>
+ *
+ * <p>
+ * Also,
+ *
+ * @see org.apache.jsieve.Executable#execute()
+ * </p>
+ */
+ public Object execute(MailAdapter mail, Arguments arguments, Block block,
+ SieveContext context) throws SieveException {
validateState(context);
- validateArguments(arguments, context);
- validateBlock(block, context);
- Object result = executeBasic( mail, arguments, block, context);
+ validateArguments(arguments, context);
+ validateBlock(block, context);
+ Object result = executeBasic(mail, arguments, block, context);
updateState();
return result;
- }
-
+ }
+
/**
* Abstract method executeBasic invokes a Sieve Command.
+ *
* @param mail
* @param arguments
* @param block
- * @param context <code>SieveContext</code> giving contextual information,
- * not null
+ * @param context
+ * <code>SieveContext</code> giving contextual information,
+ * not null
* @return Object
* @throws SieveException
*/
- abstract protected Object executeBasic(MailAdapter mail, Arguments arguments, Block block, SieveContext context)
- throws SieveException;
+ abstract protected Object executeBasic(MailAdapter mail,
+ Arguments arguments, Block block, SieveContext context)
+ throws SieveException;
}
Modified: james/jsieve/trunk/src/main/java/org/apache/jsieve/commands/AbstractConditionalCommand.java
URL: http://svn.apache.org/viewvc/james/jsieve/trunk/src/main/java/org/apache/jsieve/commands/AbstractConditionalCommand.java?rev=578033&r1=578032&r2=578033&view=diff
==============================================================================
--- james/jsieve/trunk/src/main/java/org/apache/jsieve/commands/AbstractConditionalCommand.java (original)
+++ james/jsieve/trunk/src/main/java/org/apache/jsieve/commands/AbstractConditionalCommand.java Fri Sep 21 02:32:00 2007
@@ -17,7 +17,6 @@
* under the License. *
****************************************************************/
-
package org.apache.jsieve.commands;
import org.apache.jsieve.Block;
@@ -27,58 +26,52 @@
import org.apache.jsieve.mail.MailAdapter;
/**
- * Abstract class AbstractConditionalCommand defines a framework of common behavior
- * for conditional Commands (if, elsif, else). Conditional commands use a
- * ConditionManager to relate and validate Commands within their Blocks.
- */
-public abstract class AbstractConditionalCommand extends AbstractControlCommand
-{
+ * Abstract class AbstractConditionalCommand defines a framework of common
+ * behavior for conditional Commands (if, elsif, else). Conditional commands use
+ * a ConditionManager to relate and validate Commands within their Blocks.
+ */
+public abstract class AbstractConditionalCommand extends AbstractControlCommand {
/**
* Constructor for AbstractConditionalCommand.
*/
- public AbstractConditionalCommand()
- {
+ public AbstractConditionalCommand() {
super();
}
/**
- * Method execute executes a Block within the context of a new ConditionManager.
+ * Method execute executes a Block within the context of a new
+ * ConditionManager.
+ *
* @param mail
* @param block
* @return Object
* @throws SieveException
*/
- protected Object execute(MailAdapter mail, Block block) throws SieveException
- {
+ protected Object execute(MailAdapter mail, Block block)
+ throws SieveException {
// Switch to a new ConditionManager
ConditionManager oldManager = ConditionManager.getInstance();
ConditionManager.resetInstance();
- try
- {
+ try {
// Execute the Block
Object result = block.execute(mail);
return result;
- }
- finally
- {
+ } finally {
// Always restore the old ConditionManager
ConditionManager.setInstance(oldManager);
}
}
-
+
/**
- * @see org.apache.jsieve.commands.AbstractCommand#validateBlock(Block, SieveContext)
+ * @see org.apache.jsieve.commands.AbstractCommand#validateBlock(Block,
+ * SieveContext)
*/
protected void validateBlock(Block block, SieveContext context)
- throws SieveException
- {
+ throws SieveException {
if (null == block)
- throw context.getCoordinate().syntaxException("Expecting a Block.");
- }
-
-
-
+ throw context.getCoordinate().syntaxException("Expecting a Block.");
+ }
}
Modified: james/jsieve/trunk/src/main/java/org/apache/jsieve/commands/AbstractControlCommand.java
URL: http://svn.apache.org/viewvc/james/jsieve/trunk/src/main/java/org/apache/jsieve/commands/AbstractControlCommand.java?rev=578033&r1=578032&r2=578033&view=diff
==============================================================================
--- james/jsieve/trunk/src/main/java/org/apache/jsieve/commands/AbstractControlCommand.java (original)
+++ james/jsieve/trunk/src/main/java/org/apache/jsieve/commands/AbstractControlCommand.java Fri Sep 21 02:32:00 2007
@@ -17,22 +17,19 @@
* under the License. *
****************************************************************/
-
package org.apache.jsieve.commands;
/**
- * Abstract class AbstractControlCommand defines a framework of common behavior
- * for control Commands as defined in RFC 3028, section 3.
+ * Abstract class AbstractControlCommand defines a framework of common behavior
+ * for control Commands as defined in RFC 3028, section 3.
*/
-public abstract class AbstractControlCommand extends AbstractBodyCommand
-{
+public abstract class AbstractControlCommand extends AbstractBodyCommand {
/**
* Constructor for AbstractControlCommand.
*/
- public AbstractControlCommand()
- {
+ public AbstractControlCommand() {
super();
}
Modified: james/jsieve/trunk/src/main/java/org/apache/jsieve/commands/AbstractPrologCommand.java
URL: http://svn.apache.org/viewvc/james/jsieve/trunk/src/main/java/org/apache/jsieve/commands/AbstractPrologCommand.java?rev=578033&r1=578032&r2=578033&view=diff
==============================================================================
--- james/jsieve/trunk/src/main/java/org/apache/jsieve/commands/AbstractPrologCommand.java (original)
+++ james/jsieve/trunk/src/main/java/org/apache/jsieve/commands/AbstractPrologCommand.java Fri Sep 21 02:32:00 2007
@@ -17,7 +17,6 @@
* under the License. *
****************************************************************/
-
package org.apache.jsieve.commands;
import org.apache.jsieve.CommandStateManager;
@@ -25,36 +24,39 @@
import org.apache.jsieve.exception.CommandException;
/**
- * <p>Abstract class AbstractPrologCommand defines the common state validation behavior
- * for Prolog Commands. In RFC 3028 the only Prolog Command is 'requires', however,
- * the specification may evolve.</p>
+ * <p>
+ * Abstract class AbstractPrologCommand defines the common state validation
+ * behavior for Prolog Commands. In RFC 3028 the only Prolog Command is
+ * 'requires', however, the specification may evolve.
+ * </p>
*/
-public abstract class AbstractPrologCommand extends AbstractCommand
-{
+public abstract class AbstractPrologCommand extends AbstractCommand {
/**
* Constructor for AbstractPrologCommand.
*/
- public AbstractPrologCommand()
- {
+ public AbstractPrologCommand() {
super();
}
/**
- * <p>Method validateState() ensures, via the CommandStateManager, that a Prolog
- * Command is permissible.</p>
+ * <p>
+ * Method validateState() ensures, via the CommandStateManager, that a
+ * Prolog Command is permissible.
+ * </p>
+ *
+ * <p>
+ * Also,
*
- * <p>Also, @see org.apache.jsieve.commands.AbstractCommand#validateState()</p>
+ * @see org.apache.jsieve.commands.AbstractCommand#validateState()
+ * </p>
*/
- protected void validateState(SieveContext context)
- throws CommandException
- {
+ protected void validateState(SieveContext context) throws CommandException {
super.validateState(context);
-
+
if (!(CommandStateManager.getInstance().isInProlog()))
- throw context.getCoordinate().commandException("Invalid state for a prolog command.");
+ throw context.getCoordinate().commandException(
+ "Invalid state for a prolog command.");
}
-
-
}
Modified: james/jsieve/trunk/src/main/java/org/apache/jsieve/commands/Discard.java
URL: http://svn.apache.org/viewvc/james/jsieve/trunk/src/main/java/org/apache/jsieve/commands/Discard.java?rev=578033&r1=578032&r2=578033&view=diff
==============================================================================
--- james/jsieve/trunk/src/main/java/org/apache/jsieve/commands/Discard.java (original)
+++ james/jsieve/trunk/src/main/java/org/apache/jsieve/commands/Discard.java Fri Sep 21 02:32:00 2007
@@ -17,7 +17,6 @@
* under the License. *
****************************************************************/
-
package org.apache.jsieve.commands;
import org.apache.jsieve.Arguments;
@@ -27,30 +26,32 @@
import org.apache.jsieve.mail.MailAdapter;
/**
- * Class Discard implements the Discard Command as defined in RFC 3028, section 4.5.
+ * Class Discard implements the Discard Command as defined in RFC 3028, section
+ * 4.5.
*/
-public class Discard extends AbstractActionCommand
-{
+public class Discard extends AbstractActionCommand {
/**
* Constructor for Discard.
*/
- public Discard()
- {
+ public Discard() {
super();
}
/**
- * <p>Discard silently discards a Mail by cancelling the implicit keep as
- * specified in RFC 3028, Section 4.5.</p>
- *<p>
- * @see org.apache.jsieve.commands.AbstractCommand#executeBasic(MailAdapter, Arguments, Block, SieveContext)
+ * <p>
+ * Discard silently discards a Mail by cancelling the implicit keep as
+ * specified in RFC 3028, Section 4.5.
* </p>
- */
- protected Object executeBasic(MailAdapter mail, Arguments arguments, Block block, SieveContext context)
- throws SieveException
- {
-// mail.addAction(new ActionDiscard());
+ * <p>
+ *
+ * @see org.apache.jsieve.commands.AbstractCommand#executeBasic(MailAdapter,
+ * Arguments, Block, SieveContext)
+ * </p>
+ */
+ protected Object executeBasic(MailAdapter mail, Arguments arguments,
+ Block block, SieveContext context) throws SieveException {
+ // mail.addAction(new ActionDiscard());
return null;
}
Modified: james/jsieve/trunk/src/main/java/org/apache/jsieve/commands/Else.java
URL: http://svn.apache.org/viewvc/james/jsieve/trunk/src/main/java/org/apache/jsieve/commands/Else.java?rev=578033&r1=578032&r2=578033&view=diff
==============================================================================
--- james/jsieve/trunk/src/main/java/org/apache/jsieve/commands/Else.java (original)
+++ james/jsieve/trunk/src/main/java/org/apache/jsieve/commands/Else.java Fri Sep 21 02:32:00 2007
@@ -17,7 +17,6 @@
* under the License. *
****************************************************************/
-
package org.apache.jsieve.commands;
import org.apache.jsieve.Arguments;
@@ -30,50 +29,46 @@
/**
* Class Else implements the Else Command as defined in RFC 3028, section 3.1.
*/
-public class Else extends AbstractConditionalCommand
-{
-
+public class Else extends AbstractConditionalCommand {
+
/**
* Constructor for Else.
*/
- public Else()
- {
+ public Else() {
super();
- }
+ }
/**
- * <p>Conditionally eexecute a Block if an Else Condition is runnable.</p>
- * <p>Also,
- * @see org.apache.jsieve.commands.AbstractCommand#executeBasic(MailAdapter, Arguments, Block, SieveContext)
+ * <p>
+ * Conditionally eexecute a Block if an Else Condition is runnable.
* </p>
+ * <p>
+ * Also,
+ *
+ * @see org.apache.jsieve.commands.AbstractCommand#executeBasic(MailAdapter,
+ * Arguments, Block, SieveContext)
+ * </p>
*/
- protected Object executeBasic(
- MailAdapter mail,
- Arguments arguments,
- Block block, SieveContext context)
- throws SieveException
- {
+ protected Object executeBasic(MailAdapter mail, Arguments arguments,
+ Block block, SieveContext context) throws SieveException {
// Check Syntax
if (!ConditionManager.getInstance().isElseAllowed())
- throw context.getCoordinate().commandException("Unexpected Command: \"else\".");
+ throw context.getCoordinate().commandException(
+ "Unexpected Command: \"else\".");
- // Check Runnable
+ // Check Runnable
if (!ConditionManager.getInstance().isElseRunnable())
return Boolean.FALSE;
- // Execute the Block
+ // Execute the Block
execute(mail, block);
// Update the ConditionManager
- // 'Else' is always true
+ // 'Else' is always true
ConditionManager.getInstance().setElseTestResult(true);
// Return the result
return Boolean.TRUE;
}
-
-
-
-
}
Modified: james/jsieve/trunk/src/main/java/org/apache/jsieve/commands/Elsif.java
URL: http://svn.apache.org/viewvc/james/jsieve/trunk/src/main/java/org/apache/jsieve/commands/Elsif.java?rev=578033&r1=578032&r2=578033&view=diff
==============================================================================
--- james/jsieve/trunk/src/main/java/org/apache/jsieve/commands/Elsif.java (original)
+++ james/jsieve/trunk/src/main/java/org/apache/jsieve/commands/Elsif.java Fri Sep 21 02:32:00 2007
@@ -17,7 +17,6 @@
* under the License. *
****************************************************************/
-
package org.apache.jsieve.commands;
import org.apache.jsieve.Arguments;
@@ -31,65 +30,62 @@
/**
* Class Elsif implements the Elsif Command as defined in RFC 3028, section 3.1.
*/
-public class Elsif extends AbstractConditionalCommand
-{
-
+public class Elsif extends AbstractConditionalCommand {
+
/**
* Constructor for Elsif.
*/
- public Elsif()
- {
+ public Elsif() {
super();
- }
+ }
/**
- * <p>Conditionally eexecute a Block if an Elsif Condition is allowed and
- * runnable.</p>
- * <p>Also,
- * @see org.apache.jsieve.commands.AbstractCommand#executeBasic(MailAdapter, Arguments, Block, SieveContext)
+ * <p>
+ * Conditionally eexecute a Block if an Elsif Condition is allowed and
+ * runnable.
* </p>
+ * <p>
+ * Also,
+ *
+ * @see org.apache.jsieve.commands.AbstractCommand#executeBasic(MailAdapter,
+ * Arguments, Block, SieveContext)
+ * </p>
*/
- protected Object executeBasic(MailAdapter mail, Arguments arguments, Block block, SieveContext context)
- throws SieveException
- {
+ protected Object executeBasic(MailAdapter mail, Arguments arguments,
+ Block block, SieveContext context) throws SieveException {
// Check Syntax
if (!ConditionManager.getInstance().isElsifAllowed())
- throw context.getCoordinate().commandException("Unexpected Command: \"elsif\".");
+ throw context.getCoordinate().commandException(
+ "Unexpected Command: \"elsif\".");
- // Check Runnable
+ // Check Runnable
if (!ConditionManager.getInstance().isElsifRunnable())
return Boolean.FALSE;
// Run the tests
- Boolean isTestPassed = (Boolean) arguments.getTestList().execute(mail);
+ Boolean isTestPassed = (Boolean) arguments.getTestList().execute(mail);
- // If the tests answered TRUE, execute the Block
+ // If the tests answered TRUE, execute the Block
if (isTestPassed.booleanValue())
execute(mail, block);
// Update the ConditionManager
ConditionManager.getInstance().setElsifTestResult(
- isTestPassed.booleanValue());
+ isTestPassed.booleanValue());
// Return the result
return isTestPassed;
}
-
+
/**
- * @see org.apache.jsieve.commands.AbstractCommand#validateArguments(Arguments, SieveContext)
+ * @see org.apache.jsieve.commands.AbstractCommand#validateArguments(Arguments,
+ * SieveContext)
*/
- protected void validateArguments(Arguments arguments, SieveContext context) throws SieveException
- {
+ protected void validateArguments(Arguments arguments, SieveContext context)
+ throws SieveException {
TestList testList = arguments.getTestList();
if (null == testList || testList.getTests().isEmpty())
throw context.getCoordinate().syntaxException("Expecting a Test");
}
-
-
-
-
-
-
-
}
Modified: james/jsieve/trunk/src/main/java/org/apache/jsieve/commands/If.java
URL: http://svn.apache.org/viewvc/james/jsieve/trunk/src/main/java/org/apache/jsieve/commands/If.java?rev=578033&r1=578032&r2=578033&view=diff
==============================================================================
--- james/jsieve/trunk/src/main/java/org/apache/jsieve/commands/If.java (original)
+++ james/jsieve/trunk/src/main/java/org/apache/jsieve/commands/If.java Fri Sep 21 02:32:00 2007
@@ -17,7 +17,6 @@
* under the License. *
****************************************************************/
-
package org.apache.jsieve.commands;
import org.apache.jsieve.Arguments;
@@ -31,61 +30,61 @@
/**
* Class If implements the If Command as defined in RFC 3028, section 3.1.
*/
-public class If extends AbstractConditionalCommand
-{
+public class If extends AbstractConditionalCommand {
/**
* Constructor for If.
*/
- public If()
- {
+ public If() {
super();
- }
-
+ }
/**
- * <p>Conditionally eexecute a Block if an If Condition is allowed and
- * runnable.</p>
- * <p>Also,
- * @see org.apache.jsieve.commands.AbstractCommand#executeBasic(MailAdapter, Arguments, Block, SieveContext)
+ * <p>
+ * Conditionally eexecute a Block if an If Condition is allowed and
+ * runnable.
* </p>
+ * <p>
+ * Also,
+ *
+ * @see org.apache.jsieve.commands.AbstractCommand#executeBasic(MailAdapter,
+ * Arguments, Block, SieveContext)
+ * </p>
*/
- protected Object executeBasic(MailAdapter mail, Arguments arguments, Block block, SieveContext context) throws SieveException
- {
+ protected Object executeBasic(MailAdapter mail, Arguments arguments,
+ Block block, SieveContext context) throws SieveException {
// Check Syntax
if (!ConditionManager.getInstance().isIfAllowed())
throw context.getCoordinate().commandException(
- "Unexpected Command: \"if\".");
-
- // Check Runnable
+ "Unexpected Command: \"if\".");
+
+ // Check Runnable
if (!ConditionManager.getInstance().isIfRunnable())
- return Boolean.FALSE;
-
+ return Boolean.FALSE;
+
// Run the tests
Boolean isTestPassed = (Boolean) arguments.getTestList().execute(mail);
- // If the tests answered TRUE, execute the Block
+ // If the tests answered TRUE, execute the Block
if (isTestPassed.booleanValue())
- execute(mail, block);
+ execute(mail, block);
// Update the ConditionManager
- ConditionManager.getInstance().setIfTestResult(isTestPassed.booleanValue());
+ ConditionManager.getInstance().setIfTestResult(
+ isTestPassed.booleanValue());
// Return the result
return isTestPassed;
}
-
+
/**
- * @see org.apache.jsieve.commands.AbstractCommand#validateArguments(Arguments, SieveContext)
+ * @see org.apache.jsieve.commands.AbstractCommand#validateArguments(Arguments,
+ * SieveContext)
*/
- protected void validateArguments(Arguments arguments, SieveContext context) throws SieveException
- {
+ protected void validateArguments(Arguments arguments, SieveContext context)
+ throws SieveException {
TestList testList = arguments.getTestList();
if (null == testList || testList.getTests().isEmpty())
throw context.getCoordinate().syntaxException("Expecting a Test");
}
-
-
-
-
}
Modified: james/jsieve/trunk/src/main/java/org/apache/jsieve/commands/Keep.java
URL: http://svn.apache.org/viewvc/james/jsieve/trunk/src/main/java/org/apache/jsieve/commands/Keep.java?rev=578033&r1=578032&r2=578033&view=diff
==============================================================================
--- james/jsieve/trunk/src/main/java/org/apache/jsieve/commands/Keep.java (original)
+++ james/jsieve/trunk/src/main/java/org/apache/jsieve/commands/Keep.java Fri Sep 21 02:32:00 2007
@@ -17,7 +17,6 @@
* under the License. *
****************************************************************/
-
package org.apache.jsieve.commands;
import org.apache.jsieve.Arguments;
@@ -30,26 +29,28 @@
/**
* Class Keep implements the Keep Command as defined in RFC 3028, section 4.4.
*/
-public class Keep extends AbstractActionCommand
-{
+public class Keep extends AbstractActionCommand {
/**
* Constructor for Keep.
*/
- public Keep()
- {
+ public Keep() {
super();
}
/**
- * <p>Add an ActionKeep to the List of Actions to be performed.</p>
- * <p>Also,
- * @see org.apache.jsieve.commands.AbstractCommand#executeBasic(MailAdapter, Arguments, Block, SieveContext)
+ * <p>
+ * Add an ActionKeep to the List of Actions to be performed.
* </p>
- */
- protected Object executeBasic(MailAdapter mail, Arguments arguments, Block block, SieveContext context)
- throws SieveException
- {
+ * <p>
+ * Also,
+ *
+ * @see org.apache.jsieve.commands.AbstractCommand#executeBasic(MailAdapter,
+ * Arguments, Block, SieveContext)
+ * </p>
+ */
+ protected Object executeBasic(MailAdapter mail, Arguments arguments,
+ Block block, SieveContext context) throws SieveException {
mail.addAction(new ActionKeep());
return null;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org