org.apache.slide.search.basic
Interface IBasicExpressionFactory

All Known Implementing Classes:
BasicExpressionFactory

public interface IBasicExpressionFactory

An IBasicExpression represents an executable part of the expression tree. Different stores may have different implementations.

Version:
$Revision: 1.4 $

Field Summary
static java.lang.String BASIC_EXPRESSION_FACTORY_CLASS
          parameter name for the expression factory implementation
 
Method Summary
 IBasicExpression createExpression(org.jdom.Element element)
          Creates a (non-merge) expression (compare...) for the given Element.
 IBasicExpression createMergeExpression(java.lang.String name, java.lang.String namespace, java.util.Collection expressionsToMerge)
          Creates a MergeExpression for the given element (AND, OR).
 PropertyProvider getPropertyProvider()
          Returns the PropertyProvider to use (set in method init()).
 IBasicQuery getQuery()
          Returns the IBasicQuery to use (set in method init()).
 void init(IBasicQuery query, PropertyProvider propertyProvider)
          Initializes the factory.
 

Field Detail

BASIC_EXPRESSION_FACTORY_CLASS

public static final java.lang.String BASIC_EXPRESSION_FACTORY_CLASS
parameter name for the expression factory implementation

See Also:
Constant Field Values
Method Detail

init

public void init(IBasicQuery query,
                 PropertyProvider propertyProvider)
          throws BadQueryException
Initializes the factory. Is called exactly once and before any call to crateExpression ()

Parameters:
query - the IBasicQuery.
propertyProvider - the PropertyProvider to use (may be null).
Throws:
BadQueryException

getQuery

public IBasicQuery getQuery()
Returns the IBasicQuery to use (set in method init()).

Returns:
the IBasicQuery to use.

getPropertyProvider

public PropertyProvider getPropertyProvider()
Returns the PropertyProvider to use (set in method init()).

Returns:
the PropertyProvider to use.

createMergeExpression

public IBasicExpression createMergeExpression(java.lang.String name,
                                              java.lang.String namespace,
                                              java.util.Collection expressionsToMerge)
                                       throws BadQueryException
Creates a MergeExpression for the given element (AND, OR). The given children are the expressions to merge.

Parameters:
name - the name of the Element describing the merge expression.
namespace - the namespace of the Element describing the merge expression.
expressionsToMerge - the expressions to merge.
Returns:
an IBasicExpression
Throws:
BadQueryException

createExpression

public IBasicExpression createExpression(org.jdom.Element element)
                                  throws BadQueryException
Creates a (non-merge) expression (compare...) for the given Element.

Parameters:
element - an Element describing the expression.
Returns:
an IBasicExpression
Throws:
BadQueryException