public class ADQLColumn extends java.lang.Object implements ADQLOperand, UnknownType
Constructor and Description |
---|
ADQLColumn(ADQLColumn toCopy)
Builds a Column by copying the given one.
|
ADQLColumn(java.lang.String columnRef)
Builds a Column with the complete reference to a column ({schema(s)}.{table}.{column}).
|
ADQLColumn(java.lang.String tableName,
java.lang.String columnName)
Builds a column with the given column name and the given table name.
|
ADQLColumn(java.lang.String schema,
java.lang.String table,
java.lang.String column)
Builds a column with the given column name, table name and schema name.
|
ADQLColumn(java.lang.String catalog,
java.lang.String schema,
java.lang.String table,
java.lang.String column)
Builds a column with the given column name, table name, schema name and catalog name.
|
Modifier and Type | Method and Description |
---|---|
ADQLIterator |
adqlIterator()
Gets an iterator on the intern ADQL objects.
|
ADQLTable |
getAdqlTable()
Gets the
ADQLTable from which this column is supposed to come. |
byte |
getCaseSensitive()
Gets the whole case sensitivity of this ADQL column.
|
java.lang.String |
getCatalogName()
Gets the name of the catalog which contains this column.
|
java.lang.String |
getColumnName()
Gets the name of this column.
|
ADQLObject |
getCopy()
Gets a (deep) copy of this ADQL object.
|
DBColumn |
getDBLink()
Gets the corresponding
DBColumn . |
char |
getExpectedType()
Get the type expected by the syntactic parser according to the context.
|
java.lang.String |
getFullColumnName()
Gets the full name of this column (catalogName .
|
java.lang.StringBuffer |
getFullColumnPrefix()
Gets the full column prefix (catalogName .
|
java.lang.String |
getName()
Gets the name of this object in ADQL.
|
TextPosition |
getPosition()
Gets the position of this object/token in the ADQL query.
|
java.lang.String |
getSchemaName()
Gets the name of the schema which contains this column.
|
java.lang.String |
getTableName()
Gets the name of the table which contains this column.
|
boolean |
isCaseSensitive()
Indicates whether all fields (catalog, schema, table and column) are case sensitive.
|
boolean |
isCaseSensitive(IdentifierField field)
Indicates whether the specified field (catalog, schema, table or column) is case sensitive or not.
|
boolean |
isGeometry()
Tell whether this operand is a geometrical region or not.
|
boolean |
isNumeric()
Tell whether this operand is numeric or not.
|
boolean |
isString()
Tell whether this operand is a string or not.
|
protected java.lang.String |
normalizeName(java.lang.String name,
IdentifierField field)
Lets normalizing any catalog/schema/table name or alias.
|
void |
setAdqlTable(ADQLTable adqlTable)
Sets the
ADQLTable from which this column is supposed to come. |
void |
setCaseSensitive(boolean sensitive)
Sets the case sensitivity of all fields (catalog, schema, table and column).
|
void |
setCaseSensitive(byte sensitivity)
Sets the whole case sensitivity of this ADQL column.
|
void |
setCaseSensitive(IdentifierField field,
boolean sensitive)
Sets the case sensitivity of the specified field (catalog, schema, table, column).
|
void |
setCatalogName(java.lang.String catalog)
Sets the name of the catalog which contains this column.
|
void |
setColumn(java.lang.String columnRef)
Updates the whole Column according to the given column reference ({catalog}.{schema}.{table}.{column}).
|
void |
setColumnName(java.lang.String columnName)
Changes the name of the column ({column} in {schema(s)}.{table}.{column}).
|
void |
setDBLink(DBColumn dbLink)
Sets the
DBColumn corresponding to this ADQLColumn . |
void |
setExpectedType(char c)
Set the type expected for this operand.
|
void |
setPosition(TextPosition pos)
Sets the position at which this
ADQLColumn has been found in the original ADQL query string. |
void |
setSchemaName(java.lang.String schema)
Sets the name of the schema which contains this column.
|
void |
setTableName(java.lang.String tableName)
Sets the name of the table which contains this column.
|
java.lang.String |
toADQL()
Gets the ADQL expression of this object.
|
java.lang.String |
toString() |
public ADQLColumn(java.lang.String columnRef)
columnRef
- The complete reference to a column.setColumn(String)
public ADQLColumn(java.lang.String tableName, java.lang.String columnName)
tableName
- Name of the table.columnName
- Name of the column.setTableName(String)
,
setColumnName(String)
public ADQLColumn(java.lang.String schema, java.lang.String table, java.lang.String column)
schema
- Name of the schema.table
- Name of the table.column
- Name of the column.ADQLColumn(String, String)
,
setSchemaName(String)
public ADQLColumn(java.lang.String catalog, java.lang.String schema, java.lang.String table, java.lang.String column)
catalog
- Name of the catalog.schema
- Name of the schema.table
- Name of the table.column
- Name of the column.ADQLColumn(String, String)
,
setSchemaName(String)
public ADQLColumn(ADQLColumn toCopy)
toCopy
- The Column to copy.protected java.lang.String normalizeName(java.lang.String name, IdentifierField field)
name
- Name to normalize.public final TextPosition getPosition()
ADQLObject
Gets the position of this object/token in the ADQL query.
By default, no position should be set.
getPosition
in interface ADQLObject
public void setPosition(TextPosition pos)
ADQLColumn
has been found in the original ADQL query string.pos
- Position of this ADQLColumn
.public final java.lang.String getCatalogName()
public final void setCatalogName(java.lang.String catalog)
catalog
- New name of the catalog.public final java.lang.String getSchemaName()
public final void setSchemaName(java.lang.String schema)
schema
- New name of the schema.public final java.lang.String getTableName()
public final void setTableName(java.lang.String tableName)
tableName
- New name of the table.public final java.lang.String getColumnName()
public final java.lang.String getFullColumnName()
getFullColumnPrefix()
public final java.lang.StringBuffer getFullColumnPrefix()
public final void setColumnName(java.lang.String columnName)
columnName
- The new column name.public final void setColumn(java.lang.String columnRef)
columnRef
- The complete column reference ({catalog}.{schema}.{table}.{column}).public final boolean isCaseSensitive(IdentifierField field)
field
- A field (catalog, schema, table or column).IdentifierField
,
IdentifierField.isCaseSensitive(byte)
public final void setCaseSensitive(IdentifierField field, boolean sensitive)
field
- The field for which the case sensitivity must be updated.sensitive
- true if the specified field must be case sensitive, false otherwise.IdentifierField
,
IdentifierField.setCaseSensitive(byte, boolean)
public final boolean isCaseSensitive()
IdentifierField.isFullCaseSensitive(byte)
public final void setCaseSensitive(boolean sensitive)
sensitive
- true if all fields must be case sensitive, false otherwise.IdentifierField.getFullCaseSensitive(boolean)
public final byte getCaseSensitive()
IdentifierField
public final void setCaseSensitive(byte sensitivity)
sensitivity
- Its new case sensitivity (one bit per fields).IdentifierField
public final DBColumn getDBLink()
DBColumn
.DBColumn
.public final void setDBLink(DBColumn dbLink)
Sets the DBColumn
corresponding to this ADQLColumn
.
By default, this field is automatically filled by DBChecker
.
dbLink
- Its corresponding DBColumn
.public final ADQLTable getAdqlTable()
ADQLTable
from which this column is supposed to come.public final void setAdqlTable(ADQLTable adqlTable)
Sets the ADQLTable
from which this column is supposed to come.
By default, this field is automatically filled by DBChecker
when DBChecker.check(adql.query.ADQLQuery)
is called.
adqlTable
- Its source table.public char getExpectedType()
UnknownType
getExpectedType
in interface UnknownType
public void setExpectedType(char c)
UnknownType
setExpectedType
in interface UnknownType
c
- Expected type: 'n' or 'N' for numeric, 's' or 'S' for string, 'g' or 'G' for geometry.public boolean isNumeric()
ADQLOperand
isNumeric
in interface ADQLOperand
public boolean isString()
ADQLOperand
isString
in interface ADQLOperand
public boolean isGeometry()
ADQLOperand
isGeometry
in interface ADQLOperand
public ADQLObject getCopy() throws java.lang.Exception
ADQLObject
getCopy
in interface ADQLObject
java.lang.Exception
- If there is any error during the copy.public java.lang.String getName()
ADQLObject
getName
in interface ADQLObject
public ADQLIterator adqlIterator()
ADQLObject
Gets an iterator on the intern ADQL objects.
Note:The returned iterator is particularly used by a ISearchHandler
extension to browse a whole ADQL tree.
adqlIterator
in interface ADQLObject
ADQLIterator
,
ISearchHandler
public java.lang.String toADQL()
ADQLObject
toADQL
in interface ADQLObject
public java.lang.String toString()
toString
in class java.lang.Object