- java.lang.Object
-
- net.sf.jsqlparser.parser.ASTNodeAccessImpl
-
- net.sf.jsqlparser.expression.Function
-
- All Implemented Interfaces:
Serializable,Expression,Model,net.sf.jsqlparser.parser.ASTNodeAccess
- Direct Known Subclasses:
TableFunction
public class Function extends net.sf.jsqlparser.parser.ASTNodeAccessImpl implements Expression
A function as MAX,COUNT...- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFunction.HavingClausestatic classFunction.NullHandling
-
Constructor Summary
Constructors Constructor Description Function()Function(String name, Expression... parameters)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description <T,S>
Taccept(ExpressionVisitor<T> expressionVisitor, S context)ObjectgetAttribute()<E extends Expression>
EgetAttribute(Class<E> type)ColumngetAttributeColumn()StringgetAttributeName()Deprecated.Function.HavingClausegetHavingClause()KeepExpressiongetKeep()LimitgetLimit()List<String>getMultipartName()StringgetName()NamedExpressionList<?>getNamedParameters()the parameters might be named parameters, e.g. substring('foobar' from 2 for 3)Function.NullHandlinggetNullHandling()List<OrderByElement>getOrderByElements()ExpressionList<?>getParameters()The list of parameters of the function (if any, else null) If the parameter is "*", allColumns is set to truebooleanisAllColumns()booleanisDistinct()true if the function is "distinct"booleanisEscaped()Return true if it's in the form "{fn function_body() }"booleanisIgnoreNulls()booleanisIgnoreNullsOutside()booleanisUnique()true if the function is "unique"voidsetAllColumns(boolean b)voidsetAttribute(Expression attributeExpression)voidsetAttribute(Column attributeColumn)voidsetAttributeName(String attributeName)voidsetDistinct(boolean b)voidsetEscaped(boolean isEscaped)FunctionsetHavingClause(String havingType, Expression expression)FunctionsetHavingClause(Function.HavingClause havingClause)voidsetIgnoreNulls(boolean ignoreNulls)This is at the moment only necessary for AnalyticExpression initialization and not for normal functions.FunctionsetIgnoreNullsOutside(boolean ignoreNullsOutside)voidsetKeep(KeepExpression keep)FunctionsetLimit(Limit limit)voidsetName(String string)voidsetName(List<String> string)voidsetNamedParameters(NamedExpressionList<?> list)FunctionsetNullHandling(Function.NullHandling nullHandling)voidsetOrderByElements(List<OrderByElement> orderByElements)voidsetParameters(Expression... expressions)voidsetParameters(ExpressionList<?> list)voidsetUnique(boolean b)StringtoString()FunctionwithAllColumns(boolean allColumns)FunctionwithAttribute(Expression attribute)FunctionwithAttribute(Column attributeColumn)FunctionwithAttributeName(String attributeName)Deprecated.FunctionwithDistinct(boolean distinct)FunctionwithIgnoreNulls(boolean ignoreNulls)FunctionwithKeep(KeepExpression keep)FunctionwithName(String name)FunctionwithName(List<String> nameparts)FunctionwithNamedParameters(NamedExpressionList<?> namedParameters)FunctionwithParameters(Expression... parameters)FunctionwithParameters(ExpressionList<?> parameters)FunctionwithUnique(boolean unique)-
Methods inherited from class net.sf.jsqlparser.parser.ASTNodeAccessImpl
appendTo, getASTNode, getParent, getParent, setASTNode
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.sf.jsqlparser.expression.Expression
accept
-
-
-
-
Constructor Detail
-
Function
public Function()
-
Function
public Function(String name, Expression... parameters)
-
-
Method Detail
-
accept
public <T,S> T accept(ExpressionVisitor<T> expressionVisitor, S context)
- Specified by:
acceptin interfaceExpression
-
getName
public String getName()
-
setName
public void setName(String string)
-
isAllColumns
public boolean isAllColumns()
-
setAllColumns
public void setAllColumns(boolean b)
-
getNullHandling
public Function.NullHandling getNullHandling()
-
setNullHandling
public Function setNullHandling(Function.NullHandling nullHandling)
-
isIgnoreNullsOutside
public boolean isIgnoreNullsOutside()
-
setIgnoreNullsOutside
public Function setIgnoreNullsOutside(boolean ignoreNullsOutside)
-
getLimit
public Limit getLimit()
-
isIgnoreNulls
public boolean isIgnoreNulls()
-
setIgnoreNulls
public void setIgnoreNulls(boolean ignoreNulls)
This is at the moment only necessary for AnalyticExpression initialization and not for normal functions. Therefore there is no deparsing for it for normal functions.
-
getHavingClause
public Function.HavingClause getHavingClause()
-
setHavingClause
public Function setHavingClause(Function.HavingClause havingClause)
-
setHavingClause
public Function setHavingClause(String havingType, Expression expression)
-
isDistinct
public boolean isDistinct()
true if the function is "distinct"- Returns:
- true if the function is "distinct"
-
setDistinct
public void setDistinct(boolean b)
-
isUnique
public boolean isUnique()
true if the function is "unique"- Returns:
- true if the function is "unique"
-
setUnique
public void setUnique(boolean b)
-
getParameters
public ExpressionList<?> getParameters()
The list of parameters of the function (if any, else null) If the parameter is "*", allColumns is set to true- Returns:
- the list of parameters of the function (if any, else null)
-
setParameters
public void setParameters(Expression... expressions)
-
setParameters
public void setParameters(ExpressionList<?> list)
-
getNamedParameters
public NamedExpressionList<?> getNamedParameters()
the parameters might be named parameters, e.g. substring('foobar' from 2 for 3)- Returns:
- the list of named parameters of the function (if any, else null)
-
setNamedParameters
public void setNamedParameters(NamedExpressionList<?> list)
-
isEscaped
public boolean isEscaped()
Return true if it's in the form "{fn function_body() }"- Returns:
- true if it's java-escaped
-
setEscaped
public void setEscaped(boolean isEscaped)
-
getAttribute
public Object getAttribute()
-
setAttribute
public void setAttribute(Expression attributeExpression)
-
setAttribute
public void setAttribute(Column attributeColumn)
-
getAttributeName
@Deprecated public String getAttributeName()
Deprecated.
-
setAttributeName
public void setAttributeName(String attributeName)
-
getAttributeColumn
public Column getAttributeColumn()
-
getKeep
public KeepExpression getKeep()
-
setKeep
public void setKeep(KeepExpression keep)
-
withAttribute
public Function withAttribute(Expression attribute)
-
withAttributeName
@Deprecated public Function withAttributeName(String attributeName)
Deprecated.
-
withKeep
public Function withKeep(KeepExpression keep)
-
withIgnoreNulls
public Function withIgnoreNulls(boolean ignoreNulls)
-
withParameters
public Function withParameters(ExpressionList<?> parameters)
-
withParameters
public Function withParameters(Expression... parameters)
-
withNamedParameters
public Function withNamedParameters(NamedExpressionList<?> namedParameters)
-
withAllColumns
public Function withAllColumns(boolean allColumns)
-
withDistinct
public Function withDistinct(boolean distinct)
-
withUnique
public Function withUnique(boolean unique)
-
getOrderByElements
public List<OrderByElement> getOrderByElements()
-
setOrderByElements
public void setOrderByElements(List<OrderByElement> orderByElements)
-
getAttribute
public <E extends Expression> E getAttribute(Class<E> type)
-
-