org.hibernate.engine.query
Class ParamLocationRecognizer

java.lang.Object
  extended byorg.hibernate.engine.query.ParamLocationRecognizer
All Implemented Interfaces:
ParameterParser.Recognizer

public class ParamLocationRecognizer
extends Object
implements ParameterParser.Recognizer

Implements a parameter parser recognizer specifically for the purpose of journaling parameter locations.

Author:
Steve Ebersole

Constructor Summary
ParamLocationRecognizer()
           
 
Method Summary
 void ejb3PositionalParameter(String name, int position)
           
 Map getNamedParameterLocationMap()
          Returns the map of named parameter locations.
 List getOrdinalParameterLocationList()
          Returns the list of ordinal parameter locations.
 void namedParameter(String name, int position)
           
 void ordinalParameter(int position)
           
 void other(char character)
           
 void outParameter(int position)
           
static ParamLocationRecognizer parseLocations(String query)
          Convenience method for creating a param location recognizer and initiating the parse.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParamLocationRecognizer

public ParamLocationRecognizer()
Method Detail

parseLocations

public static ParamLocationRecognizer parseLocations(String query)
Convenience method for creating a param location recognizer and initiating the parse.

Parameters:
query - The query to be parsed for parameter locations.
Returns:
The generated recognizer, with journaled location info.

getNamedParameterLocationMap

public Map getNamedParameterLocationMap()
Returns the map of named parameter locations. The map is keyed by parameter name; the corresponding value is an Integer list.

Returns:
The map of named parameter locations.

getOrdinalParameterLocationList

public List getOrdinalParameterLocationList()
Returns the list of ordinal parameter locations. The list elements are Integers, representing the location for that given ordinal. Thus getOrdinalParameterLocationList().elementAt(n) represents the location for the nth parameter.

Returns:
The list of ordinal parameter locations.

ordinalParameter

public void ordinalParameter(int position)
Specified by:
ordinalParameter in interface ParameterParser.Recognizer

namedParameter

public void namedParameter(String name,
                           int position)
Specified by:
namedParameter in interface ParameterParser.Recognizer

ejb3PositionalParameter

public void ejb3PositionalParameter(String name,
                                    int position)
Specified by:
ejb3PositionalParameter in interface ParameterParser.Recognizer

other

public void other(char character)
Specified by:
other in interface ParameterParser.Recognizer

outParameter

public void outParameter(int position)
Specified by:
outParameter in interface ParameterParser.Recognizer