Class Function

java.lang.Object
net.sf.jsqlparser.parser.ASTNodeAccessImpl
net.sf.jsqlparser.expression.Function
All Implemented Interfaces:
Serializable, Expression, Model, ASTNodeAccess
Direct Known Subclasses:
TableFunction

public class Function extends ASTNodeAccessImpl implements Expression
A function as MAX,COUNT...
See Also:
  • Field Details

    • nameparts

      private List<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 List<OrderByElement> orderByElements
    • keep

      private KeepExpression keep
    • ignoreNulls

      private boolean ignoreNulls
  • Constructor Details

    • Function

      public Function()
  • Method Details

    • accept

      public void accept(ExpressionVisitor expressionVisitor)
      Specified by:
      accept in interface Expression
    • getName

      public String getName()
    • getMultipartName

      public List<String> getMultipartName()
    • setName

      public void setName(String string)
    • withName

      public Function withName(String name)
    • withName

      public Function withName(List<String> nameparts)
    • setName

      public void setName(List<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 Object getAttribute()
    • setAttribute

      public void setAttribute(Expression attributeExpression)
    • getAttributeName

      @Deprecated public String getAttributeName()
      Deprecated.
    • setAttributeName

      public void setAttributeName(String attributeName)
    • getAttributeColumn

      public Column getAttributeColumn()
    • setAttribute

      public void setAttribute(Column attributeColumn)
    • withAttribute

      public Function withAttribute(Column attributeColumn)
    • getKeep

      public KeepExpression getKeep()
    • setKeep

      public void setKeep(KeepExpression keep)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • 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)