org.h2.command

## Class Parser

- java.lang.Object
- - org.h2.command.Parser

    public class Parser
    extends java.lang.Object

The parser is used to convert a SQL statement string to an command object.

### Constructor Summary

Constructors
Constructor and Description
`Parser(Session session)`

### Method Summary

Methods
`Session` `getSession()`
`Expression` `parseExpression(java.lang.String sql)` Parse a SQL code snippet that represents an expression.
`Table` `parseTableName(java.lang.String sql)` Parse a SQL code snippet that represents a table name.
`Prepared` `prepare(java.lang.String sql)` Parse the statement and prepare it for execution.
`Command` `prepareCommand(java.lang.String sql)` Parse a statement or a list of statements, and prepare it for execution.
`static java.lang.String` `quoteIdentifier(java.lang.String s)` Add double quotes around an identifier if required.
`void` `setLiteralsChecked(boolean literalsChecked)`
`void` `setRightsChecked(boolean rightsChecked)`
`void` `setSuppliedParameterList(java.util.ArrayList<Parameter> suppliedParameterList)`
`java.lang.String` `toString()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### Parser

    public Parser(Session session)

### Method Detail

#### prepare

    public Prepared prepare(java.lang.String sql)

Parse the statement and prepare it for execution.

Parameters:
  `sql` - the SQL statement to parse
Returns:
  the prepared object

#### prepareCommand

    public Command prepareCommand(java.lang.String sql)

Parse a statement or a list of statements, and prepare it for execution.

Parameters:
  `sql` - the SQL statement to parse
Returns:
  the command object

#### getSession

    public Session getSession()

#### quoteIdentifier

    public static java.lang.String quoteIdentifier(java.lang.String s)

Add double quotes around an identifier if required.

Parameters:
  `s` - the identifier
Returns:
  the quoted identifier

#### setLiteralsChecked

    public void setLiteralsChecked(boolean literalsChecked)

#### setRightsChecked

    public void setRightsChecked(boolean rightsChecked)

#### setSuppliedParameterList

    public void setSuppliedParameterList(java.util.ArrayList<Parameter> suppliedParameterList)

#### parseExpression

    public Expression parseExpression(java.lang.String sql)

Parse a SQL code snippet that represents an expression.

Parameters:
  `sql` - the code snippet
Returns:
  the expression object

#### parseTableName

    public Table parseTableName(java.lang.String sql)

Parse a SQL code snippet that represents a table name.

Parameters:
  `sql` - the code snippet
Returns:
  the table object

#### toString

    public java.lang.String toString()

Overrides:
  `toString` in class `java.lang.Object`