public class ParamLocationRecognizer extends Object implements ParameterParser.Recognizer
Modifier and Type | Class and Description |
---|---|
static class |
ParamLocationRecognizer.NamedParameterDescription
Internal representation of a recognized named parameter
|
Constructor and Description |
---|
ParamLocationRecognizer() |
Modifier and Type | Method and Description |
---|---|
Map<String,ParamLocationRecognizer.NamedParameterDescription> |
getNamedParameterDescriptionMap()
Returns the map of named parameter locations.
|
List<Integer> |
getOrdinalParameterLocationList()
Returns the list of ordinal parameter locations.
|
void |
jpaPositionalParameter(String name,
int position)
Called when a JPA-style named parameter is recognized
|
void |
namedParameter(String name,
int position)
Called when a named parameter is recognized
|
void |
ordinalParameter(int position)
Called when an ordinal parameter is recognized
|
void |
other(char character)
Called when a character that is not a parameter (or part of a parameter dfinition) is recognized.
|
void |
outParameter(int position)
Called when an output parameter is recognized
|
static ParamLocationRecognizer |
parseLocations(String query)
Convenience method for creating a param location recognizer and
initiating the parse.
|
public static ParamLocationRecognizer parseLocations(String query)
query
- The query to be parsed for parameter locations.public Map<String,ParamLocationRecognizer.NamedParameterDescription> getNamedParameterDescriptionMap()
public List<Integer> getOrdinalParameterLocationList()
getOrdinalParameterLocationList().elementAt(n)
represents the
location for the nth parameter.public void ordinalParameter(int position)
ParameterParser.Recognizer
ordinalParameter
in interface ParameterParser.Recognizer
position
- The position within the querypublic void namedParameter(String name, int position)
ParameterParser.Recognizer
namedParameter
in interface ParameterParser.Recognizer
name
- The recognized parameter nameposition
- The position within the querypublic void jpaPositionalParameter(String name, int position)
ParameterParser.Recognizer
jpaPositionalParameter
in interface ParameterParser.Recognizer
name
- The name of the JPA-style parameterposition
- The position within the querypublic void other(char character)
ParameterParser.Recognizer
other
in interface ParameterParser.Recognizer
character
- The recognized characterpublic void outParameter(int position)
ParameterParser.Recognizer
outParameter
in interface ParameterParser.Recognizer
position
- The position within the queryCopyright © 2017 JBoss by Red Hat. All rights reserved.