Package net.sf.jsqlparser.expression
Class Function
- java.lang.Object
-
- net.sf.jsqlparser.parser.ASTNodeAccessImpl
-
- net.sf.jsqlparser.expression.Function
-
- All Implemented Interfaces:
java.io.Serializable
,Expression
,Model
,ASTNodeAccess
- Direct Known Subclasses:
TableFunction
public class Function extends ASTNodeAccessImpl implements Expression
A function as MAX,COUNT...- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
allColumns
private Column
attributeColumn
private Expression
attributeExpression
private boolean
distinct
private boolean
ignoreNulls
private boolean
isEscaped
private KeepExpression
keep
private NamedExpressionList<?>
namedParameters
private java.util.List<java.lang.String>
nameparts
private java.util.List<OrderByElement>
orderByElements
private ExpressionList<?>
parameters
private boolean
unique
-
Constructor Summary
Constructors Constructor Description Function()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
accept(ExpressionVisitor expressionVisitor)
java.lang.Object
getAttribute()
<E extends Expression>
EgetAttribute(java.lang.Class<E> type)
Column
getAttributeColumn()
java.lang.String
getAttributeName()
Deprecated.KeepExpression
getKeep()
java.util.List<java.lang.String>
getMultipartName()
java.lang.String
getName()
NamedExpressionList<?>
getNamedParameters()
the parameters might be named parameters, e.g.java.util.List<OrderByElement>
getOrderByElements()
ExpressionList<?>
getParameters()
The list of parameters of the function (if any, else null) If the parameter is "*", allColumns is set to trueboolean
isAllColumns()
boolean
isDistinct()
true if the function is "distinct"boolean
isEscaped()
Return true if it's in the form "{fn function_body() }"boolean
isIgnoreNulls()
boolean
isUnique()
true if the function is "unique"void
setAllColumns(boolean b)
void
setAttribute(Expression attributeExpression)
void
setAttribute(Column attributeColumn)
void
setAttributeName(java.lang.String attributeName)
void
setDistinct(boolean b)
void
setEscaped(boolean isEscaped)
void
setIgnoreNulls(boolean ignoreNulls)
This is at the moment only necessary for AnalyticExpression initialization and not for normal functions.void
setKeep(KeepExpression keep)
void
setName(java.lang.String string)
void
setName(java.util.List<java.lang.String> string)
void
setNamedParameters(NamedExpressionList<?> list)
void
setOrderByElements(java.util.List<OrderByElement> orderByElements)
void
setParameters(Expression... expressions)
void
setParameters(ExpressionList<?> list)
void
setUnique(boolean b)
java.lang.String
toString()
Function
withAllColumns(boolean allColumns)
Function
withAttribute(Expression attribute)
Function
withAttribute(Column attributeColumn)
Function
withAttributeName(java.lang.String attributeName)
Deprecated.Function
withDistinct(boolean distinct)
Function
withIgnoreNulls(boolean ignoreNulls)
Function
withKeep(KeepExpression keep)
Function
withName(java.lang.String name)
Function
withName(java.util.List<java.lang.String> nameparts)
Function
withNamedParameters(NamedExpressionList<?> namedParameters)
Function
withParameters(Expression... parameters)
Function
withParameters(ExpressionList<?> parameters)
Function
withUnique(boolean unique)
-
Methods inherited from class net.sf.jsqlparser.parser.ASTNodeAccessImpl
appendTo, getASTNode, 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.parser.ASTNodeAccess
getASTNode, setASTNode
-
-
-
-
Field Detail
-
nameparts
private java.util.List<java.lang.String> nameparts
-
parameters
private ExpressionList<?> parameters
-
namedParameters
private NamedExpressionList<?> namedParameters
-
allColumns
private boolean allColumns
-
distinct
private boolean distinct
-
unique
private boolean unique
-
isEscaped
private boolean isEscaped
-
attributeExpression
private Expression attributeExpression
-
attributeColumn
private Column attributeColumn
-
orderByElements
private java.util.List<OrderByElement> orderByElements
-
keep
private KeepExpression keep
-
ignoreNulls
private boolean ignoreNulls
-
-
Method Detail
-
accept
public void accept(ExpressionVisitor expressionVisitor)
- Specified by:
accept
in interfaceExpression
-
getName
public java.lang.String getName()
-
getMultipartName
public java.util.List<java.lang.String> getMultipartName()
-
setName
public void setName(java.lang.String string)
-
withName
public Function withName(java.lang.String name)
-
withName
public Function withName(java.util.List<java.lang.String> nameparts)
-
setName
public void setName(java.util.List<java.lang.String> string)
-
isAllColumns
public boolean isAllColumns()
-
setAllColumns
public void setAllColumns(boolean b)
-
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.
-
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 java.lang.Object getAttribute()
-
setAttribute
public void setAttribute(Expression attributeExpression)
-
getAttributeName
@Deprecated public java.lang.String getAttributeName()
Deprecated.
-
setAttributeName
public void setAttributeName(java.lang.String attributeName)
-
getAttributeColumn
public Column getAttributeColumn()
-
setAttribute
public void setAttribute(Column attributeColumn)
-
getKeep
public KeepExpression getKeep()
-
setKeep
public void setKeep(KeepExpression keep)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
withAttribute
public Function withAttribute(Expression attribute)
-
withAttributeName
@Deprecated public Function withAttributeName(java.lang.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 java.util.List<OrderByElement> getOrderByElements()
-
setOrderByElements
public void setOrderByElements(java.util.List<OrderByElement> orderByElements)
-
getAttribute
public <E extends Expression> E getAttribute(java.lang.Class<E> type)
-
-