public class ParamLocationRecognizer extends java.lang.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 |
---|---|
java.util.Map<java.lang.String,ParamLocationRecognizer.NamedParameterDescription> |
getNamedParameterDescriptionMap()
Returns the map of named parameter locations.
|
java.util.List<java.lang.Integer> |
getOrdinalParameterLocationList()
Returns the list of ordinal parameter locations.
|
void |
jpaPositionalParameter(java.lang.String name,
int position)
Called when a JPA-style named parameter is recognized
|
void |
namedParameter(java.lang.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(java.lang.String query)
Convenience method for creating a param location recognizer and
initiating the parse.
|
public static ParamLocationRecognizer parseLocations(java.lang.String query)
query
- The query to be parsed for parameter locations.public java.util.Map<java.lang.String,ParamLocationRecognizer.NamedParameterDescription> getNamedParameterDescriptionMap()
public java.util.List<java.lang.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(java.lang.String name, int position)
ParameterParser.Recognizer
namedParameter
in interface ParameterParser.Recognizer
name
- The recognized parameter nameposition
- The position within the querypublic void jpaPositionalParameter(java.lang.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 © 2001-2018 Red Hat, Inc. All Rights Reserved.