Class InputParameter

  • All Implemented Interfaces:
    Expression

    public final class InputParameter
    extends AbstractExpression
    Either positional or named parameters may be used. Positional and named parameters may not be mixed in a single query. Input parameters can only be used in the WHERE clause or HAVING clause of a query.
    Since:
    2.3
    Version:
    2.5
    Author:
    Pascal Filion
    • Constructor Detail

      • InputParameter

        public InputParameter​(AbstractExpression parent,
                              String parameter)
        Creates a new InputParameter.
        Parameters:
        parent - The parent of this expression
        parameter - The input parameter, which starts with either '?' or ':'
    • Method Detail

      • getParameter

        public String getParameter()
        Returns the positional parameter or the named parameter, which includes the identifier.
        Returns:
        The parameter following the constant used to determine if it's a positional or named parameter
        See Also:
        getParameterName()
      • getParameterName

        public String getParameterName()
        Returns the positional parameter or the named parameter without the identifier.
        Returns:
        The parameter following the constant used to determine if it's a positional or named parameter
        Since:
        2.5
        See Also:
        getParameter()
      • isNamed

        public boolean isNamed()
        Determines whether this parameter is a positional parameter, i.e. the parameter type is '?'.
        Returns:
        true if the parameter type is '?'; false if it's ':'
      • isPositional

        public boolean isPositional()
        Determines whether this parameter is a positional parameter, i.e. the parameter type is ':'.
        Returns:
        true if the parameter type is ':'; false if it's '?'
      • toActualText

        public String toActualText()
        Generates a string representation of this Expression, which needs to include any characters that are considered virtual, i.e. that was parsed when the query is incomplete and is needed for functionality like content assist.
        Specified by:
        toActualText in interface Expression
        Overrides:
        toActualText in class AbstractExpression
        Returns:
        The string representation of this Expression