Class EscapeTokenizer

java.lang.Object
com.mysql.cj.util.EscapeTokenizer

public class EscapeTokenizer
extends java.lang.Object
EscapeTokenizer breaks up an SQL statement into SQL and escape code parts.
  • Constructor Summary

    Constructors 
    Constructor Description
    EscapeTokenizer​(java.lang.String source)
    Creates a new EscapeTokenizer object.
  • Method Summary

    Modifier and Type Method Description
    boolean hasMoreTokens()
    Does this tokenizer have more tokens available?
    java.lang.String nextToken()
    Returns the next token
    boolean sawVariableUse()
    Returns true if a variable reference was found.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • EscapeTokenizer

      public EscapeTokenizer​(java.lang.String source)
      Creates a new EscapeTokenizer object.
      Parameters:
      source - the string to tokenize
  • Method Details

    • hasMoreTokens

      public boolean hasMoreTokens()
      Does this tokenizer have more tokens available?
      Returns:
      if this tokenizer has more tokens available
    • nextToken

      public java.lang.String nextToken()
      Returns the next token
      Returns:
      the next token.
    • sawVariableUse

      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:
      true if a variable reference was found.