public class DefaultSearchQuery extends java.lang.Object implements SearchQuery, java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
protected ConstraintContext |
constraintContext |
protected SearchGraph |
graph |
protected DefaultQueryParser |
parser |
protected java.util.Map<java.lang.String,java.lang.Object> |
properties |
protected java.lang.String |
query |
Constructor and Description |
---|
DefaultSearchQuery(ConstraintContext constraintContext) |
Modifier and Type | Method and Description |
---|---|
SearchQuery |
clone() |
protected DefaultQueryParser |
createParser() |
ConstraintContext |
getConstraintContext() |
java.lang.Object |
getProperty(java.lang.String key) |
java.lang.String |
getQueryString()
Returns a textual representation of this
SearchQuery instance. |
SearchGraph |
getSearchGraph() |
protected void |
graphToQuery() |
void |
parseQueryString(java.lang.String query)
Reads the given
query string and converts it into a
collection of constraint objects. |
protected void |
queryToGraph() |
void |
setProperty(java.lang.String key,
java.lang.Object value) |
void |
setSearchGraph(SearchGraph graph) |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
equals
protected SearchGraph graph
protected java.lang.String query
protected java.util.Map<java.lang.String,java.lang.Object> properties
protected DefaultQueryParser parser
protected final ConstraintContext constraintContext
public DefaultSearchQuery(ConstraintContext constraintContext)
protected DefaultQueryParser createParser() throws java.lang.Exception
java.lang.Exception
public void parseQueryString(java.lang.String query) throws de.ims.icarus.util.UnsupportedFormatException
SearchQuery
query
string and converts it into a
collection of constraint objects. If the provided query
does not satisfy syntactic requirements enforced by the implementing
SearchQuery
class then an UnsupportedFormatException
should be thrown.
Note the special requirements mentioned at SearchQuery.getQueryString()
parseQueryString
in interface SearchQuery
de.ims.icarus.util.UnsupportedFormatException
SearchQuery.parseQueryString(java.lang.String)
protected void graphToQuery() throws java.lang.Exception
java.lang.Exception
protected void queryToGraph() throws java.lang.Exception
java.lang.Exception
public java.lang.String getQueryString()
SearchQuery
SearchQuery
instance.
If it was created using a query
string then this method should
return this string in raw form. Otherwise the constraint objects within this
instance should be used to construct such a query
string.
Note: It is required that all implementations honor the following
special convention. A query
string obtained from a call to
SearchQuery.getQueryString()
on some SearchQuery
A must
result in exactly the same collection of constraint objects when passed
to the SearchQuery.parseQueryString(String)
method of some other SearchQuery
instance B. This holds as long as both instances operate on the
same search language! In addition an implementation may ignore
a call to SearchQuery.parseQueryString(String)
when the supplied query
string matches the current collection of constraints.
This special convention applies only in a one-way manner! It is
not required that an implementation guarantees consistency of
SearchQuery.getQueryString()
results in regard to the original input
passed to SearchQuery.parseQueryString(String)
!
getQueryString
in interface SearchQuery
SearchQuery.getQueryString()
public void setProperty(java.lang.String key, java.lang.Object value)
setProperty
in interface SearchQuery
SearchQuery.setProperty(java.lang.String, java.lang.Object)
public java.lang.Object getProperty(java.lang.String key)
getProperty
in interface SearchQuery
SearchQuery.getProperty(java.lang.String)
public SearchGraph getSearchGraph()
getSearchGraph
in interface SearchQuery
SearchQuery.getSearchGraph()
public void setSearchGraph(SearchGraph graph) throws de.ims.icarus.util.UnsupportedFormatException
setSearchGraph
in interface SearchQuery
de.ims.icarus.util.UnsupportedFormatException
SearchQuery.setSearchGraph(de.ims.icarus.search_tools.SearchGraph)
public SearchQuery clone()
clone
in interface SearchQuery
clone
in class java.lang.Object
public ConstraintContext getConstraintContext()
getConstraintContext
in interface SearchQuery
SearchQuery.getConstraintContext()