Class AbstractQueryEngine
java.lang.Object
com.tangosol.coherence.rest.query.AbstractQueryEngine
- All Implemented Interfaces:
QueryEngine
- Direct Known Subclasses:
CoherenceQueryLanguageEngine
Abstract base class for QueryEngine implementations.
- Author:
- as 2012.01.19
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
Immutable helper class that wraps both final query string and a map of parameter types, keyed by parameter name. -
Field Summary
Modifier and TypeFieldDescriptionprotected final Map
Map of cached ParsedQuery instances, keyed by their corresponding final query string.Fields inherited from interface com.tangosol.coherence.rest.query.QueryEngine
DEFAULT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected List
convertList
(List<String> listSource, Class clzElementType) Convert all elements of the source list into the specified type.Converts string parameters to their required types.protected AbstractQueryEngine.ParsedQuery
parseQueryString
(String sQuery) Parse a query string containing parameter type hints.protected Class
resolveParameterType
(String sType) Return the Class that corresponds with the given type hint.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.tangosol.coherence.rest.query.QueryEngine
prepareQuery
-
Field Details
-
m_mapParsedQuery
Map of cached ParsedQuery instances, keyed by their corresponding final query string.
-
-
Constructor Details
-
AbstractQueryEngine
public AbstractQueryEngine()
-
-
Method Details
-
parseQueryString
Parse a query string containing parameter type hints.Parameter type hints allow users to specify the type conversion that should be performed on the string value of the parameter defined in the query string portion of the URL before it is bound to the query.
- Parameters:
sQuery
- a query string to parse, which contains zero or more parameter bindings, possibly with type hints- Returns:
- a ParsedQuery instance containing both the original query string with parameter type hints removed, and the map of parameter types keyed by parameter name
-
resolveParameterType
Return the Class that corresponds with the given type hint.- Parameters:
sType
- the type hint- Returns:
- the Class that corresponds with the given type hint
-
createBindings
protected Map<String,Object> createBindings(Map<String, Object> mapParams, Map<String, Class> mapParamTypes) Converts string parameters to their required types.- Parameters:
mapParams
- a map of string parameter valuesmapParamTypes
- a map of required parameter types- Returns:
- a map of parameters converted to a required type
-
convertList
Convert all elements of the source list into the specified type.- Parameters:
listSource
- source listclzElementType
- element type- Returns:
- converted list
-