|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.slide.search.SearchQuery
org.apache.slide.search.basic.BasicQuery
A BasicQuery represents the query and is able to deliver a SearchQueryResult using the execute method. It serves as a base class for store specific implementations. It hosts the information about the SELECT, FROM, WHERE, ORDERBY and LIMIT. It also holds a tree of BasicSearchExpressions.
Nested Class Summary | |
static class |
BasicQuery.ExpressionCompilerProvider
This IBasicExpressionCompilerProvider implementation returns a BasicQueryCompiler instance in method getCompiler(). |
Field Summary | |
protected IBasicExpressionCompilerProvider |
expressionCompilerProvider
The provider which delivers the expression compiler to use. |
static java.lang.String |
FROM_ELEMENT_MISSING
Message of a BadQueryException that is thrown if the query element does not contain a <from> element. |
protected int |
limit
|
protected boolean |
limitDefined
indicates, if a limit is defined |
protected org.jdom.Namespace |
namespace
the namespace for this query |
static java.lang.String |
NO_QUERY_ELEMENT
Message of a BadQueryException that is thrown if the query element is null . |
protected OrderBy |
orderBy
ORDER BY |
static java.lang.String |
PROP_OR_ALLPROP_ELEMENT_MISSING
Message of a BadQueryException that is thrown if the query element neither contains a <prop> nor a <allprop> element. |
protected PropertyProvider |
propertyProvider
The provider for the properties |
protected org.jdom.Element |
queryElement
the element describing this query |
protected QueryScope |
queryScope
the scope of this query, |
protected RequestedProperties |
requestedProperties
List of requested properties, |
protected IBasicExpression |
rootExpression
the top level expression in the |
static java.lang.String |
SELECT_ELEMENT_MISSING
Message of a BadQueryException that is thrown if the query element does not contain a <select> element. |
protected SlideUri |
slideUri
used to get the slidePath |
protected AbstractStore |
store
The store for this query, may be used to access store parameters |
protected org.jdom.Element |
whereElement
the element describing the WHERE clauise |
Fields inherited from class org.apache.slide.search.SearchQuery |
searchToken, structureHelper |
Constructor Summary | |
protected |
BasicQuery()
|
protected |
BasicQuery(SearchToken searchToken)
|
Method Summary | |
abstract SearchQueryResult |
execute()
Executes a request. |
IBasicExpressionFactory |
getContentExpressionFactory()
returns the factory for content expressions. |
IBasicExpression |
getExpression()
Method getExpression |
int |
getLimit()
Method getLimit |
OrderBy |
getOrderBy()
Method getOrderBy |
IBasicExpressionFactory |
getPropertiesExpressionFactory()
returns the factory for property expressions. |
PropertyProvider |
getPropertyProvider()
Method getPropertyProvider |
QueryScope |
getScope()
QueryScope accessor |
static QueryScope |
getScope(org.jdom.Element basicSearchElementJDOM)
Needed to decide, which implementation of BasicQuery to load |
SearchToken |
getSearchToken()
Method getSearchToken |
java.lang.String |
getSlidePath()
Method getSlidePath |
AbstractStore |
getStore()
Method getStore |
void |
init(SearchToken token)
Method init |
boolean |
isLimitDefined()
Method isLimitDefined |
abstract void |
parseQuery(org.jdom.Element basicSearchElement,
PropertyProvider propertyProvider)
builds the internal structure from the JDOM tree. |
void |
parseQueryElement(org.jdom.Element basicSearchElement,
PropertyProvider propertyProvider)
Builds the internal structure from the JDOM tree. |
protected void |
parseQueryWithoutExpression(org.jdom.Element basicSearchElement)
builds the internal structure from the JDOM tree. |
RequestedProperties |
requestedProperties()
Method getSelectedProperties |
void |
setScope(QueryScope queryScope)
Method setScope |
java.lang.String |
toString()
For debugging purpose. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String NO_QUERY_ELEMENT
null
.
protected IBasicExpressionCompilerProvider expressionCompilerProvider
public static final java.lang.String SELECT_ELEMENT_MISSING
public static final java.lang.String FROM_ELEMENT_MISSING
public static final java.lang.String PROP_OR_ALLPROP_ELEMENT_MISSING
protected org.jdom.Element queryElement
protected org.jdom.Namespace namespace
protected QueryScope queryScope
protected org.jdom.Element whereElement
protected RequestedProperties requestedProperties
protected int limit
protected OrderBy orderBy
protected boolean limitDefined
protected AbstractStore store
protected IBasicExpression rootExpression
protected SlideUri slideUri
protected PropertyProvider propertyProvider
Constructor Detail |
protected BasicQuery()
protected BasicQuery(SearchToken searchToken)
Method Detail |
public void init(SearchToken token)
IBasicQuery
init
in interface IBasicQuery
token
- a SearchTokenpublic IBasicExpressionFactory getContentExpressionFactory()
getContentExpressionFactory
in interface IBasicQuery
public IBasicExpressionFactory getPropertiesExpressionFactory()
getPropertiesExpressionFactory
in interface IBasicQuery
public AbstractStore getStore()
getStore
in interface IBasicQuery
public java.lang.String getSlidePath() throws InvalidScopeException
getSlidePath
in interface IBasicQuery
InvalidScopeException
public SearchToken getSearchToken()
getSearchToken
in interface IBasicQuery
public PropertyProvider getPropertyProvider()
getPropertyProvider
in interface IBasicQuery
public void parseQueryElement(org.jdom.Element basicSearchElement, PropertyProvider propertyProvider) throws BadQueryException
parseQueryElement
in interface IBasicQuery
basicSearchElement
- the (root) expression Element.propertyProvider
- the PropertyProvider to use (may be
null
).
BadQueryException
public abstract void parseQuery(org.jdom.Element basicSearchElement, PropertyProvider propertyProvider) throws BadQueryException
parseQueryWithoutExpression
to create most of the objects describing the query.
basicSearchElement
- the (root) expression Element.propertyProvider
- the PropertyProvider to use (may be
null
).
BadQueryException
public abstract SearchQueryResult execute() throws ServiceAccessException
execute
in interface IBasicQuery
execute
in class SearchQuery
ServiceAccessException
protected void parseQueryWithoutExpression(org.jdom.Element basicSearchElement) throws BadQueryException
basicSearchElement
- an Element
BadQueryException
public QueryScope getScope()
getScope
in interface IBasicQuery
public RequestedProperties requestedProperties()
requestedProperties
in interface IBasicQuery
requestedProperties
in class SearchQuery
public IBasicExpression getExpression()
getExpression
in interface IBasicQuery
public boolean isLimitDefined()
isLimitDefined
in interface IBasicQuery
public int getLimit()
getLimit
in interface IBasicQuery
public void setScope(QueryScope queryScope)
queryScope
- a QueryScopepublic OrderBy getOrderBy()
public java.lang.String toString()
public static QueryScope getScope(org.jdom.Element basicSearchElementJDOM) throws BadQueryException
basicSearchElementJDOM
- an Element
BadQueryException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |