Package org.firebirdsql.jdbc.escape
Class FBEscapedCallParser
java.lang.Object
org.firebirdsql.jdbc.escape.FBEscapedCallParser
Parser for escaped procedure call.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected intgetState()Returns the current state.protected booleanisInState(int state) Returns if the system is in statestate.Converts escaped parts in the passed SQL to native representation.protected StringprocessParam(String param) Pre-process parameter.protected booleanprocessToken(String token) Process token.protected voidsetState(int state) Sets the current state.protected voidswitchState(char testChar) Test the character to be the state switching character and switches the state if necessary.
-
Constructor Details
-
FBEscapedCallParser
-
-
Method Details
-
getState
protected int getState()Returns the current state. -
setState
protected void setState(int state) Sets the current state.- Parameters:
state- to enter.- Throws:
IllegalStateException- if the system cannot enter the desired state.
-
isInState
protected boolean isInState(int state) Returns if the system is in statestate.- Parameters:
state- we're testing- Returns:
trueif the system is in statestate.
-
switchState
Test the character to be the state switching character and switches the state if necessary.- Parameters:
testChar- character to test- Throws:
FBSQLParseException
-
parseCall
Converts escaped parts in the passed SQL to native representation.- Parameters:
sql- to parse- Returns:
- native form of the
sql. - Throws:
SQLException
-
processToken
Process token. This method detects procedure call keywords and sets appropriate flags. Also it detects procedure name and sets appropriate filed in the procedure call object.- Parameters:
token- token to process.- Returns:
trueif token was understood and processed.
-
processParam
Pre-process parameter. This method checks if there is escaped call inside and converts it to the native one.- Parameters:
param- parameter to process.- Returns:
- processed parameter.
- Throws:
FBSQLParseException- if parameter cannot be correctly parsed.SQLException
-