Class ADQLQuery
- All Implemented Interfaces:
ADQLObject
Object representation of an ADQL query or sub-query.
The resulting object of the ADQLParser is an object of this class.
- Version:
- 1.4 (11/2017)
- Author:
- Grégory Mantelet (CDS;ARI)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets an iterator on the intern ADQL objects.getCopy()Gets a (deep) copy of this ADQL object.final FromContentgetFrom()Gets the FROM clause of this query.final ClauseADQL<ADQLColumn>Gets the GROUP BY clause of this query.final ClauseConstraintsGets the HAVING clause of this query.getName()Gets the name of this object in ADQL.final ClauseADQL<ADQLOrder>Gets the ORDER BY clause of this query.final TextPositionGets the position of this object/token in the ADQL query.DBColumn[]Gets the list of columns (database metadata) selected by this query.final ClauseSelectGets the SELECT clause of this query.final ClauseConstraintsgetWhere()Gets the WHERE clause of this query.voidreset()Clear all the clauses.search(ISearchHandler sHandler) Lets searching ADQL objects into this ADQL query thanks to the given search handler.voidsetFrom(FromContent newFrom) Replaces its FROM clause by the given one.voidsetGroupBy(ClauseADQL<ADQLColumn> newGroupBy) Replaces its GROUP BY clause by the given one.voidsetHaving(ClauseConstraints newHaving) Replaces its HAVING clause by the given one.voidsetOrderBy(ClauseADQL<ADQLOrder> newOrderBy) Replaces its ORDER BY clause by the given one.final voidsetPosition(TextPosition position) Set the position of thisADQLQuery(or sub-query) inside the whole given ADQL query string.voidsetSelect(ClauseSelect newSelect) Replaces its SELECT clause by the given one.voidsetWhere(ClauseConstraints newWhere) Replaces its WHERE clause by the given one.toADQL()Gets the ADQL expression of this object.
-
Constructor Details
-
ADQLQuery
public ADQLQuery()Builds an empty ADQL query. -
ADQLQuery
Builds an ADQL query by copying the given one.- Parameters:
toCopy- The ADQL query to copy.- Throws:
Exception- If there is an error during the copy.
-
-
Method Details
-
reset
public void reset()Clear all the clauses. -
getSelect
Gets the SELECT clause of this query.- Returns:
- Its SELECT clause.
-
setSelect
Replaces its SELECT clause by the given one.
note: the position of the query is erased.
- Parameters:
newSelect- The new SELECT clause.- Throws:
NullPointerException- If the given SELECT clause is null.
-
getFrom
Gets the FROM clause of this query.- Returns:
- Its FROM clause.
-
setFrom
Replaces its FROM clause by the given one.
note: the position of the query is erased.
- Parameters:
newFrom- The new FROM clause.- Throws:
NullPointerException- If the given FROM clause is null.
-
getWhere
Gets the WHERE clause of this query.- Returns:
- Its WHERE clause.
-
setWhere
Replaces its WHERE clause by the given one.
note: the position of the query is erased.
- Parameters:
newWhere- The new WHERE clause.- Throws:
NullPointerException- If the given WHERE clause is null.
-
getGroupBy
Gets the GROUP BY clause of this query.- Returns:
- Its GROUP BY clause.
-
setGroupBy
Replaces its GROUP BY clause by the given one.
note: the position of the query is erased.
- Parameters:
newGroupBy- The new GROUP BY clause.- Throws:
NullPointerException- If the given GROUP BY clause is null.
-
getHaving
Gets the HAVING clause of this query.- Returns:
- Its HAVING clause.
-
setHaving
Replaces its HAVING clause by the given one.
note: the position of the query is erased.
- Parameters:
newHaving- The new HAVING clause.- Throws:
NullPointerException- If the given HAVING clause is null.
-
getOrderBy
Gets the ORDER BY clause of this query.- Returns:
- Its ORDER BY clause.
-
setOrderBy
Replaces its ORDER BY clause by the given one.
note: the position of the query is erased.
- Parameters:
newOrderBy- The new ORDER BY clause.- Throws:
NullPointerException- If the given ORDER BY clause is null.
-
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
Set the position of thisADQLQuery(or sub-query) inside the whole given ADQL query string.- Parameters:
position- New position of thisADQLQuery.- Since:
- 1.4
-
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.
-
getResultingColumns
Gets the list of columns (database metadata) selected by this query.
Note: The list is generated on the fly !
- Returns:
- Selected columns metadata.
-
search
Lets searching ADQL objects into this ADQL query thanks to the given search handler.- Parameters:
sHandler- A search handler.- Returns:
- An iterator on all ADQL objects found.
-
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.
-