org.apache.james.mailbox
Class MailboxQuery

java.lang.Object
  extended by org.apache.james.mailbox.MailboxQuery

public class MailboxQuery
extends java.lang.Object

Expresses select criteria for mailboxes.


Constructor Summary
MailboxQuery(MailboxPath base, java.lang.String expression, char freeWildcard, char localWildcard)
          Constructs an expression determining a set of mailbox names.
 
Method Summary
 MailboxPath getBase()
          Gets the base reference for the search.
 java.lang.String getCombinedName()
          Get combined name formed by adding the expression to the base using the given hierarchy delimiter.
 java.lang.String getExpression()
          Gets the name search expression.
 char getFreeWildcard()
          Gets wildcard character that matches any series of characters.
 char getLocalWildcard()
          Gets wildacard character that matches any series of characters excluding hierarchy delimiters.
 boolean isExpressionMatch(java.lang.String name)
          Is the given name a match for getExpression()?
 boolean isWild()
          Is this expression wild?
 java.lang.String toString()
          Renders a string suitable for logging.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MailboxQuery

public MailboxQuery(MailboxPath base,
                    java.lang.String expression,
                    char freeWildcard,
                    char localWildcard)
Constructs an expression determining a set of mailbox names.

Parameters:
base - base reference name, not null
expression - mailbox match expression, not null
freeWildcard - matches any series of charaters
localWildcard - matches any sequence of characters up to the next hierarchy delimiter
Method Detail

getBase

public final MailboxPath getBase()
Gets the base reference for the search.

Returns:
the base

getExpression

public final java.lang.String getExpression()
Gets the name search expression. This may contain wildcards.

Returns:
the expression

getFreeWildcard

public final char getFreeWildcard()
Gets wildcard character that matches any series of characters.

Returns:
the freeWildcard

getLocalWildcard

public final char getLocalWildcard()
Gets wildacard character that matches any series of characters excluding hierarchy delimiters. Effectively, this means that it matches any sequence within a name part.

Returns:
the localWildcard

isExpressionMatch

public final boolean isExpressionMatch(java.lang.String name)
Is the given name a match for getExpression()?

Parameters:
name - name to be matched
hierarchyDelimiter - mailbox hierarchy delimiter
Returns:
true if the given name matches this expression, false otherwise

getCombinedName

public java.lang.String getCombinedName()
Get combined name formed by adding the expression to the base using the given hierarchy delimiter. Note that the wildcards are retained in the combined name.

Returns:
getBase() combined with getExpression(), notnull

isWild

public boolean isWild()
Is this expression wild?

Returns:
true if wildcard contained, false otherwise

toString

public java.lang.String toString()
Renders a string suitable for logging.

Overrides:
toString in class java.lang.Object
Returns:
a String representation of this object.


Copyright © 2002-2010 The Apache Software Foundation. All Rights Reserved.