Class AdqlSyntax
Instances INSTANCE20
and INSTANCE21
are currently
provided for ADQL versions 2.0 and 2.1 respectively.
However the differences between these are very small
(just a few extra reserved words for V2.1) so the method
getInstance()
is usually an appropriate way to obtain an
instance of this class.
- Since:
- 22 Jun 2011
- Author:
- Mark Taylor
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String[]
ADQL reserved words additional to the SQL92 set, taken from the ADQL standard.static final String[]
Additional reserved words from ADQL 2.1 section 2.1.4.static final AdqlSyntax
Instance for V2.0 of the ADQL standard.static final AdqlSyntax
Instance for V2.1 of the ADQL standard.Fields inherited from class uk.ac.starlink.table.jdbc.SqlSyntax
SQL92_IDENTIFIER_REGEX, SQL92_RESERVED
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AdqlSyntax
(AdqlVersion adqlVersion) Protected constructor to signal that static instances or methods should usually be used to obtain an instance. -
Method Summary
Modifier and TypeMethodDescriptioncharacterLiteral
(String txt) Returns ADQL text representing a character literal.String[]
getCatalogSchemaTable
(String tableName) Takes an ADQL<table_name>
token and returns a 3-element array giving the catalog, schema and table (delimited or regular) identifiers.static AdqlSyntax
Returns an instance of this class.boolean
isAdqlColumnName
(String token) Indicates whether the given token matches the ADQL<column_name>
production.boolean
isAdqlDelimitedIdentifier
(String token) Indicates whether the given token matches the ADQL<delimited_identifier>
production.boolean
isAdqlTableName
(String token) Indicates whether the given token matches the ADQL<table_name>
production.Takes a regular-or-delimited-identifier and returns its raw form.Methods inherited from class uk.ac.starlink.table.jdbc.SqlSyntax
getParanoidReservedWords, getReservedWords, isIdentifier, isReserved, quote, quoteIfNecessary
-
Field Details
-
ADQL_RESERVED
ADQL reserved words additional to the SQL92 set, taken from the ADQL standard. -
ADQL21_RESERVED
Additional reserved words from ADQL 2.1 section 2.1.4. -
INSTANCE20
Instance for V2.0 of the ADQL standard. -
INSTANCE21
Instance for V2.1 of the ADQL standard.
-
-
Constructor Details
-
AdqlSyntax
Protected constructor to signal that static instances or methods should usually be used to obtain an instance.- Parameters:
adqlVersion
- version of the ADQL standard
-
-
Method Details
-
isAdqlDelimitedIdentifier
Indicates whether the given token matches the ADQL<delimited_identifier>
production.- Parameters:
token
- token to test- Returns:
- true iff token is a delimited_identifier
-
isAdqlColumnName
Indicates whether the given token matches the ADQL<column_name>
production.- Parameters:
token
- token to test- Returns:
- true iff token is a column_name
-
isAdqlTableName
Indicates whether the given token matches the ADQL<table_name>
production.- Parameters:
token
- token to test- Returns:
- true iff token is a table_name
-
getCatalogSchemaTable
Takes an ADQL<table_name>
token and returns a 3-element array giving the catalog, schema and table (delimited or regular) identifiers.For a non-null result, the input token must match the ADQL
<table_name>
production, which is the same rule that TAP_SCHEMA table_name columns must follow, which roughly means it's of the form [catalog.[schema.[table]]]. Either catalog alone, or both catalog and schema, may be null. The return value is either a three-element array (with 1, 2 or 3 non-null elements) in case of a legal table_name input, or null in case of an illegal table_name input.- Parameters:
tableName
- table_name string- Returns:
- 3-element array giving (catalog, schema, table) identifiers, or null for parse failure
-
unquote
Takes a regular-or-delimited-identifier and returns its raw form. For a regular identifier, the output is the same as the input.- Parameters:
identifier
- regular or delimited identifier, or null- Returns:
- identifier with no surrounding quotes or other escaping, or null for null input
-
characterLiteral
Returns ADQL text representing a character literal. This quotes the supplied string by surrounding it with single quotes, escaping any internal single quote characters appropriately.- Parameters:
txt
- raw text- Returns:
- character literal suitable for insertion into ADQL text
-
getInstance
Returns an instance of this class. This currently returns the instance representing ADQL 2.1. There is very little difference between this and the ADQL 2.0 instance, just a few extra reserved words, so it's suitable for general use in most cases.- Returns:
- AdqlSyntax instance
-