public class AdqlSyntax extends SqlSyntax
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.
Modifier and Type | Field and Description |
---|---|
static String[] |
ADQL_RESERVED
ADQL reserved words additional to the SQL92 set,
taken from the ADQL standard.
|
static String[] |
ADQL21_RESERVED
Additional reserved words from ADQL 2.1 section 2.1.4.
|
static AdqlSyntax |
INSTANCE20
Instance for V2.0 of the ADQL standard.
|
static AdqlSyntax |
INSTANCE21
Instance for V2.1 of the ADQL standard.
|
SQL92_IDENTIFIER_REGEX, SQL92_RESERVED
Modifier | Constructor and Description |
---|---|
protected |
AdqlSyntax(AdqlVersion adqlVersion)
Protected constructor to signal that static instances or
methods should usually be used to obtain an instance.
|
Modifier and Type | Method and Description |
---|---|
String |
characterLiteral(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 |
getInstance()
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. |
String |
unquote(String identifier)
Takes a regular-or-delimited-identifier and returns its raw form.
|
getParanoidReservedWords, getReservedWords, isIdentifier, isReserved, quote, quoteIfNecessary
public static final String[] ADQL_RESERVED
public static final String[] ADQL21_RESERVED
public static final AdqlSyntax INSTANCE20
public static final AdqlSyntax INSTANCE21
protected AdqlSyntax(AdqlVersion adqlVersion)
adqlVersion
- version of the ADQL standardpublic boolean isAdqlDelimitedIdentifier(String token)
<delimited_identifier>
production.token
- token to testpublic boolean isAdqlColumnName(String token)
<column_name>
production.token
- token to testpublic boolean isAdqlTableName(String token)
<table_name>
production.token
- token to testpublic String[] getCatalogSchemaTable(String tableName)
<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.
tableName
- table_name stringpublic String unquote(String identifier)
identifier
- regular or delimited identifier, or nullpublic String characterLiteral(String txt)
txt
- raw textpublic static AdqlSyntax getInstance()
Copyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.