Class LanguageFeature
All ADQLObject
s 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 String
Name (or function signature).final String
Unique identifier of this language feature.static final String
Root IVOID for all the TAPRegExt's language features.final boolean
Is this feature optional in the ADQL grammar?final String
Type of this language feature.static final String
Bit manipulation functions.static final String
Sub-query "alias" (i.e.static final String
Conditional functions (e.g.static final String
Geometric functions/regions.static final String
Query result offset.static final String
Row-set manipulation functions.static final String
String manipulation functionsstatic final String
Datatype manipulation functions (e.g.static final String
Unit manipulation functions (e.g.static final String
User Defined Functions.final FunctionDef
Definition 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
'!'FORM
Examples:
!SELECT
(no type specified for this in the ADQL standard, soTYPE=''
)ivo://ivoa.net/std/TAPRegExt#features-adql-string!LOWER
ivo://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:
null
forSELECT
(no type specified for this in the ADQL standard)ivo://ivoa.net/std/TAPRegExt#features-adql-string
forLOWER
ivo://ivoa.net/std/TAPRegExt#features-udf
forthe UDF
MINE(VARCHAR) -> DOUBLE
-
form
Name (or function signature).MANDATORY
Examples:
SELECT
LOWER
MINE(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
FeatureSet
to declare how supported is an optional feature.Examples:
false
forSELECT
true
forLOWER
true
forMINE(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]true
if the feature is by default supported in the ADQL standard,false
if 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]true
if the feature is by default supported in the ADQL standard,false
if 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 givenFunctionDef
is 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 theFunctionDef
will be used. If empty string, no description will be set.- Throws:
NullPointerException
- If givenFunctionDef
is missing.
-
-
Method Details