org.eclipse.datatools.sqltools.sql.parser
Class ParserParameters

java.lang.Object
  extended by org.eclipse.datatools.sqltools.sql.parser.ParserParameters

public class ParserParameters
extends java.lang.Object

This class defines the parameters passed into the parser. Some standard parameter keys are defined in this class but different parser implementations can also use their specific parameter types via this generic mechanism.

Author:
Hui Cao

Field Summary
static java.lang.String PARAM_CONSUME_EXCEPTION
          Parser parameter type constant indicating whether the ParseException should be consumed during parsing.
static java.lang.String PARAM_DB_NAME
          Parser parameter type constant indicating the database name in which database objects can be found.
static java.lang.String PARAM_HEADER_MODE
          Parser parameter type constant of type Boolean indicating only the routine header is interesting to the consumer.
static java.lang.String PARAM_LINK_SQL_MODEL
          Parser parameter type constant of type Boolean indicating whether needs to link sql model object in the generated ast nodes.
static java.lang.String PARAM_PROFILE_NAME
          Parser parameter type constant indicating the connection profile name that can be used in the parser.
static java.lang.String PARAM_STMT_TYPE
          Parser parameter type constant indicating the outmost statement type.
static java.lang.String PARAM_USE_DELIMITER
          Parser parameter type constant indicating whether to use delimiter for SQL statements .
 
Constructor Summary
ParserParameters(boolean useDelimiter)
          Constructs a ParserParameter using the given useDelimiter value
ParserParameters(boolean useDelimiter, int type)
          Constructs a ParserParameter using the given useDelimiter and type value.
 
Method Summary
 boolean getBoolean(java.lang.Object key)
          Convenient method for getProperty(Object key)
 int getInt(java.lang.Object key)
          Convenient method for getProperty(Object key)
 java.util.HashMap getProperties()
          Gets all the properties.
 java.lang.Object getProperty(java.lang.Object key)
          Gets the property value as Object
 void setProperties(java.util.HashMap _properties)
          Sets the properties.
 void setProperty(java.lang.Object key, java.lang.Object value)
          Sets the property key to value
 void setUseDelimiter(boolean useDelimiter)
          Sets the useDelimiter value
 boolean useDelimiter()
          Returns a boolean indicating whether to use delimiter for SQL statements.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARAM_USE_DELIMITER

public static final java.lang.String PARAM_USE_DELIMITER
Parser parameter type constant indicating whether to use delimiter for SQL statements . e.g. ASE uses "go" to group statements as a batch operation; ASA uses ";" or "go" to delimit SQL statements.

See Also:
Constant Field Values

PARAM_PROFILE_NAME

public static final java.lang.String PARAM_PROFILE_NAME
Parser parameter type constant indicating the connection profile name that can be used in the parser.

See Also:
Constant Field Values

PARAM_DB_NAME

public static final java.lang.String PARAM_DB_NAME
Parser parameter type constant indicating the database name in which database objects can be found.

See Also:
Constant Field Values

PARAM_STMT_TYPE

public static final java.lang.String PARAM_STMT_TYPE
Parser parameter type constant indicating the outmost statement type.

See Also:
SQLParserConstants, Constant Field Values

PARAM_HEADER_MODE

public static final java.lang.String PARAM_HEADER_MODE
Parser parameter type constant of type Boolean indicating only the routine header is interesting to the consumer. Can be combined with other routine types.

See Also:
SQLParserConstants, Constant Field Values

PARAM_LINK_SQL_MODEL

public static final java.lang.String PARAM_LINK_SQL_MODEL
Parser parameter type constant of type Boolean indicating whether needs to link sql model object in the generated ast nodes.

See Also:
IASTDeployable#setSQLModel, SQLParserConstants, Constant Field Values

PARAM_CONSUME_EXCEPTION

public static final java.lang.String PARAM_CONSUME_EXCEPTION
Parser parameter type constant indicating whether the ParseException should be consumed during parsing. If the parser is not accurate, this parameter should be set to true.

See Also:
Constant Field Values
Constructor Detail

ParserParameters

public ParserParameters(boolean useDelimiter)
Constructs a ParserParameter using the given useDelimiter value

Parameters:
useDelimiter - whether to use delimiter for SQL statements

ParserParameters

public ParserParameters(boolean useDelimiter,
                        int type)
Constructs a ParserParameter using the given useDelimiter and type value.

Parameters:
useDelimiter - whether to use delimiter for SQL statements
type - the outmost statement type.
See Also:
SQLParserConstants
Method Detail

useDelimiter

public boolean useDelimiter()
Returns a boolean indicating whether to use delimiter for SQL statements.


setUseDelimiter

public void setUseDelimiter(boolean useDelimiter)
Sets the useDelimiter value

Parameters:
useDelimiter -

getProperties

public java.util.HashMap getProperties()
Gets all the properties.

Returns:

setProperties

public void setProperties(java.util.HashMap _properties)
Sets the properties.

Parameters:
_properties -

getProperty

public java.lang.Object getProperty(java.lang.Object key)
Gets the property value as Object

Parameters:
key - property key
Returns:

setProperty

public void setProperty(java.lang.Object key,
                        java.lang.Object value)
Sets the property key to value

Parameters:
key -
value -

getInt

public int getInt(java.lang.Object key)
Convenient method for getProperty(Object key)

Parameters:
key -
Returns:

getBoolean

public boolean getBoolean(java.lang.Object key)
Convenient method for getProperty(Object key)

Parameters:
key -
Returns: