Top Description Inners Fields Constructors Methods
org.postgresql.core

public Class Parser

extends Object
Class Inheritance
Imports
org.postgresql.jdbc.EscapeSyntaxCallMode, .EscapedFunctions2, org.postgresql.util.GT, .IntList, .PSQLException, .PSQLState, org.checkerframework.checker.nullness.qual.Nullable, java.lang.reflect.InvocationTargetException, .Method, java.sql.SQLException, java.util.ArrayList, .Collections, .List

Basic query parser infrastructure.

Note

This class should not be considered as pgjdbc public API.

Authors
Michael Paesold ([email protected]), Christopher Deckers ([email protected])

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static enum

Field Summary

Modifier and TypeField and Description
private static final char[]
private static final char[]
private static final char[]

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static boolean
addReturning(StringBuilder nativeSql, SqlCommandType currentCommandType, String[] returningColumnNames, boolean isReturningPresent, boolean quoteReturningIdentifiers)

public static boolean

Returns:

true if the character terminates an identifier
charTerminatesIdentifier
(char
character
c
)

private static void
checkParsePosition(int i, int len, int i0, char[] sql, String message)

public static int

Returns:

integer value of a digit at position pos
digitAt
(String
input string
s
,
int
position (0-based)
pos
)

Converts digit at position pos in string s to integer or throws.

private static int
escapeFunction(char[] sql, int i, StringBuilder newsql, boolean stdStrings)

private static int

Returns:

the right PostgreSQL sql
escapeFunctionArguments
(StringBuilder
destination StringBuilder
newsql
,
String
the escaped function name
functionName
,
char[]
input SQL text (containing arguments of a function call with possible JDBC escapes)
sql
,
int
position in the input SQL
i
,
boolean
whether standard_conforming_strings is on
stdStrings
)

Generate sql for escaped functions.

private static int
findOpenParenthesis(char[] sql, int i)

public static boolean

Returns:

Indication if the character is a whitespace which back end will escape.
isArrayWhiteSpace
(char
Character to examine.
c
)

Identifies white space characters which the backend uses to determine if a String value needs to be quoted in array representation.

public static boolean

Returns:

true if input string s has digit at position pos
isDigitAt
(String
input string
s
,
int
position (0-based)
pos
)

Returns true if a given string s has digit at position pos.

public static boolean

Returns:

true if valid as second or later character of a dollar quoting tag; false if not
isDollarQuoteContChar
(char
the character to check
c
)

Checks if a character is valid as the second or later character of a dollar quoting tag.

public static boolean

Returns:

true if valid as first character of a dollar quoting tag; false if not
isDollarQuoteStartChar
(char
the character to check
c
)

Checks if a character is valid as the start of a dollar quoting tag.

public static boolean

Returns:

true if valid as second or later character of an identifier; false if not
isIdentifierContChar
(char
the character to check
c
)

Checks if a character is valid as the second or later character of an identifier.

public static boolean

Returns:

true if valid as first character of an identifier; false if not
isIdentifierStartChar
(char
the character to check
c
)

Checks if a character is valid as the start of an identifier.

public static boolean

Returns:

true if the given character is a valid character for an operator in the backend's parser
isOperatorChar
(char
character
c
)

public static boolean

Returns:

true if the character is a whitespace character as defined in the backend's parser
isSpace
(char
character
c
)

Identifies characters which the backend scanner considers to be whitespace.

public static JdbcCallParseInfo

Returns:

SQL in appropriate for given server format
modifyJdbcCall
(String
sql text with JDBC escapes
jdbcSql
,
boolean
if backslash in single quotes should be regular character or escape one
stdStrings
,
int
server version
serverVersion
,
int
protocol version
protocolVersion
,
EscapeSyntaxCallMode
mode specifying whether JDBC escape call syntax is transformed into a CALL/SELECT statement
escapeSyntaxCallMode
)

Converts JDBC-specific callable statement escapes { [?

public static boolean

Returns:

boolean indicates presence of word
parseAlterKeyword
(final char[]
char[] of the query statement
query
,
int
position of query to start checking
offset
)

Parse string to check presence of CREATE keyword regardless of case.

public static boolean

Returns:

boolean indicates presence of word
parseAsKeyword
(final char[]
char[] of the query statement
query
,
int
position of query to start checking
offset
)

Parse string to check presence of AS keyword regardless of case.

public static boolean

Returns:

boolean indicates presence of word
parseAtomicKeyword
(final char[]
char[] of the query statement
query
,
int
position of query to start checking
offset
)

Parse string to check presence of ATOMIC keyword regardless of case.

public static boolean

Returns:

boolean indicates presence of word
parseBeginKeyword
(final char[]
char[] of the query statement
query
,
int
position of query to start checking
offset
)

Parse string to check presence of BEGIN keyword regardless of case.

public static int

Returns:

position of the last / character
parseBlockComment
(final char[]
query
query
,
int
start offset
offset
)

Test if the / character at offset starts a block comment, and return the position of the last / character.

public static boolean

Returns:

boolean indicates presence of word
parseCreateKeyword
(final char[]
char[] of the query statement
query
,
int
position of query to start checking
offset
)

Parse string to check presence of CREATE keyword regardless of case.

public static boolean

Returns:

boolean indicates presence of word
parseDeleteKeyword
(final char[]
char[] of the query statement
query
,
int
position of query to start checking
offset
)

Parse string to check presence of DELETE keyword regardless of case.

public static int

Returns:

offset of the ending dollar character
parseDollarQuotes
(final char[]
query
query
,
int
start offset
offset
)

Test if the dollar character ($) at the given offset starts a dollar-quoted string and return the offset of the ending dollar character.

public static int

Returns:

position of the end of the double-quoted string
parseDoubleQuotes
(final char[]
query
query
,
int
start offset
offset
)

Find the end of the double-quoted string starting at the given offset.

public static boolean

Returns:

boolean indicates presence of word
parseInsertKeyword
(final char[]
char[] of the query statement
query
,
int
position of query to start checking
offset
)

Parse string to check presence of INSERT keyword regardless of case.

public static List<NativeQuery>

Returns:

list of native queries
parseJdbcSql
(String
jdbc query to parse
query
,
boolean
whether to allow backslashes to be used as escape characters in single quote literals
standardConformingStrings
,
boolean
whether to replace ?, ? with $1, $2, etc
withParameters
,
boolean
whether to split statements by semicolon
splitStatements
,
boolean
whether re-write optimization is enabled
isBatchedReWriteConfigured
,
boolean
whether to quote identifiers returned using returning clause
quoteReturningIdentifiers
,
String...
for simple insert, update, delete add returning with given column names
returningColumnNames
)

Parses JDBC query into PostgreSQL's native format.

public static int

Returns:

position of the first \r or \n character
parseLineComment
(final char[]
query
query
,
int
start offset
offset
)

Test if the - character at offset starts a -- style line comment, and return the position of the first \r or \n character.

public static long

Returns:

long value
parseLong
(String
string to parse
s
,
int
begin index
beginIndex
,
int
end index
endIndex
)

Faster version of Long#parseLong(String) when parsing a substring is required

public static boolean

Returns:

boolean indicates presence of word
parseMoveKeyword
(final char[]
char[] of the query statement
query
,
int
position of query to start checking
offset
)

Parse string to check presence of MOVE keyword regardless of case.

public static boolean

Returns:

boolean indicates presence of word
parseReturningKeyword
(final char[]
char[] of the query statement
query
,
int
position of query to start checking
offset
)

Parse string to check presence of RETURNING keyword regardless of case.

public static boolean

Returns:

boolean indicates presence of word
parseSelectKeyword
(final char[]
char[] of the query statement
query
,
int
position of query to start checking
offset
)

Parse string to check presence of SELECT keyword regardless of case.

public static int

Returns:

position of the end of the single-quoted string
parseSingleQuotes
(final char[]
query
query
,
int
start offset
offset
,
boolean
standard conforming strings
standardConformingStrings
)

Find the end of the single-quoted string starting at the given offset.

private static int

Returns:

the position we stopped processing at
parseSql
(char[]
the original query text
sql
,
int
starting position for replacing
i
,
StringBuilder
where to write the replaced output
newsql
,
boolean
should we stop after hitting the first comma in sql text?
stopOnComma
,
boolean
whether standard_conforming_strings is on
stdStrings
)

parse the given sql from index i, appending it to the given buffer until we hit an unmatched right parentheses or end of string.

public static boolean

Returns:

boolean indicates presence of word
parseUpdateKeyword
(final char[]
char[] of the query statement
query
,
int
position of query to start checking
offset
)

Parse string to check presence of UPDATE keyword regardless of case.

public static boolean

Returns:

boolean indicates presence of word
parseValuesKeyword
(final char[]
char[] of the query statement
query
,
int
position of query to start checking
offset
)

Parse string to check presence of VALUES keyword regardless of case.

private static @Nullable SqlCommandType
parseWithCommandType(char[] aChars, int i, int keywordStart, int wordLength)

public static boolean

Returns:

boolean indicates presence of word
parseWithKeyword
(final char[]
char[] of the query statement
query
,
int
position of query to start checking
offset
)

Parse string to check presence of WITH keyword regardless of case.

public static String

Returns:

PostgreSQL-compatible SQL
replaceProcessing
(String
the original query text
sql
,
boolean
whether replace_processing_enabled is on
replaceProcessingEnabled
,
boolean
whether standard_conforming_strings is on
standardConformingStrings
)

Filter the SQL string of Java SQL Escape clauses.

private static boolean

Returns:

true if the sub-arrays are equal; false if not
subArraysEqual
(final char[]
a char array
arr
,
final int
first sub-array start offset
offA
,
final int
second sub-array start offset
offB
,
final int
length of the sub arrays to compare
len
)

Compares two sub-arrays of the given character array for equalness.

private static @Nullable int[]

Returns:

output array
toIntArray
(@Nullable IntList
input list
list
)

Converts IntList to int[].

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

QUOTE_OR_ALPHABETIC_MARKERback to summary
private static final char[] QUOTE_OR_ALPHABETIC_MARKER
QUOTE_OR_ALPHABETIC_MARKER_OR_PARENTHESISback to summary
private static final char[] QUOTE_OR_ALPHABETIC_MARKER_OR_PARENTHESIS
SINGLE_QUOTEback to summary
private static final char[] SINGLE_QUOTE

Constructor Detail

Parserback to summary
public Parser()

Method Detail

addReturningback to summary
private static boolean addReturning(StringBuilder nativeSql, SqlCommandType currentCommandType, String[] returningColumnNames, boolean isReturningPresent, boolean quoteReturningIdentifiers) throws SQLException
charTerminatesIdentifierback to summary
public static boolean charTerminatesIdentifier(char c)
Parameters
c:char

character

Returns:boolean

true if the character terminates an identifier

checkParsePositionback to summary
private static void checkParsePosition(int i, int len, int i0, char[] sql, String message) throws PSQLException
digitAtback to summary
public static int digitAt(String s, int pos)

Converts digit at position pos in string s to integer or throws.

Parameters
s:String

input string

pos:int

position (0-based)

Returns:int

integer value of a digit at position pos

Exceptions
NumberFormatException:
if character at position pos is not an integer
escapeFunctionback to summary
private static int escapeFunction(char[] sql, int i, StringBuilder newsql, boolean stdStrings) throws SQLException
escapeFunctionArgumentsback to summary
private static int escapeFunctionArguments(StringBuilder newsql, String functionName, char[] sql, int i, boolean stdStrings) throws SQLException

Generate sql for escaped functions.

Parameters
newsql:StringBuilder

destination StringBuilder

functionName:String

the escaped function name

sql:char[]

input SQL text (containing arguments of a function call with possible JDBC escapes)

i:int

position in the input SQL

stdStrings:boolean

whether standard_conforming_strings is on

Returns:int

the right PostgreSQL sql

Exceptions
SQLException:
if something goes wrong
findOpenParenthesisback to summary
private static int findOpenParenthesis(char[] sql, int i)
isArrayWhiteSpaceback to summary
public static boolean isArrayWhiteSpace(char c)

Identifies white space characters which the backend uses to determine if a String value needs to be quoted in array representation.

https://github.com/postgres/postgres/blob/f2c587067a8eb9cf1c8f009262381a6576ba3dd0/src/backend/utils/adt/arrayfuncs.c#L421-L438

Parameters
c:char

Character to examine.

Returns:boolean

Indication if the character is a whitespace which back end will escape.

isDigitAtback to summary
public static boolean isDigitAt(String s, int pos)

Returns true if a given string s has digit at position pos.

Parameters
s:String

input string

pos:int

position (0-based)

Returns:boolean

true if input string s has digit at position pos

isDollarQuoteContCharback to summary
public static boolean isDollarQuoteContChar(char c)

Checks if a character is valid as the second or later character of a dollar quoting tag.

Parameters
c:char

the character to check

Returns:boolean

true if valid as second or later character of a dollar quoting tag; false if not

isDollarQuoteStartCharback to summary
public static boolean isDollarQuoteStartChar(char c)

Checks if a character is valid as the start of a dollar quoting tag.

Parameters
c:char

the character to check

Returns:boolean

true if valid as first character of a dollar quoting tag; false if not

isIdentifierContCharback to summary
public static boolean isIdentifierContChar(char c)

Checks if a character is valid as the second or later character of an identifier.

Parameters
c:char

the character to check

Returns:boolean

true if valid as second or later character of an identifier; false if not

isIdentifierStartCharback to summary
public static boolean isIdentifierStartChar(char c)

Checks if a character is valid as the start of an identifier. PostgreSQL 9.4 allows column names like _, ‿, ⁀, ⁔, ︳, ︴, ﹍, ﹎, ﹏, _, so it is assumed isJavaIdentifierPart is good enough for PostgreSQL.

Parameters
c:char

the character to check

Returns:boolean

true if valid as first character of an identifier; false if not

See Also
Identifiers and Key Words
isOperatorCharback to summary
public static boolean isOperatorChar(char c)
Parameters
c:char

character

Returns:boolean

true if the given character is a valid character for an operator in the backend's parser

isSpaceback to summary
public static boolean isSpace(char c)

Identifies characters which the backend scanner considers to be whitespace.

https://github.com/postgres/postgres/blob/17bb62501787c56e0518e61db13a523d47afd724/src/backend/parser/scan.l#L194-L198

Parameters
c:char

character

Returns:boolean

true if the character is a whitespace character as defined in the backend's parser

modifyJdbcCallback to summary
public static JdbcCallParseInfo modifyJdbcCall(String jdbcSql, boolean stdStrings, int serverVersion, int protocolVersion, EscapeSyntaxCallMode escapeSyntaxCallMode) throws SQLException

Converts JDBC-specific callable statement escapes { [? =] call <some_function> [(?, [?,..])] } into the PostgreSQL format which is select <some_function> (?, [?, ...]) as result or select * from <some_function> (?, [?, ...]) as result (7.3)

Parameters
jdbcSql:String

sql text with JDBC escapes

stdStrings:boolean

if backslash in single quotes should be regular character or escape one

serverVersion:int

server version

protocolVersion:int

protocol version

escapeSyntaxCallMode:EscapeSyntaxCallMode

mode specifying whether JDBC escape call syntax is transformed into a CALL/SELECT statement

Returns:JdbcCallParseInfo

SQL in appropriate for given server format

Exceptions
SQLException:
if given SQL is malformed
parseAlterKeywordback to summary
public static boolean parseAlterKeyword(final char[] query, int offset)

Parse string to check presence of CREATE keyword regardless of case.

Parameters
query:char[]

char[] of the query statement

offset:int

position of query to start checking

Returns:boolean

boolean indicates presence of word

parseAsKeywordback to summary
public static boolean parseAsKeyword(final char[] query, int offset)

Parse string to check presence of AS keyword regardless of case.

Parameters
query:char[]

char[] of the query statement

offset:int

position of query to start checking

Returns:boolean

boolean indicates presence of word

parseAtomicKeywordback to summary
public static boolean parseAtomicKeyword(final char[] query, int offset)

Parse string to check presence of ATOMIC keyword regardless of case.

Parameters
query:char[]

char[] of the query statement

offset:int

position of query to start checking

Returns:boolean

boolean indicates presence of word

parseBeginKeywordback to summary
public static boolean parseBeginKeyword(final char[] query, int offset)

Parse string to check presence of BEGIN keyword regardless of case.

Parameters
query:char[]

char[] of the query statement

offset:int

position of query to start checking

Returns:boolean

boolean indicates presence of word

parseBlockCommentback to summary
public static int parseBlockComment(final char[] query, int offset)

Test if the / character at offset starts a block comment, and return the position of the last / character.

Parameters
query:char[]

query

offset:int

start offset

Returns:int

position of the last / character

parseCreateKeywordback to summary
public static boolean parseCreateKeyword(final char[] query, int offset)

Parse string to check presence of CREATE keyword regardless of case.

Parameters
query:char[]

char[] of the query statement

offset:int

position of query to start checking

Returns:boolean

boolean indicates presence of word

parseDeleteKeywordback to summary
public static boolean parseDeleteKeyword(final char[] query, int offset)

Parse string to check presence of DELETE keyword regardless of case. The initial character is assumed to have been matched.

Parameters
query:char[]

char[] of the query statement

offset:int

position of query to start checking

Returns:boolean

boolean indicates presence of word

parseDollarQuotesback to summary
public static int parseDollarQuotes(final char[] query, int offset)

Test if the dollar character ($) at the given offset starts a dollar-quoted string and return the offset of the ending dollar character.

Parameters
query:char[]

query

offset:int

start offset

Returns:int

offset of the ending dollar character

parseDoubleQuotesback to summary
public static int parseDoubleQuotes(final char[] query, int offset)

Find the end of the double-quoted string starting at the given offset.

Note

for "double "" quote in string", this method currently returns the offset of first " character after the initial one. The caller must call the method a second time for the second part of the quoted string.

Parameters
query:char[]

query

offset:int

start offset

Returns:int

position of the end of the double-quoted string

parseInsertKeywordback to summary
public static boolean parseInsertKeyword(final char[] query, int offset)

Parse string to check presence of INSERT keyword regardless of case.

Parameters
query:char[]

char[] of the query statement

offset:int

position of query to start checking

Returns:boolean

boolean indicates presence of word

parseJdbcSqlback to summary
public static List<NativeQuery> parseJdbcSql(String query, boolean standardConformingStrings, boolean withParameters, boolean splitStatements, boolean isBatchedReWriteConfigured, boolean quoteReturningIdentifiers, String... returningColumnNames) throws SQLException

Parses JDBC query into PostgreSQL's native format. Several queries might be given if separated by semicolon.

Parameters
query:String

jdbc query to parse

standardConformingStrings:boolean

whether to allow backslashes to be used as escape characters in single quote literals

withParameters:boolean

whether to replace ?, ? with $1, $2, etc

splitStatements:boolean

whether to split statements by semicolon

isBatchedReWriteConfigured:boolean

whether re-write optimization is enabled

quoteReturningIdentifiers:boolean

whether to quote identifiers returned using returning clause

returningColumnNames:String[]

for simple insert, update, delete add returning with given column names

Returns:List<NativeQuery>

list of native queries

Exceptions
SQLException:
if unable to add returning clause (invalid column names)
parseLineCommentback to summary
public static int parseLineComment(final char[] query, int offset)

Test if the - character at offset starts a -- style line comment, and return the position of the first \r or \n character.

Parameters
query:char[]

query

offset:int

start offset

Returns:int

position of the first \r or \n character

parseLongback to summary
public static long parseLong(String s, int beginIndex, int endIndex)

Faster version of Long#parseLong(String) when parsing a substring is required

Parameters
s:String

string to parse

beginIndex:int

begin index

endIndex:int

end index

Returns:long

long value

parseMoveKeywordback to summary
public static boolean parseMoveKeyword(final char[] query, int offset)

Parse string to check presence of MOVE keyword regardless of case.

Parameters
query:char[]

char[] of the query statement

offset:int

position of query to start checking

Returns:boolean

boolean indicates presence of word

parseReturningKeywordback to summary
public static boolean parseReturningKeyword(final char[] query, int offset)

Parse string to check presence of RETURNING keyword regardless of case.

Parameters
query:char[]

char[] of the query statement

offset:int

position of query to start checking

Returns:boolean

boolean indicates presence of word

parseSelectKeywordback to summary
public static boolean parseSelectKeyword(final char[] query, int offset)

Parse string to check presence of SELECT keyword regardless of case.

Parameters
query:char[]

char[] of the query statement

offset:int

position of query to start checking

Returns:boolean

boolean indicates presence of word

parseSingleQuotesback to summary
public static int parseSingleQuotes(final char[] query, int offset, boolean standardConformingStrings)

Find the end of the single-quoted string starting at the given offset.

Note

for 'single '' quote in string', this method currently returns the offset of first ' character after the initial one. The caller must call the method a second time for the second part of the quoted string.

Parameters
query:char[]

query

offset:int

start offset

standardConformingStrings:boolean

standard conforming strings

Returns:int

position of the end of the single-quoted string

parseSqlback to summary
private static int parseSql(char[] sql, int i, StringBuilder newsql, boolean stopOnComma, boolean stdStrings) throws SQLException

parse the given sql from index i, appending it to the given buffer until we hit an unmatched right parentheses or end of string. When the stopOnComma flag is set we also stop processing when a comma is found in sql text that isn't inside nested parenthesis.

Parameters
sql:char[]

the original query text

i:int

starting position for replacing

newsql:StringBuilder

where to write the replaced output

stopOnComma:boolean

should we stop after hitting the first comma in sql text?

stdStrings:boolean

whether standard_conforming_strings is on

Returns:int

the position we stopped processing at

Exceptions
SQLException:
if given SQL is wrong
parseUpdateKeywordback to summary
public static boolean parseUpdateKeyword(final char[] query, int offset)

Parse string to check presence of UPDATE keyword regardless of case.

Parameters
query:char[]

char[] of the query statement

offset:int

position of query to start checking

Returns:boolean

boolean indicates presence of word

parseValuesKeywordback to summary
public static boolean parseValuesKeyword(final char[] query, int offset)

Parse string to check presence of VALUES keyword regardless of case.

Parameters
query:char[]

char[] of the query statement

offset:int

position of query to start checking

Returns:boolean

boolean indicates presence of word

parseWithCommandTypeback to summary
private static @Nullable SqlCommandType parseWithCommandType(char[] aChars, int i, int keywordStart, int wordLength)
parseWithKeywordback to summary
public static boolean parseWithKeyword(final char[] query, int offset)

Parse string to check presence of WITH keyword regardless of case.

Parameters
query:char[]

char[] of the query statement

offset:int

position of query to start checking

Returns:boolean

boolean indicates presence of word

replaceProcessingback to summary
public static String replaceProcessing(String sql, boolean replaceProcessingEnabled, boolean standardConformingStrings) throws SQLException

Filter the SQL string of Java SQL Escape clauses.

Currently implemented Escape clauses are those mentioned in 11.3 in the specification. Basically we look through the sql string for {d xxx}, {t xxx}, {ts xxx}, {oj xxx} or {fn xxx} in non-string sql code. When we find them, we just strip the escape part leaving only the xxx part. So, something like "select * from x where d={d '2001-10-09'}" would return "select * from x where d= '2001-10-09'".

Parameters
sql:String

the original query text

replaceProcessingEnabled:boolean

whether replace_processing_enabled is on

standardConformingStrings:boolean

whether standard_conforming_strings is on

Returns:String

PostgreSQL-compatible SQL

Exceptions
SQLException:
if given SQL is wrong
subArraysEqualback to summary
private static boolean subArraysEqual(final char[] arr, final int offA, final int offB, final int len)

Compares two sub-arrays of the given character array for equalness. If the length is zero, the result is true if and only if the offsets are within the bounds of the array.

Parameters
arr:char[]

a char array

offA:int

first sub-array start offset

offB:int

second sub-array start offset

len:int

length of the sub arrays to compare

Returns:boolean

true if the sub-arrays are equal; false if not

toIntArrayback to summary
private static @Nullable int[] toIntArray(@Nullable IntList list)

Converts IntList to int[]. A null collection is converted to null array.

Parameters
list:@Nullable IntList

input list

Returns:@Nullable int[]

output array

org.postgresql.core back to summary

private final Enum Parser.SqlParseState

extends Enum<Parser.SqlParseState>
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final char[]
public static final Parser.SqlParseState
public static final Parser.SqlParseState
public static final Parser.SqlParseState
public static final Parser.SqlParseState
public static final Parser.SqlParseState
public static final Parser.SqlParseState
private final char[]
public static final Parser.SqlParseState
private final @Nullable String
private static final Parser.SqlParseState[]

Constructor Summary

AccessConstructor and Description
private
private
SqlParseState(String escapeKeyword, char[] allowedValues, @Nullable String replacementKeyword)

Method Summary

Modifier and TypeMethod and Description
private int
getMatchedPosition(char[] sql, int pos)

private boolean
startMatches(char[] sql, int pos)

public static Parser.SqlParseState
public static Parser.SqlParseState[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

allowedValuesback to summary
private final char[] allowedValues
ESC_DATEback to summary
public static final Parser.SqlParseState ESC_DATE
ESC_ESCAPECHARback to summary
public static final Parser.SqlParseState ESC_ESCAPECHAR
ESC_FUNCTIONback to summary
public static final Parser.SqlParseState ESC_FUNCTION
ESC_OUTERJOINback to summary
public static final Parser.SqlParseState ESC_OUTERJOIN
ESC_TIMEback to summary
public static final Parser.SqlParseState ESC_TIME
ESC_TIMESTAMPback to summary
public static final Parser.SqlParseState ESC_TIMESTAMP
escapeKeywordback to summary
private final char[] escapeKeyword
IN_SQLCODEback to summary
public static final Parser.SqlParseState IN_SQLCODE
replacementKeywordback to summary
private final @Nullable String replacementKeyword
VALUESback to summary
private static final Parser.SqlParseState[] VALUES

Constructor Detail

SqlParseStateback to summary
private SqlParseState()
SqlParseStateback to summary
private SqlParseState(String escapeKeyword, char[] allowedValues, @Nullable String replacementKeyword)

Method Detail

getMatchedPositionback to summary
private int getMatchedPosition(char[] sql, int pos)
startMatchesback to summary
private boolean startMatches(char[] sql, int pos)
valueOfback to summary
public static Parser.SqlParseState valueOf(String name)
valuesback to summary
public static Parser.SqlParseState[] values()