org.apache.jsieve
Class SieveFactory

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.

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.

parse

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.

Parameters:

inputStream -

Returns:

Node

Throws:

org.apache.jsieve.parser.generated.ParseException

evaluate

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.

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.