Class LanguageFeature
All ADQLObjects MUST provide an instance of
this class, even if not optional.
A LanguageFeature is indeed particularly useful to identify optional
ADQL features (e.g. LOWER, WITH). This is the role
of the ADQLParser to generate an error if an
optional feature is used in a query while declared as unsupported.
Note:
Most of ADQL objects are not associated with any IVOA standard (e.g.
TAPRegExt) apart from ADQL. In such case, the attribute type is
set to NULL.
IMPORTANT note about UDF:
To create a UDF feature (i.e. a LanguageFeature with the type
TYPE_UDF), ONLY ONE constructor can be used:
LanguageFeature(FunctionDef, String). Any attempt with another
public constructor will fail.
- Since:
- 2.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionDescription of this feature.final StringName (or function signature).final StringUnique identifier of this language feature.static final StringRoot IVOID for all the TAPRegExt's language features.final booleanIs this feature optional in the ADQL grammar?final StringType of this language feature.static final StringBit manipulation functions.static final StringSub-query "alias" (i.e.static final StringConditional functions (e.g.static final StringGeometric functions/regions.static final StringQuery result offset.static final StringRow-set manipulation functions.static final StringString manipulation functionsstatic final StringDatatype manipulation functions (e.g.static final StringUnit manipulation functions (e.g.static final StringUser Defined Functions.final FunctionDefDefinition of the UDF represented by thisLanguageFeature. -
Constructor Summary
ConstructorsConstructorDescriptionLanguageFeature(FunctionDef udfDef) Create a UDF feature.LanguageFeature(FunctionDef udfDef, String description) Create a UDF feature.LanguageFeature(String type, String form) Create a de-facto supported (i.e.LanguageFeature(String type, String form, boolean optional) Create a language feature.LanguageFeature(String type, String form, boolean optional, String description) Create a language feature. -
Method Summary
-
Field Details
-
id
Unique identifier of this language feature.MANDATORY
This identifier should follow this syntax:
TYPE'!'FORMExamples:
!SELECT(no type specified for this in the ADQL standard, soTYPE='')ivo://ivoa.net/std/TAPRegExt#features-adql-string!LOWERivo://ivoa.net/std/TAPRegExt#features-udf!MINE(VARCHAR) -> DOUBLE
-
type
Type of this language feature.OPTIONAL
All types mentioned in the ADQL standard are listed as public static final attributes of this class ; they all start with
TYPE_(ex:TYPE_ADQL_STRING).If no type is specified for this language feature in the ADQL standard, set this field to
null.Examples:
nullforSELECT(no type specified for this in the ADQL standard)ivo://ivoa.net/std/TAPRegExt#features-adql-stringforLOWERivo://ivoa.net/std/TAPRegExt#features-udfforthe UDFMINE(VARCHAR) -> DOUBLE
-
form
Name (or function signature).MANDATORY
Examples:
SELECTLOWERMINE(VARCHAR) -> DOUBLE
-
udfDefinition
Definition of the UDF represented by thisLanguageFeature.OPTIONAL
-
optional
public final boolean optionalIs this feature optional in the ADQL grammar?MANDATORY
An optional language feature can be used in an ADQL query only if it is declared as supported by the ADQL client (i.e. TAP service). To do, one should use
FeatureSetto declare how supported is an optional feature.Examples:
falseforSELECTtrueforLOWERtrueforMINE(VARCHAR) -> DOUBLE
-
description
Description of this feature.OPTIONAL
-
IVOID_TAP_REGEXT
Root IVOID for all the TAPRegExt's language features.- See Also:
-
TYPE_UDF
User Defined Functions.- See Also:
-
TYPE_ADQL_GEO
Geometric functions/regions.- See Also:
-
TYPE_ADQL_STRING
String manipulation functions- See Also:
-
TYPE_ADQL_SETS
Row-set manipulation functions.- See Also:
-
TYPE_ADQL_COMMON_TABLE
Sub-query "alias" (i.e.WITH).- See Also:
-
TYPE_ADQL_TYPE
Datatype manipulation functions (e.g.CAST).- See Also:
-
TYPE_ADQL_CONDITIONAL
Conditional functions (e.g.COALESCE).- See Also:
-
TYPE_ADQL_UNIT
Unit manipulation functions (e.g.IN_UNIT).- See Also:
-
TYPE_ADQL_BITWISE
Bit manipulation functions.- See Also:
-
TYPE_ADQL_OFFSET
Query result offset.- See Also:
-
-
Constructor Details
-
LanguageFeature
Create a de-facto supported (i.e. non-optional) language feature.IMPORTANT note: To create a UDF feature, DO NOT use this constructor. You MUST use instead
LanguageFeature(FunctionDef, String).- Parameters:
type- [OPTIONAL] Category of the language feature. (see all static attributes starting withTYPE_)form- [REQUIRED] Name (or function signature) of the language feature.- Throws:
NullPointerException- If the given form is missing.
-
LanguageFeature
Create a language feature.IMPORTANT note: To create a UDF feature, DO NOT use this constructor. You MUST use instead
LanguageFeature(FunctionDef, String).- Parameters:
type- [OPTIONAL] Category of the language feature. (see all static attributes starting withTYPE_)form- [REQUIRED] Name (or function signature) of the language feature.optional- [REQUIRED]trueif the feature is by default supported in the ADQL standard,falseif the ADQL client must declare it as supported in order to use it.- Throws:
NullPointerException- If the given form is missing.
-
LanguageFeature
public LanguageFeature(String type, String form, boolean optional, String description) throws NullPointerException Create a language feature.IMPORTANT note: To create a UDF feature, DO NOT use this constructor. You MUST use instead
LanguageFeature(FunctionDef, String).- Parameters:
type- [OPTIONAL] Category of the language feature. (see all static attributes starting withTYPE_)form- [REQUIRED] Name (or function signature) of the language feature.optional- [REQUIRED]trueif the feature is by default supported in the ADQL standard,falseif the ADQL client must declare it as supported in order to use it.description- [OPTIONAL] Description of this feature.- Throws:
NullPointerException- If given form is missing.
-
LanguageFeature
Create a UDF feature.- Parameters:
udfDef- [REQUIRED] Detailed definition of the UDF feature.- Throws:
NullPointerException- If givenFunctionDefis missing.
-
LanguageFeature
Create a UDF feature.- Parameters:
udfDef- [REQUIRED] Detailed definition of the UDF feature.description- [OPTIONAL] Description overwriting the description provided in the givenFunctionDef. If NULL, the description of theFunctionDefwill be used. If empty string, no description will be set.- Throws:
NullPointerException- If givenFunctionDefis missing.
-
-
Method Details