org.apache.jsieve.comparators
Class ComparatorUtils

java.lang.Object
  extended by org.apache.jsieve.comparators.ComparatorUtils

public class ComparatorUtils
extends java.lang.Object

Class ComparatorUtils implements utility methods used by Comparators.


Method Summary
static boolean contains(java.lang.String container, java.lang.String contents)
           Method contains answers a boolean indicating if the parameter container contains the parameter contents.
static boolean contains(java.lang.String comparatorName, java.lang.String container, java.lang.String contents, SieveContext context)
          Method contains answers a boolean indicating if the parameter container contains the parameter contents using an instance of comparatorName.
static boolean equals(java.lang.String string1, java.lang.String string2)
           Method equals answers a boolean indicating if the parameter string1 is equal to the parameter string2.
static boolean is(java.lang.String comparatorName, java.lang.String string1, java.lang.String string2, SieveContext context)
          Method is answers a boolean indicating if the parameter container is equal to the parameter contents using an instance of comparatorName.
static boolean match(java.lang.String comparatorName, java.lang.String matchType, java.lang.String matchTarget, java.lang.String matchArgument, SieveContext context)
          Method match answers a boolean indicating if the parameter matchTarget compares to parameter matchArgument is a match of matchType using the comparator comparatorName.
static boolean matches(java.lang.String string, java.lang.String glob)
           Method matches answers a boolean indicating if the parameter string matches the glob pattern described by parameter glob.
static boolean matches(java.lang.String comparatorName, java.lang.String string, java.lang.String glob, SieveContext context)
          Method matches answers a boolean indicating if the parameter string/code> is matched by the patterm glob using an instance of comparatorName.
static java.lang.String sieveToJavaRegex(java.lang.String pattern)
          Converts a Sieve pattern in a java regex pattern
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

match

public static boolean match(java.lang.String comparatorName,
                            java.lang.String matchType,
                            java.lang.String matchTarget,
                            java.lang.String matchArgument,
                            SieveContext context)
                     throws SieveException
Method match answers a boolean indicating if the parameter matchTarget compares to parameter matchArgument is a match of matchType using the comparator comparatorName.

Parameters:
comparatorName - not null
matchType - not null
matchTarget - not null
matchArgument - not null
context - not null
Returns:
boolean
Throws:
SieveException

matches

public static boolean matches(java.lang.String string,
                              java.lang.String glob)
                       throws SievePatternException

Method matches answers a boolean indicating if the parameter string matches the glob pattern described by parameter glob.

Parameters:
string -
glob -
Returns:
boolean
Throws:
SievePatternException

contains

public static boolean contains(java.lang.String container,
                               java.lang.String contents)

Method contains answers a boolean indicating if the parameter container contains the parameter contents.

Parameters:
container -
contents -
Returns:
boolean

equals

public static boolean equals(java.lang.String string1,
                             java.lang.String string2)

Method equals answers a boolean indicating if the parameter string1 is equal to the parameter string2.

Parameters:
string1 -
string2 -
Returns:
boolean

sieveToJavaRegex

public static java.lang.String sieveToJavaRegex(java.lang.String pattern)
Converts a Sieve pattern in a java regex pattern


contains

public static boolean contains(java.lang.String comparatorName,
                               java.lang.String container,
                               java.lang.String contents,
                               SieveContext context)
                        throws SieveException
Method contains answers a boolean indicating if the parameter container contains the parameter contents using an instance of comparatorName.

Parameters:
comparatorName - not null
container - not null
contents - not null
context - not null
Returns:
boolean
Throws:
SieveException

is

public static boolean is(java.lang.String comparatorName,
                         java.lang.String string1,
                         java.lang.String string2,
                         SieveContext context)
                  throws LookupException
Method is answers a boolean indicating if the parameter container is equal to the parameter contents using an instance of comparatorName.

Parameters:
comparatorName -
string1 - not null
string2 - not null
context - not null
Returns:
boolean
Throws:
LookupException

matches

public static boolean matches(java.lang.String comparatorName,
                              java.lang.String string,
                              java.lang.String glob,
                              SieveContext context)
                       throws SieveException
Method matches answers a boolean indicating if the parameter string/code> is matched by the patterm glob using an instance of comparatorName.

Parameters:
comparatorName - not null
string - not null
glob - not null
context - not null
Returns:
boolean
Throws:
SieveException


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