public interface OsidQuery extends Suppliable
The OsidQuery
is used to assemble search queries. An
OsidQuery
is available from an OsidQuerySession
and defines methods to match objects. Once the desired parameters
are set, the OsidQuery
is given to the designated search
method. The same OsidQuery
returned from the session must
be used in the search as the provider may utilize implementation-specific
data wiithin the object.
If multiple data elements are set in this interface, the results matching all the given data (eg: AND) are returned.
Any match method inside an OsidQuery
may be invoked
multiple times. In the case of a match method, each invocation adds an
element to an OR
expression. Any of these terms may also be
negated through the match
flag.
OsidQuery { OsidQuery.matchDisplayName AND (OsidQuery.matchDescription OR OsidQuery.matchDescription)}
OsidObjects
allow for the definition of an additonal
records and the OsidQuery
parallels this mechanism. An
interface type of an OsidObject
record must also define the
corresponding OsidQuery
record which is available through
query interfaces. Multiple requests of these typed interfaces may return
the same underlying object and thus it is only useful to request once.
An OsidQuery
may be used to query for set or unset
values using the "match any" methods. A field that has not bee explicitly
assigned may default to a value. If multiple language translations exist
and the query session is placed in a non-default locale, fields that have
not been explicitly assigned in the non-default locale are considered
unset even if the values from the default locale appear in the objects.
Modifier and Type | Method and Description |
---|---|
void |
clearAnyTerms()
Clears the match any terms.
|
void |
clearKeywordTerms()
Clears all keyword terms.
|
TypeList |
getStringMatchTypes()
Gets the string matching types supported.
|
void |
matchAny(boolean match)
Matches any object.
|
void |
matchKeyword(java.lang.String keyword,
Type stringMatchType,
boolean match)
Adds a keyword to match.
|
boolean |
supportsStringMatchType(Type stringMatchType)
Tests if the given string matching type is supported.
|
TypeList getStringMatchTypes()
mandatory
- This method must be implemented. boolean supportsStringMatchType(Type stringMatchType)
stringMatchType
- a Type
indicating a string
match type true
if the given Type is supported,
false
otherwiseNullArgumentException
- stringMatchType
is null
mandatory
- This method must be implemented. void matchKeyword(java.lang.String keyword, Type stringMatchType, boolean match)
OR
among them. A keyword may be applied to any
of the elements defined in this object such as the display name,
description or any method defined in an interface implemented by this
object.keyword
- keyword to matchstringMatchType
- the string match typematch
- true
for a positive match, false
for a negative matchInvalidArgumentException
- keyword
is
not of stringMatchType
NullArgumentException
- keyword
or
stringMatchType
is null
UnsupportedException
-
supportsStringMatchType(stringMatchType)
is
false
mandatory
- This method must be implemented. void clearKeywordTerms()
mandatory
- This method must be implemented. void matchAny(boolean match)
match
- true
to match any object ,
false
to match no objectsmandatory
- This method must be implemented. void clearAnyTerms()
mandatory
- This method must be implemented.