Class AbstractStateObject

    • Method Detail

      • addPropertyChangeListener

        public final void addPropertyChangeListener​(String propertyName,
                                                    IPropertyChangeListener<?> listener)
        Registers the given IPropertyChangeListener for the specified property. The listener will be notified only for changes to the specified property.
        Specified by:
        addPropertyChangeListener in interface StateObject
        Parameters:
        propertyName - The name of the property for which the listener was registered
        listener - The listener to be notified upon changes
      • equals

        public final boolean equals​(Object object)
        Overrides:
        equals in class Object
      • getDeclaration

        public DeclarationStateObject getDeclaration()
        Returns the declaration clause which defines the domain of the query by declaring identification variables.
        Specified by:
        getDeclaration in interface StateObject
        Returns:
        The declaration clause of which this StateObject is a child; i.e. either the top-level declaration if this is part of the top query or the sub-level declaration if this is part of a subquery
      • getExpression

        public Expression getExpression()
        Returns the actual parsed object if this StateObject representation of the JPQL query was created by parsing an existing JPQL query.
        Specified by:
        getExpression in interface StateObject
        Returns:
        The parsed object when a JPQL query is parsed and converted into a StateObject or null when the JPQL query is manually created (i.e. not from a string)
      • getGrammar

        public JPQLGrammar getGrammar()
        Returns the grammar that defines how to parse a JPQL query.
        Specified by:
        getGrammar in interface StateObject
        Returns:
        The grammar that was used to parse the JPQL query
      • getType

        public IType getType​(Class<?> type)
        Retrieves the external type for the given Java type.
        Parameters:
        type - The Java type to wrap with an external form
        Returns:
        The external form of the given type
      • getType

        public IType getType​(String typeName)
        Retrieves the external class for the given fully qualified class name.
        Parameters:
        typeName - The fully qualified class name of the class to retrieve
        Returns:
        The external form of the class to retrieve
      • getTypeHelper

        public TypeHelper getTypeHelper()
        Returns a helper that gives access to the most common types.
        Returns:
        A helper containing a collection of methods related to IType
      • getTypeRepository

        public ITypeRepository getTypeRepository()
        Returns the type repository for the application.
        Returns:
        The repository of ITypes
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class Object
      • isDecorated

        public boolean isDecorated()
        Determines whether this StateObject is being decorated by another StateObject, which means the behavior is modified by the given one. return true if this StateObject is being decorated; false otherwise
        Specified by:
        isDecorated in interface StateObject
      • isEquivalent

        public boolean isEquivalent​(StateObject stateObject)
        Determines whether the given StateObject is equivalent to this one, i.e. the information of both StateObject is the same.
        Specified by:
        isEquivalent in interface StateObject
        Parameters:
        stateObject - The StateObject to compare its content to this one
        Returns:
        true if both object are equivalent; false otherwise
      • removePropertyChangeListener

        public final void removePropertyChangeListener​(String propertyName,
                                                       IPropertyChangeListener<?> listener)
        Unregisters the given IPropertyChangeListener that was registered for the specified property. The listener will no longer be notified when the property changes.
        Specified by:
        removePropertyChangeListener in interface StateObject
        Parameters:
        propertyName - The name of the property for which the listener was registered
        listener - The listener to unregister
      • setExpression

        public void setExpression​(Expression expression)
        Sets the actual parsed object if this StateObject representation of the JPQL query is created by converting the parsed representation of the JPQL query.
        Parameters:
        expression - The parsed object when a JPQL query is parsed
      • toString

        public final void toString​(Appendable writer)
        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.

        Important: If this StateObject is decorated by another one, then StateObject.toString(Appendable) from that decorator is invoked, otherwise the information contained in this one will be printed out.

        Specified by:
        toString in interface StateObject
        Parameters:
        writer - The writer used to print out the string representation
        See Also:
        StateObject.toText(Appendable)
      • toText

        public final void toText​(Appendable writer)
        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.

        Important: Even if this StateObject is decorated by another one, the decorator will not be used to print out a string representation of this one.

        Specified by:
        toText in interface StateObject
        Parameters:
        writer - The writer used to print out the string representation
        See Also:
        StateObject.toString(Appendable)