public class AdqlValidator extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
AdqlValidator.ValidatorTable
Defines table metadata for tables known to the validator.
|
Modifier and Type | Method and Description |
---|---|
static AdqlValidator |
createValidator()
Returns a basic validator instance.
|
static AdqlValidator |
createValidator(AdqlValidator.ValidatorTable[] vtables)
Returns a validator instance that knows about available tables.
|
static AdqlValidator |
createValidator(AdqlValidator.ValidatorTable[] vtables,
TapLanguage lang)
Creates an instance given a set of table metadata and a TapLanguage
description object.
|
String |
fixup(String query)
Attempts to fix common errors in a submitted query.
|
static void |
main(String[] args)
Tests parser.
|
void |
setAdqlVersion(AdqlVersion version)
Sets the version of ADQL against which this validator will check.
|
void |
setAllowAnyUdf(boolean isAllowed)
Configures whether the parser will allow undeclared functions.
|
void |
validate(String query)
Validates an ADQL string.
|
public void setAdqlVersion(AdqlVersion version)
version
- ADQL version to use, or null for defaultpublic void setAllowAnyUdf(boolean isAllowed)
isAllowed
- true to allow undeclared functions, false to rejectpublic void validate(String query) throws adql.parser.grammar.ParseException, adql.parser.grammar.TokenMgrError
query
- ADQL query stringadql.parser.grammar.ParseException
- if the string is not valid ADQLadql.parser.grammar.TokenMgrError
- if something has gone wrong with the parsingpublic String fixup(String query)
query
- input ADQLpublic static AdqlValidator createValidator()
public static AdqlValidator createValidator(AdqlValidator.ValidatorTable[] vtables)
vtables
- table metadata for database to be checked againstpublic static AdqlValidator createValidator(AdqlValidator.ValidatorTable[] vtables, TapLanguage lang)
vtables
- table metadatalang
- language specificspublic static void main(String[] args) throws adql.parser.grammar.ParseException, IOException, SAXException
-h
for usage.adql.parser.grammar.ParseException
IOException
SAXException
Copyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.