public interface StateObject
StateObject
is an editable representation of a JPQL query.
IJPQLQueryBuilder
can be used to
create the state model from an existing JPQL query.
Modifier and Type | Method and Description |
---|---|
void |
accept(StateObjectVisitor visitor)
Visits this
StateObject by the given visitor . |
void |
addPropertyChangeListener(java.lang.String propertyName,
IPropertyChangeListener<?> listener)
Registers the given
IPropertyChangeListener for the specified property. |
java.lang.Iterable<StateObject> |
children()
Returns the ordered children of this
StateObject . |
void |
decorate(StateObject decorator)
Decorates this
StateObject with the given decorator. |
IdentificationVariableStateObject |
findIdentificationVariable(java.lang.String identificationVariable)
Returns the
IdentificationVariableStateObject representing the given identification
variable. |
DeclarationStateObject |
getDeclaration()
Returns the declaration clause which defines the domain of the query by declaring
identification variables.
|
StateObject |
getDecorator()
Returns the
StateObject decorating this one if one has been set, which means the
behavior of this StateObject is modified by the decorator. |
Expression |
getExpression()
Returns the actual parsed object if this
StateObject representation of the JPQL query
was created by parsing an existing JPQL query. |
JPQLGrammar |
getGrammar()
Returns the grammar that defines how to parse a JPQL query.
|
IManagedTypeProvider |
getManagedTypeProvider()
Returns the provider of managed types.
|
StateObject |
getParent()
Returns the parent of this
StateObject . |
IJPQLQueryBuilder |
getQueryBuilder()
Returns the
IJPQLQueryBuilder that is responsible to create various part of the StateObject hierarchy. |
JPQLQueryStateObject |
getRoot()
Returns the root of the
StateObject hierarchy. |
boolean |
isDecorated()
Determines whether this
StateObject is being decorated by another StateObject ,
which means the behavior is modified by the given one. |
boolean |
isEquivalent(StateObject stateObject)
Determines whether the given
StateObject is equivalent to this one, i.e. the
information of both StateObject is the same. |
void |
removePropertyChangeListener(java.lang.String propertyName,
IPropertyChangeListener<?> listener)
Unregisters the given
IPropertyChangeListener that was registered for the specified
property. |
void |
setParent(StateObject parent)
Sets the given
StateObject to become the parent of this one. |
void |
toString(java.lang.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. |
void |
toText(java.lang.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. |
void accept(StateObjectVisitor visitor)
StateObject
by the given visitor
.visitor
- The visitor
to visit this objectvoid addPropertyChangeListener(java.lang.String propertyName, IPropertyChangeListener<?> listener)
IPropertyChangeListener
for the specified property. The listener
will be notified only for changes to the specified property.propertyName
- The name of the property for which the listener was registeredlistener
- The listener to be notified upon changesjava.lang.NullPointerException
- IPropertyChangeListener
cannot be null
java.lang.IllegalArgumentException
- The listener is already registered with the property namejava.lang.Iterable<StateObject> children()
StateObject
.StateObject
or an empty iterable this state object does
not have childrenvoid decorate(StateObject decorator)
StateObject
with the given decorator. It means the behavior of this
StateObject
is modified by the given one. By default, this StateObject
becomes the parent of the given one.decorator
- The StateObject
decorating this oneIdentificationVariableStateObject findIdentificationVariable(java.lang.String identificationVariable)
IdentificationVariableStateObject
representing the given identification
variable.variable
- The name of the identification variable to retrieve its state objectIdentificationVariableStateObject
defining the given identification variableDeclarationStateObject getDeclaration()
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 subqueryStateObject getDecorator()
StateObject
decorating this one if one has been set, which means the
behavior of this StateObject
is modified by the decorator.StateObject
decorating this oneExpression getExpression()
StateObject
representation of the JPQL query
was created by parsing an existing JPQL query.StateObject
or null
when the JPQL query is manually created (i.e. not from a string)JPQLGrammar getGrammar()
IManagedTypeProvider getManagedTypeProvider()
StateObject getParent()
StateObject
.StateObject
, which is null
only when
this is the root of the hierarchyIJPQLQueryBuilder getQueryBuilder()
IJPQLQueryBuilder
that is responsible to create various part of the StateObject
hierarchy.StateObject
from a JPQL query or that gives
access to various sub-buildersJPQLQueryStateObject getRoot()
StateObject
hierarchy.boolean isDecorated()
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
otherwiseboolean isEquivalent(StateObject stateObject)
StateObject
is equivalent to this one, i.e. the
information of both StateObject
is the same.stateObject
- The StateObject
to compare its content to this onetrue
if both object are equivalent; false
otherwisevoid removePropertyChangeListener(java.lang.String propertyName, IPropertyChangeListener<?> listener)
IPropertyChangeListener
that was registered for the specified
property. The listener will no longer be notified when the property changes.propertyName
- The name of the property for which the listener was registeredlistener
- The listener to unregisterjava.lang.NullPointerException
- IPropertyChangeListener
cannot be null
java.lang.IllegalArgumentException
- The listener was never registered with the property namevoid setParent(StateObject parent)
StateObject
to become the parent of this one.parent
- The new parent StateObject
of this one, which cannot be null
void toString(java.lang.Appendable writer)
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 toString(Appendable)
from that decorator is invoked, otherwise the information contained in
this one will be printed out.
writer
- The writer used to print out the string representationtoText(Appendable)
void toText(java.lang.Appendable writer)
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.
writer
- The writer used to print out the string representationtoString(Appendable)