Top Description Fields Constructors Methods
com.mysql.cj.util

public Class EscapeTokenizer

extends Object
Class Inheritance
Imports
java.util.concurrent.locks.Lock, .ReentrantLock

EscapeTokenizer breaks up an SQL statement into SQL and escape code parts.

Field Summary

Modifier and TypeField and Description
private int
private static final char
private static final char
private static final char
private static final char
private static final char
private static final char
private static final char
private static final char
private static final char
private static final char
private static final char
private static final char
private static final char
private boolean
private boolean
private final Lock
private int
private char
private boolean
private String
private int

Constructor Summary

AccessConstructor and Description
public
EscapeTokenizer(String
the string to tokenize
source
)

Creates a new EscapeTokenizer object.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

if this tokenizer has more tokens available
hasMoreTokens
()

Does this tokenizer have more tokens available?

public String

Returns:

the next token.
nextToken
()

Returns the next token

public boolean

Returns:

true if a variable reference was found.
sawVariableUse
()

Returns true if a variable reference was found.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bracesLevelback to summary
private int bracesLevel
CHR_BACKSLASHback to summary
private static final char CHR_BACKSLASH
CHR_BEGIN_TOKENback to summary
private static final char CHR_BEGIN_TOKEN
CHR_CRback to summary
private static final char CHR_CR
CHR_DASHback to summary
private static final char CHR_DASH
CHR_DBL_QUOTEback to summary
private static final char CHR_DBL_QUOTE
CHR_END_TOKENback to summary
private static final char CHR_END_TOKEN
CHR_HASHback to summary
private static final char CHR_HASH
CHR_LFback to summary
private static final char CHR_LF
CHR_SGL_QUOTEback to summary
private static final char CHR_SGL_QUOTE
CHR_SLASHback to summary
private static final char CHR_SLASH
CHR_SPACEback to summary
private static final char CHR_SPACE
CHR_STARback to summary
private static final char CHR_STAR
CHR_VARIABLEback to summary
private static final char CHR_VARIABLE
emittingEscapeCodeback to summary
private boolean emittingEscapeCode
inQuotesback to summary
private boolean inQuotes
lockback to summary
private final Lock lock
posback to summary
private int pos
quoteCharback to summary
private char quoteChar
sawVariableUseback to summary
private boolean sawVariableUse
sourceback to summary
private String source
sourceLengthback to summary
private int sourceLength

Constructor Detail

EscapeTokenizerback to summary
public EscapeTokenizer(String source)

Creates a new EscapeTokenizer object.

Parameters
source:String

the string to tokenize

Method Detail

hasMoreTokensback to summary
public boolean hasMoreTokens()

Does this tokenizer have more tokens available?

Returns:boolean

if this tokenizer has more tokens available

nextTokenback to summary
public String nextToken()

Returns the next token

Returns:String

the next token.

sawVariableUseback to summary
public boolean sawVariableUse()

Returns true if a variable reference was found. Note that this information isn't accurate until finishing to process all tokens from source String. It also can't be used as per token basis.

Returns:boolean

true if a variable reference was found.