public abstract class AbstractStateObject extends java.lang.Object implements StateObject
StateObject
.Modifier and Type | Method and Description |
---|---|
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. |
boolean |
equals(java.lang.Object object) |
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. |
IType |
getType(java.lang.Class<?> type)
Retrieves the external type for the given Java type.
|
IType |
getType(java.lang.String typeName)
Retrieves the external class for the given fully qualified class name.
|
TypeHelper |
getTypeHelper()
Returns a helper that gives access to the most common
types . |
ITypeRepository |
getTypeRepository()
Returns the type repository for the application.
|
int |
hashCode() |
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. |
void |
removePropertyChangeListener(java.lang.String propertyName,
IPropertyChangeListener<?> listener)
Unregisters the given
IPropertyChangeListener that was registered for the specified
property. |
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. |
void |
setParent(StateObject parent)
Sets the given
StateObject to become the parent of this one. |
java.lang.String |
toString() |
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. |
accept
public final void addPropertyChangeListener(java.lang.String propertyName, IPropertyChangeListener<?> listener)
IPropertyChangeListener
for the specified property. The listener
will be notified only for changes to the specified property.addPropertyChangeListener
in interface StateObject
propertyName
- The name of the property for which the listener was registeredlistener
- The listener to be notified upon changespublic final java.lang.Iterable<StateObject> children()
StateObject
.children
in interface StateObject
StateObject
or an empty iterable this state object does
not have childrenpublic void 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.decorate
in interface StateObject
decorator
- The StateObject
decorating this onepublic final boolean equals(java.lang.Object object)
equals
in class java.lang.Object
public IdentificationVariableStateObject findIdentificationVariable(java.lang.String identificationVariable)
IdentificationVariableStateObject
representing the given identification
variable.findIdentificationVariable
in interface StateObject
identificationVariable
- The name of the identification variable to retrieve its state objectIdentificationVariableStateObject
defining the given identification variablepublic DeclarationStateObject getDeclaration()
getDeclaration
in interface StateObject
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 subquerypublic StateObject getDecorator()
StateObject
decorating this one if one has been set, which means the
behavior of this StateObject
is modified by the decorator.getDecorator
in interface StateObject
StateObject
decorating this onepublic Expression getExpression()
StateObject
representation of the JPQL query
was created by parsing an existing JPQL query.getExpression
in interface StateObject
StateObject
or null
when the JPQL query is manually created (i.e. not from a string)public JPQLGrammar getGrammar()
getGrammar
in interface StateObject
public IManagedTypeProvider getManagedTypeProvider()
getManagedTypeProvider
in interface StateObject
public StateObject getParent()
StateObject
.getParent
in interface StateObject
StateObject
, which is null
only when
this is the root of the hierarchypublic IJPQLQueryBuilder getQueryBuilder()
IJPQLQueryBuilder
that is responsible to create various part of the StateObject
hierarchy.getQueryBuilder
in interface StateObject
StateObject
from a JPQL query or that gives
access to various sub-builderspublic JPQLQueryStateObject getRoot()
StateObject
hierarchy.getRoot
in interface StateObject
public IType getType(java.lang.Class<?> type)
type
- The Java type to wrap with an external formpublic IType getType(java.lang.String typeName)
typeName
- The fully qualified class name of the class to retrievepublic TypeHelper getTypeHelper()
types
.IType
public ITypeRepository getTypeRepository()
ITypes
public final int hashCode()
hashCode
in class java.lang.Object
public 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
otherwiseisDecorated
in interface StateObject
public boolean isEquivalent(StateObject stateObject)
StateObject
is equivalent to this one, i.e. the
information of both StateObject
is the same.isEquivalent
in interface StateObject
stateObject
- The StateObject
to compare its content to this onetrue
if both object are equivalent; false
otherwisepublic final void 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.removePropertyChangeListener
in interface StateObject
propertyName
- The name of the property for which the listener was registeredlistener
- The listener to unregisterpublic void setExpression(Expression expression)
StateObject
representation of the JPQL query
is created by converting the parsed representation of the JPQL query.expression
- The parsed object when a JPQL query is parsedpublic final void setParent(StateObject parent)
StateObject
to become the parent of this one.setParent
in interface StateObject
parent
- The new parent StateObject
of this one, which cannot be null
public final java.lang.String toString()
toString
in class java.lang.Object
public final 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 StateObject.toString(Appendable)
from that decorator is invoked, otherwise the information contained in
this one will be printed out.
toString
in interface StateObject
writer
- The writer used to print out the string representationStateObject.toText(Appendable)
public final 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.
toText
in interface StateObject
writer
- The writer used to print out the string representationStateObject.toString(Appendable)
EclipseLink 2.6.3, "build v20160428-59c81c5" API Reference