Class ADQLQueryFactory
- Direct Known Subclasses:
SQLServer_ADQLQueryFactory
This class lets the ADQLParser
to build an object representation of an ADQL query.
To customize the object representation you merely have to extends the appropriate functions of this class.
- Version:
- 1.4 (04/2017)
- Author:
- Grégory Mantelet (CDS;ARI)
- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateArea
(GeometryFunction param) createBetween
(boolean not, ADQLOperand value, ADQLOperand min, ADQLOperand max) createBox
(ADQLOperand coordinateSystem, ADQLOperand firstCoord, ADQLOperand secondCoord, ADQLOperand boxWidth, ADQLOperand boxHeight) createCentroid
(GeometryFunction param) createCircle
(ADQLOperand coordSys, ADQLOperand coord1, ADQLOperand coord2, ADQLOperand radius) createColRef
(int index, TextPosition position) createColRef
(IdentifierItems idItems) createColumn
(IdentifierItems idItems) createColumn
(IdentifierItems.IdentifierItem columnName) createComparison
(ADQLOperand leftOp, ComparisonOperator op, ADQLOperand rightOp) createContains
(GeometryFunction.GeometryValue<GeometryFunction> left, GeometryFunction.GeometryValue<GeometryFunction> right) createContains
(GeometryFunction left, GeometryFunction right) createCoord1
(ADQLColumn point) createCoord1
(PointFunction point) createCoord2
(ADQLColumn point) createCoord2
(PointFunction point) createDistance
(GeometryFunction.GeometryValue<PointFunction> point1, GeometryFunction.GeometryValue<PointFunction> point2) createDistance
(PointFunction point1, PointFunction point2) createExists
(ADQLQuery query) createExtractCoordSys
(ADQLColumn param) createIn
(ADQLOperand leftOp, ADQLQuery query, boolean notIn) createIn
(ADQLOperand leftOp, ADQLOperand[] valuesList, boolean notIn) createIntersects
(GeometryFunction.GeometryValue<GeometryFunction> left, GeometryFunction.GeometryValue<GeometryFunction> right) createIntersects
(GeometryFunction left, GeometryFunction right) createIsNull
(boolean notNull, ADQLColumn column) createJoin
(ADQLQueryFactory.JoinType type, FromContent leftTable, FromContent rightTable) createJoin
(ADQLQueryFactory.JoinType type, FromContent leftTable, FromContent rightTable, ClauseConstraints condition) createJoin
(ADQLQueryFactory.JoinType type, FromContent leftTable, FromContent rightTable, Collection<ADQLColumn> lstColumns) createMathFunction
(MathFunctionType type, ADQLOperand param1, ADQLOperand param2) createNegativeOperand
(ADQLOperand opToNegativate) createNot
(ADQLConstraint constraintToNot) createNumericConstant
(String value) createOperation
(ADQLOperand leftOp, OperationType op, ADQLOperand rightOp) createOrder
(int ind, boolean desc) createOrder
(int ind, boolean desc, TextPosition position) Deprecated.createOrder
(IdentifierItems.IdentifierItem colName, boolean desc) createOrder
(IdentifierItems idItems, boolean desc) Deprecated.since 1.4 ; Former version's mistake: an ORDER BY item is either a regular/delimited column name or an integer, not a qualified column name ; Replaced bycreateOrder(adql.parser.IdentifierItems.IdentifierItem, boolean)
; This function is no longer used by ADQLParser.createPoint
(ADQLOperand coordSys, ADQLOperand coords, ADQLOperand coords2) createPolygon
(ADQLOperand coordSys, Collection<? extends ADQLOperand> coords) createRegion
(ADQLOperand param) createSelectItem
(ADQLOperand operand, String alias) createSQLFunction
(SQLFunctionType type, ADQLOperand op, boolean distinctValues) createStringConstant
(String value) createTable
(IdentifierItems idItems, IdentifierItems.IdentifierItem alias) createTable
(ADQLQuery query, IdentifierItems.IdentifierItem alias) createUserDefinedFunction
(String name, ADQLOperand[] params) Creates the user defined functions called as the given name and with the given parameters.createWrappedOperand
(ADQLOperand opToWrap)
-
Constructor Details
-
ADQLQueryFactory
public ADQLQueryFactory()Create a query factory.
-
-
Method Details
-
createQuery
- Throws:
Exception
-
createTable
public ADQLTable createTable(IdentifierItems idItems, IdentifierItems.IdentifierItem alias) throws Exception - Throws:
Exception
-
createTable
public ADQLTable createTable(ADQLQuery query, IdentifierItems.IdentifierItem alias) throws Exception - Throws:
Exception
-
createJoin
public ADQLJoin createJoin(ADQLQueryFactory.JoinType type, FromContent leftTable, FromContent rightTable) throws Exception - Throws:
Exception
-
createJoin
public ADQLJoin createJoin(ADQLQueryFactory.JoinType type, FromContent leftTable, FromContent rightTable, ClauseConstraints condition) throws Exception - Throws:
Exception
-
createJoin
public ADQLJoin createJoin(ADQLQueryFactory.JoinType type, FromContent leftTable, FromContent rightTable, Collection<ADQLColumn> lstColumns) throws Exception - Throws:
Exception
-
createSelectItem
- Throws:
Exception
-
createColumn
- Throws:
Exception
-
createColumn
- Throws:
Exception
-
createNumericConstant
- Throws:
Exception
-
createStringConstant
- Throws:
Exception
-
createOperation
public Operation createOperation(ADQLOperand leftOp, OperationType op, ADQLOperand rightOp) throws Exception - Throws:
Exception
-
createNegativeOperand
- Throws:
Exception
-
createConcatenation
- Throws:
Exception
-
createWrappedOperand
- Throws:
Exception
-
createGroupOfConstraints
- Throws:
Exception
-
createNot
- Throws:
Exception
-
createComparison
public Comparison createComparison(ADQLOperand leftOp, ComparisonOperator op, ADQLOperand rightOp) throws Exception - Throws:
Exception
-
createBetween
public Between createBetween(boolean not, ADQLOperand value, ADQLOperand min, ADQLOperand max) throws Exception - Throws:
Exception
-
createIsNull
- Throws:
Exception
-
createExists
- Throws:
Exception
-
createIn
- Throws:
Exception
-
createIn
- Throws:
Exception
-
createSQLFunction
public SQLFunction createSQLFunction(SQLFunctionType type, ADQLOperand op, boolean distinctValues) throws Exception - Throws:
Exception
-
createMathFunction
public MathFunction createMathFunction(MathFunctionType type, ADQLOperand param1, ADQLOperand param2) throws Exception - Throws:
Exception
-
createUserDefinedFunction
public UserDefinedFunction createUserDefinedFunction(String name, ADQLOperand[] params) throws Exception Creates the user defined functions called as the given name and with the given parameters.
By default, this function returns a
DefaultUDF
instance. It is generic enough to cover every kind of functions. But you can of course override this function in order to return your own instance ofUserDefinedFunction
. In this case, you may not forget to call the super function (super.createUserDefinedFunction(name, params)) so that all other unknown functions are still returned asDefaultUDF
instances.IMPORTANT: The tests done to check whether a user defined function is allowed/managed in this implementation, is done later by the parser. Only declared UDF will pass the test of the parser. For that, you should give it a list of allowed UDFs (each UDF will be then represented by a
FunctionDef
object).- Parameters:
name
- Name of the user defined function to create.params
- Parameters of the user defined function to create.- Returns:
- The corresponding user defined function (by default an instance of
DefaultUDF
). - Throws:
Exception
- If there is a problem while creating the function.
-
createDistance
- Throws:
Exception
-
createDistance
public DistanceFunction createDistance(GeometryFunction.GeometryValue<PointFunction> point1, GeometryFunction.GeometryValue<PointFunction> point2) throws Exception - Throws:
Exception
-
createPoint
public PointFunction createPoint(ADQLOperand coordSys, ADQLOperand coords, ADQLOperand coords2) throws Exception - Throws:
Exception
-
createBox
public BoxFunction createBox(ADQLOperand coordinateSystem, ADQLOperand firstCoord, ADQLOperand secondCoord, ADQLOperand boxWidth, ADQLOperand boxHeight) throws Exception - Throws:
Exception
-
createCircle
public CircleFunction createCircle(ADQLOperand coordSys, ADQLOperand coord1, ADQLOperand coord2, ADQLOperand radius) throws Exception - Throws:
Exception
-
createCentroid
- Throws:
Exception
-
createCentroid
public CentroidFunction createCentroid(GeometryFunction.GeometryValue<GeometryFunction> param) throws Exception - Throws:
Exception
-
createRegion
- Throws:
Exception
-
createPolygon
public PolygonFunction createPolygon(ADQLOperand coordSys, Collection<? extends ADQLOperand> coords) throws Exception - Throws:
Exception
-
createArea
- Throws:
Exception
-
createArea
public AreaFunction createArea(GeometryFunction.GeometryValue<GeometryFunction> param) throws Exception - Throws:
Exception
-
createCoord1
- Throws:
Exception
-
createCoord1
- Throws:
Exception
-
createCoord2
- Throws:
Exception
-
createCoord2
- Throws:
Exception
-
createExtractCoordSys
- Throws:
Exception
-
createExtractCoordSys
- Throws:
Exception
-
createExtractCoordSys
public ExtractCoordSys createExtractCoordSys(GeometryFunction.GeometryValue<GeometryFunction> param) throws Exception - Throws:
Exception
-
createContains
public ContainsFunction createContains(GeometryFunction left, GeometryFunction right) throws Exception - Throws:
Exception
-
createContains
public ContainsFunction createContains(GeometryFunction.GeometryValue<GeometryFunction> left, GeometryFunction.GeometryValue<GeometryFunction> right) throws Exception - Throws:
Exception
-
createIntersects
public IntersectsFunction createIntersects(GeometryFunction left, GeometryFunction right) throws Exception - Throws:
Exception
-
createIntersects
public IntersectsFunction createIntersects(GeometryFunction.GeometryValue<GeometryFunction> left, GeometryFunction.GeometryValue<GeometryFunction> right) throws Exception - Throws:
Exception
-
createOrder
- Throws:
Exception
- Since:
- 1.4
-
createOrder
@Deprecated public ADQLOrder createOrder(int ind, boolean desc, TextPosition position) throws Exception Deprecated.since 1.4 ; Replaced bycreateOrder(int, boolean)
- Throws:
Exception
-
createOrder
- Throws:
Exception
-
createOrder
Deprecated.since 1.4 ; Former version's mistake: an ORDER BY item is either a regular/delimited column name or an integer, not a qualified column name ; Replaced bycreateOrder(adql.parser.IdentifierItems.IdentifierItem, boolean)
; This function is no longer used by ADQLParser.- Throws:
Exception
-
createColRef
- Throws:
Exception
-
createColRef
- Throws:
Exception
-
createColRef
- Throws:
Exception
-
createOrder(int, boolean)