public class ADQLQueryFactory
extends java.lang.Object
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.
ADQLParser
Modifier and Type | Class and Description |
---|---|
static class |
ADQLQueryFactory.JoinType
Type of table JOIN.
|
Constructor and Description |
---|
ADQLQueryFactory()
Create a query factory.
|
public ADQLQuery createQuery() throws java.lang.Exception
java.lang.Exception
public ADQLTable createTable(IdentifierItems idItems, IdentifierItems.IdentifierItem alias) throws java.lang.Exception
java.lang.Exception
public ADQLTable createTable(ADQLQuery query, IdentifierItems.IdentifierItem alias) throws java.lang.Exception
java.lang.Exception
public ADQLJoin createJoin(ADQLQueryFactory.JoinType type, FromContent leftTable, FromContent rightTable) throws java.lang.Exception
java.lang.Exception
public ADQLJoin createJoin(ADQLQueryFactory.JoinType type, FromContent leftTable, FromContent rightTable, ClauseConstraints condition) throws java.lang.Exception
java.lang.Exception
public ADQLJoin createJoin(ADQLQueryFactory.JoinType type, FromContent leftTable, FromContent rightTable, java.util.Collection<ADQLColumn> lstColumns) throws java.lang.Exception
java.lang.Exception
public SelectItem createSelectItem(ADQLOperand operand, java.lang.String alias) throws java.lang.Exception
java.lang.Exception
public ADQLColumn createColumn(IdentifierItems idItems) throws java.lang.Exception
java.lang.Exception
public ADQLColumn createColumn(IdentifierItems.IdentifierItem columnName) throws java.lang.Exception
java.lang.Exception
public NumericConstant createNumericConstant(java.lang.String value) throws java.lang.Exception
java.lang.Exception
public StringConstant createStringConstant(java.lang.String value) throws java.lang.Exception
java.lang.Exception
public Operation createOperation(ADQLOperand leftOp, OperationType op, ADQLOperand rightOp) throws java.lang.Exception
java.lang.Exception
public NegativeOperand createNegativeOperand(ADQLOperand opToNegativate) throws java.lang.Exception
java.lang.Exception
public Concatenation createConcatenation() throws java.lang.Exception
java.lang.Exception
public WrappedOperand createWrappedOperand(ADQLOperand opToWrap) throws java.lang.Exception
java.lang.Exception
public ConstraintsGroup createGroupOfConstraints() throws java.lang.Exception
java.lang.Exception
public NotConstraint createNot(ADQLConstraint constraintToNot) throws java.lang.Exception
java.lang.Exception
public Comparison createComparison(ADQLOperand leftOp, ComparisonOperator op, ADQLOperand rightOp) throws java.lang.Exception
java.lang.Exception
public Between createBetween(boolean not, ADQLOperand value, ADQLOperand min, ADQLOperand max) throws java.lang.Exception
java.lang.Exception
public IsNull createIsNull(boolean notNull, ADQLColumn column) throws java.lang.Exception
java.lang.Exception
public Exists createExists(ADQLQuery query) throws java.lang.Exception
java.lang.Exception
public In createIn(ADQLOperand leftOp, ADQLQuery query, boolean notIn) throws java.lang.Exception
java.lang.Exception
public In createIn(ADQLOperand leftOp, ADQLOperand[] valuesList, boolean notIn) throws java.lang.Exception
java.lang.Exception
public SQLFunction createSQLFunction(SQLFunctionType type, ADQLOperand op, boolean distinctValues) throws java.lang.Exception
java.lang.Exception
public MathFunction createMathFunction(MathFunctionType type, ADQLOperand param1, ADQLOperand param2) throws java.lang.Exception
java.lang.Exception
public UserDefinedFunction createUserDefinedFunction(java.lang.String name, ADQLOperand[] params) throws java.lang.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 of UserDefinedFunction
.
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 as DefaultUDF
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).
name
- Name of the user defined function to create.params
- Parameters of the user defined function to create.DefaultUDF
).java.lang.Exception
- If there is a problem while creating the function.public DistanceFunction createDistance(PointFunction point1, PointFunction point2) throws java.lang.Exception
java.lang.Exception
public DistanceFunction createDistance(GeometryFunction.GeometryValue<PointFunction> point1, GeometryFunction.GeometryValue<PointFunction> point2) throws java.lang.Exception
java.lang.Exception
public PointFunction createPoint(ADQLOperand coordSys, ADQLOperand coords, ADQLOperand coords2) throws java.lang.Exception
java.lang.Exception
public BoxFunction createBox(ADQLOperand coordinateSystem, ADQLOperand firstCoord, ADQLOperand secondCoord, ADQLOperand boxWidth, ADQLOperand boxHeight) throws java.lang.Exception
java.lang.Exception
public CircleFunction createCircle(ADQLOperand coordSys, ADQLOperand coord1, ADQLOperand coord2, ADQLOperand radius) throws java.lang.Exception
java.lang.Exception
public CentroidFunction createCentroid(GeometryFunction param) throws java.lang.Exception
java.lang.Exception
public CentroidFunction createCentroid(GeometryFunction.GeometryValue<GeometryFunction> param) throws java.lang.Exception
java.lang.Exception
public RegionFunction createRegion(ADQLOperand param) throws java.lang.Exception
java.lang.Exception
public PolygonFunction createPolygon(ADQLOperand coordSys, java.util.Collection<? extends ADQLOperand> coords) throws java.lang.Exception
java.lang.Exception
public AreaFunction createArea(GeometryFunction param) throws java.lang.Exception
java.lang.Exception
public AreaFunction createArea(GeometryFunction.GeometryValue<GeometryFunction> param) throws java.lang.Exception
java.lang.Exception
public ExtractCoord createCoord1(PointFunction point) throws java.lang.Exception
java.lang.Exception
public ExtractCoord createCoord1(ADQLColumn point) throws java.lang.Exception
java.lang.Exception
public ExtractCoord createCoord2(PointFunction point) throws java.lang.Exception
java.lang.Exception
public ExtractCoord createCoord2(ADQLColumn point) throws java.lang.Exception
java.lang.Exception
public ExtractCoordSys createExtractCoordSys(GeometryFunction param) throws java.lang.Exception
java.lang.Exception
public ExtractCoordSys createExtractCoordSys(ADQLColumn param) throws java.lang.Exception
java.lang.Exception
public ExtractCoordSys createExtractCoordSys(GeometryFunction.GeometryValue<GeometryFunction> param) throws java.lang.Exception
java.lang.Exception
public ContainsFunction createContains(GeometryFunction left, GeometryFunction right) throws java.lang.Exception
java.lang.Exception
public ContainsFunction createContains(GeometryFunction.GeometryValue<GeometryFunction> left, GeometryFunction.GeometryValue<GeometryFunction> right) throws java.lang.Exception
java.lang.Exception
public IntersectsFunction createIntersects(GeometryFunction left, GeometryFunction right) throws java.lang.Exception
java.lang.Exception
public IntersectsFunction createIntersects(GeometryFunction.GeometryValue<GeometryFunction> left, GeometryFunction.GeometryValue<GeometryFunction> right) throws java.lang.Exception
java.lang.Exception
public ADQLOrder createOrder(int ind, boolean desc) throws java.lang.Exception
java.lang.Exception
@Deprecated public ADQLOrder createOrder(int ind, boolean desc, TextPosition position) throws java.lang.Exception
createOrder(int, boolean)
java.lang.Exception
public ADQLOrder createOrder(IdentifierItems.IdentifierItem colName, boolean desc) throws java.lang.Exception
java.lang.Exception
@Deprecated public ADQLOrder createOrder(IdentifierItems idItems, boolean desc) throws java.lang.Exception
createOrder(adql.parser.IdentifierItems.IdentifierItem, boolean)
; This function is no longer used by ADQLParser.java.lang.Exception
public ColumnReference createColRef(IdentifierItems.IdentifierItem idItem) throws java.lang.Exception
java.lang.Exception
public ColumnReference createColRef(IdentifierItems idItems) throws java.lang.Exception
java.lang.Exception
public ColumnReference createColRef(int index, TextPosition position) throws java.lang.Exception
java.lang.Exception