Class EmptyCollectionComparisonExpressionStateObject

  • All Implemented Interfaces:
    StateObject

    public class EmptyCollectionComparisonExpressionStateObject
    extends AbstractStateObject
    This expression tests whether or not the collection designated by the collection-valued path expression is empty (i.e, has no elements).
    BNF: empty_collection_comparison_expression ::= collection_valued_path_expression IS [NOT] EMPTY

    Version:
    2.4
    See Also:
    EmptyCollectionComparisonExpression
    Author:
    Pascal Filion
    Since:
    2.4
    • Field Detail

      • NOT_PROPERTY

        public static final java.lang.String NOT_PROPERTY
        Notifies the visibility of the NOT identifier has changed.
        See Also:
        Constant Field Values
    • Constructor Detail

      • EmptyCollectionComparisonExpressionStateObject

        public EmptyCollectionComparisonExpressionStateObject​(StateObject parent)
        Creates a new EmptyCollectionComparisonExpressionStateObject.
        Parameters:
        parent - The parent of this state object, which cannot be null
        Throws:
        java.lang.NullPointerException - The given parent cannot be null
      • EmptyCollectionComparisonExpressionStateObject

        public EmptyCollectionComparisonExpressionStateObject​(StateObject parent,
                                                              boolean not,
                                                              java.lang.String path)
        Creates a new EmptyCollectionComparisonExpressionStateObject.
        Parameters:
        parent - The parent of this state object, which cannot be null
        not - Determines whether the NOT identifier is part of the expression or not
        path - The collection-valued path expression
        Throws:
        java.lang.NullPointerException - The given parent cannot be null
      • EmptyCollectionComparisonExpressionStateObject

        public EmptyCollectionComparisonExpressionStateObject​(StateObject parent,
                                                              java.lang.String path)
        Creates a new EmptyCollectionComparisonExpressionStateObject.
        Parameters:
        parent - The parent of this state object, which cannot be null
        path - The collection-valued path expression
        Throws:
        java.lang.NullPointerException - The given parent cannot be null
    • Method Detail

      • hasNot

        public boolean hasNot()
        Determines whether the NOT identifier is used or not.
        Returns:
        true if the NOT identifier is part of the expression; false otherwise
      • removeNot

        public void removeNot()
        Makes sure the NOT identifier is not specified.
      • setNot

        public void setNot​(boolean not)
        Sets whether the NOT identifier should be part of the expression or not.
        Parameters:
        not - true if the NOT identifier should be part of the expression; false otherwise
      • toggleNot

        public void toggleNot()
        Changes the visibility state of the NOT identifier.
      • toTextInternal

        protected void toTextInternal​(java.lang.Appendable writer)
                               throws java.io.IOException
        Prints out a string representation of this StateObject, which should not be used to define a true string representation of a JPQL query but should be used for debugging purposes.
        Specified by:
        toTextInternal in class AbstractStateObject
        Parameters:
        writer - The writer used to print out the string representation
        Throws:
        java.io.IOException - This should never happens, it is only required because Appendable is used instead of any concrete class