Package adql.query.operand
Class ADQLColumn
java.lang.Object
adql.query.operand.ADQLColumn
- All Implemented Interfaces:
ADQLObject,ADQLOperand,UnknownType
Represents the complete (literal) reference to a column
({schema(s)}.{table}.{column}).
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionADQLColumn(ADQLColumn toCopy) Builds a Column by copying the given one.ADQLColumn(String columnRef) Builds a Column with the complete reference to a column ({schema(s)}.{table}.{column}).ADQLColumn(String tableName, String columnName) Builds a column with the given column name and the given table name.ADQLColumn(String schema, String table, String column) Builds a column with the given column name, table name and schema name.ADQLColumn(String catalog, String schema, String table, String column) Builds a column with the given column name, table name, schema name and catalog name. -
Method Summary
Modifier and TypeMethodDescriptionGets an iterator on the intern ADQL objects.final ADQLTableDeprecated.Since v2.0.final byteGets the whole case sensitivity of this ADQL column.final StringGets the name of the catalog which contains this column.final StringGets the name of this column.getCopy()Gets a (deep) copy of this ADQL object.final DBColumnGets the correspondingDBColumn.charGet the type expected by the syntactic parser according to the context.final LanguageFeatureGet the description of this ADQL's Language Feature.final StringGets the full name of this column (catalogName .final StringBufferGets the full column prefix (catalogName .getName()Gets the name of this object in ADQL.final TextPositionGets the position of this object/token in the ADQL query.final StringGets the name of the schema which contains this column.final StringGets the name of the table which contains this column.final booleanIndicates whether all fields (catalog, schema, table and column) are case sensitive.final booleanisCaseSensitive(IdentifierField field) Indicates whether the specified field (catalog, schema, table or column) is case sensitive or not.booleanTell whether this operand is a geometrical region or not.booleanTell whether this operand is numeric or not.booleanisString()Tell whether this operand is a string or not.protected StringnormalizeName(String name, IdentifierField field) Lets normalizing any catalog/schema/table name or alias.final voidsetAdqlTable(ADQLTable adqlTable) Deprecated.Since v2.0.final voidsetCaseSensitive(boolean sensitive) Sets the case sensitivity of all fields (catalog, schema, table and column).final voidsetCaseSensitive(byte sensitivity) Sets the whole case sensitivity of this ADQL column.final voidsetCaseSensitive(IdentifierField field, boolean sensitive) Sets the case sensitivity of the specified field (catalog, schema, table, column).final voidsetCatalogName(String catalog) Sets the name of the catalog which contains this column.final voidUpdates the whole Column according to the given column reference ({catalog}.{schema}.{table}.{column}).final voidsetColumnName(String columnName) Changes the name of the column ({column} in {schema(s)}.{table}.{column}).final voidSets theDBColumncorresponding to thisADQLColumn.voidsetExpectedType(char c) Set the type expected for this operand.voidsetPosition(TextPosition pos) Sets the position at which thisADQLColumnhas been found in the original ADQL query string.final voidsetSchemaName(String schema) Sets the name of the schema which contains this column.final voidsetTableName(String tableName) Sets the name of the table which contains this column.toADQL()Gets the ADQL expression of this object.toString()
-
Field Details
-
FEATURE
Description of this ADQL Feature.- Since:
- 2.0
-
-
Constructor Details
-
ADQLColumn
Builds a Column with the complete reference to a column ({schema(s)}.{table}.{column}).- Parameters:
columnRef- The complete reference to a column.- See Also:
-
ADQLColumn
Builds a column with the given column name and the given table name.- Parameters:
tableName- Name of the table.columnName- Name of the column.- See Also:
-
ADQLColumn
Builds a column with the given column name, table name and schema name.- Parameters:
schema- Name of the schema.table- Name of the table.column- Name of the column.- See Also:
-
ADQLColumn
Builds a column with the given column name, table name, schema name and catalog name.- Parameters:
catalog- Name of the catalog.schema- Name of the schema.table- Name of the table.column- Name of the column.- See Also:
-
ADQLColumn
Builds a Column by copying the given one.- Parameters:
toCopy- The Column to copy.
-
-
Method Details
-
getFeatureDescription
Description copied from interface:ADQLObjectGet the description of this ADQL's Language Feature.Note: Getting this description is generally only useful when discovery optional features so that determining if they are allowed to be used in ADQL queries.
- Specified by:
getFeatureDescriptionin interfaceADQLObject- Returns:
- Description of this ADQL object as an ADQL's feature.
-
normalizeName
Lets normalizing any catalog/schema/table name or alias. If the name is surrounded by double-quotes, they are removed and the corresponding field will be declared as case sensitive.- Parameters:
name- Name to normalize.- Returns:
- The normalized name.
-
getPosition
Description copied from interface:ADQLObjectGets the position of this object/token in the ADQL query.By default, no position should be set.
- Specified by:
getPositionin interfaceADQLObject- Returns:
- Position of this ADQL item in the ADQL query, or NULL if not written originally in the query (for example, if added afterwards).
-
setPosition
Sets the position at which thisADQLColumnhas been found in the original ADQL query string.- Parameters:
pos- Position of thisADQLColumn.
-
getCatalogName
Gets the name of the catalog which contains this column.- Returns:
- Catalog name.
-
setCatalogName
Sets the name of the catalog which contains this column.- Parameters:
catalog- New name of the catalog.
-
getSchemaName
Gets the name of the schema which contains this column.- Returns:
- Schema name.
-
setSchemaName
Sets the name of the schema which contains this column.- Parameters:
schema- New name of the schema.
-
getTableName
Gets the name of the table which contains this column.- Returns:
- Table name.
-
setTableName
Sets the name of the table which contains this column.- Parameters:
tableName- New name of the table.
-
getColumnName
Gets the name of this column.- Returns:
- Its column name.
-
getFullColumnName
Gets the full name of this column (catalogName . schemaName . tableName . columnName) by respecting the case sensitivity of each field (if case sensitive, double-quotes will surround the concerned fields name).- Returns:
- Its full name.
- See Also:
-
getFullColumnPrefix
Gets the full column prefix (catalogName . schemaName . tableName) by respecting the case sensitivity of each field (if case sensitive, double-quotes will surround the concerned fields name).- Returns:
- Its full prefix.
-
setColumnName
Changes the name of the column ({column} in {schema(s)}.{table}.{column}).- Parameters:
columnName- The new column name.
-
setColumn
Updates the whole Column according to the given column reference ({catalog}.{schema}.{table}.{column}).- Parameters:
columnRef- The complete column reference ({catalog}.{schema}.{table}.{column}).
-
isCaseSensitive
Indicates whether the specified field (catalog, schema, table or column) is case sensitive or not.- Parameters:
field- A field (catalog, schema, table or column).- Returns:
trueif the specified field is case sensitive,falseotherwise.- See Also:
-
setCaseSensitive
Sets the case sensitivity of the specified field (catalog, schema, table, column).- Parameters:
field- The field for which the case sensitivity must be updated.sensitive-trueif the specified field must be case sensitive,falseotherwise.- See Also:
-
isCaseSensitive
public final boolean isCaseSensitive()Indicates whether all fields (catalog, schema, table and column) are case sensitive.- Returns:
trueif all fields are case sensitive,falseotherwise.- See Also:
-
setCaseSensitive
public final void setCaseSensitive(boolean sensitive) Sets the case sensitivity of all fields (catalog, schema, table and column).- Parameters:
sensitive-trueif all fields must be case sensitive,falseotherwise.- See Also:
-
getCaseSensitive
public final byte getCaseSensitive()Gets the whole case sensitivity of this ADQL column.- Returns:
- Its new case sensitivity (one bit per fields).
- See Also:
-
setCaseSensitive
public final void setCaseSensitive(byte sensitivity) Sets the whole case sensitivity of this ADQL column.- Parameters:
sensitivity- Its new case sensitivity (one bit per fields).- See Also:
-
getDBLink
Gets the correspondingDBColumn.- Returns:
- The corresponding
DBColumn.
-
setDBLink
Sets theDBColumncorresponding to thisADQLColumn.By default, this field is automatically filled by
DBChecker.- Parameters:
dbLink- Its correspondingDBColumn.
-
getAdqlTable
Deprecated.Since v2.0. This function is never used.Gets theADQLTablefrom which this column is supposed to come.- Returns:
- Its source table.
-
setAdqlTable
Deprecated.Since v2.0. This piece of information is never used.Sets theADQLTablefrom which this column is supposed to come.By default, this field is automatically filled by
DBCheckerwhenDBChecker.check(adql.query.ADQLQuery)is called.- Parameters:
adqlTable- Its source table.
-
getExpectedType
public char getExpectedType()Description copied from interface:UnknownTypeGet the type expected by the syntactic parser according to the context.- Specified by:
getExpectedTypein interfaceUnknownType- Returns:
- Expected type: 'n' or 'N' for numeric, 's' or 'S' for string, 'g' or 'G' for geometry.
-
setExpectedType
public void setExpectedType(char c) Description copied from interface:UnknownTypeSet the type expected for this operand.- Specified by:
setExpectedTypein interfaceUnknownType- Parameters:
c- Expected type: 'n' or 'N' for numeric, 's' or 'S' for string, 'g' or 'G' for geometry.
-
isNumeric
public boolean isNumeric()Description copied from interface:ADQLOperandTell whether this operand is numeric or not.- Specified by:
isNumericin interfaceADQLOperand- Returns:
- true if this operand is numeric, false otherwise.
-
isString
public boolean isString()Description copied from interface:ADQLOperandTell whether this operand is a string or not.- Specified by:
isStringin interfaceADQLOperand- Returns:
- true if this operand is a string, false otherwise.
-
isGeometry
public boolean isGeometry()Description copied from interface:ADQLOperandTell whether this operand is a geometrical region or not.- Specified by:
isGeometryin interfaceADQLOperand- Returns:
- true if this operand is a geometry, false otherwise.
-
getCopy
Description copied from interface:ADQLObjectGets a (deep) copy of this ADQL object.- Specified by:
getCopyin interfaceADQLObject- Returns:
- The copy of this ADQL object.
- Throws:
Exception- If there is any error during the copy.
-
getName
Description copied from interface:ADQLObjectGets the name of this object in ADQL.- Specified by:
getNamein interfaceADQLObject- Returns:
- The name of this ADQL object.
-
adqlIterator
Description copied from interface:ADQLObjectGets an iterator on the intern ADQL objects.Note: The returned iterator is particularly used by a
ISearchHandlerextension to browse a whole ADQL tree.- Specified by:
adqlIteratorin interfaceADQLObject- Returns:
- An ADQL objects iterator.
- See Also:
-
toADQL
Description copied from interface:ADQLObjectGets the ADQL expression of this object.- Specified by:
toADQLin interfaceADQLObject- Returns:
- The corresponding ADQL expression.
-
toString
-