Class AbstractQueryEngine
- java.lang.Object
-
- com.tangosol.coherence.rest.query.AbstractQueryEngine
-
- All Implemented Interfaces:
QueryEngine
- Direct Known Subclasses:
CoherenceQueryLanguageEngine
public abstract class AbstractQueryEngine extends Object implements QueryEngine
Abstract base class for QueryEngine implementations.- Author:
- as 2012.01.19
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
AbstractQueryEngine.ParsedQuery
Immutable helper class that wraps both final query string and a map of parameter types, keyed by parameter name.
-
Field Summary
Fields Modifier and Type Field Description protected Map
m_mapParsedQuery
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
Constructors Constructor Description AbstractQueryEngine()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List
convertList(List<String> listSource, Class clzElementType)
Convert all elements of the source list into the specified type.protected Map<String,Object>
createBindings(Map<String,Object> mapParams, Map<String,Class> mapParamTypes)
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 Detail
-
m_mapParsedQuery
protected final Map m_mapParsedQuery
Map of cached ParsedQuery instances, keyed by their corresponding final query string.
-
-
Method Detail
-
parseQueryString
protected AbstractQueryEngine.ParsedQuery parseQueryString(String sQuery)
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
protected Class resolveParameterType(String sType)
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
-
-