Class AbstractSingleEncapsulatedExpressionStateObject

    • Field Detail

      • STATE_OBJECT_PROPERTY

        public static final java.lang.String STATE_OBJECT_PROPERTY
        Notifies the encapsulated StateObject has changed.
        See Also:
        Constant Field Values
    • Constructor Detail

      • AbstractSingleEncapsulatedExpressionStateObject

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

        protected AbstractSingleEncapsulatedExpressionStateObject​(StateObject parent,
                                                                  StateObject stateObject)
        Creates a new AbstractSingleEncapsulatedExpressionStateObject.
        Parameters:
        parent - The parent of this state object, which cannot be null
        stateObject - The StateObject representing the encapsulated expression
        Throws:
        java.lang.NullPointerException - The given parent cannot be null
      • AbstractSingleEncapsulatedExpressionStateObject

        protected AbstractSingleEncapsulatedExpressionStateObject​(StateObject parent,
                                                                  java.lang.String jpqlFragment)
        Creates a new AbstractSingleEncapsulatedExpressionStateObject.
        Parameters:
        parent - The parent of this state object, which cannot be null
        jpqlFragment - The portion of the query representing the encapsulated expression
        Throws:
        java.lang.NullPointerException - The given parent cannot be null
    • Method Detail

      • getQueryBNFId

        protected abstract java.lang.String getQueryBNFId()
        Returns the unique identifier of the JPQLQueryBNF that will determine how to parse the encapsulated expression.
        Returns:
        The non-null ID of the BNF
      • hasStateObject

        public boolean hasStateObject()
        Determines whether the StateObject representing the encapsulated expression is present or not.
        Returns:
        true if the encapsulated StateObject is not null; false otherwise
      • parse

        public void parse​(java.lang.String jpqlFragment)
        Parses the given JPQL fragment, which represents the encapsulated expression, and creates the StateObject.
        Parameters:
        jpqlFragment - The portion of the query representing the encapsulated expression
      • setStateObject

        protected void setStateObject​(StateObject stateObject)
        Sets the given StateObject to represent the new encapsulated expression.
        Parameters:
        stateObject - The new encapsulated StateObject
      • toTextEncapsulatedExpression

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