Top Description Fields Constructors Methods
org.eclipse.persistence.jpa.jpql.tools.model.query

public abstract Class AbstractStateObject

extends Object
implements StateObject
Class Inheritance
All Implemented Interfaces
org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject
Known Direct Subclasses
org.eclipse.persistence.jpa.jpql.tools.model.query.ArithmeticFactorStateObject, org.eclipse.persistence.jpa.jpql.tools.model.query.BetweenExpressionStateObject, org.eclipse.persistence.jpa.jpql.tools.model.query.CollectionExpressionStateObject, org.eclipse.persistence.jpa.jpql.tools.model.query.CollectionMemberDeclarationStateObject, org.eclipse.persistence.jpa.jpql.tools.model.query.CompoundExpressionStateObject, org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractPathExpressionStateObject, org.eclipse.persistence.jpa.jpql.tools.model.query.CollectionMemberExpressionStateObject, org.eclipse.persistence.jpa.jpql.tools.model.query.EmptyCollectionComparisonExpressionStateObject, org.eclipse.persistence.jpa.jpql.tools.model.query.FunctionExpressionStateObject, org.eclipse.persistence.jpa.jpql.tools.model.query.JoinStateObject, org.eclipse.persistence.jpa.jpql.tools.model.query.JPQLQueryStateObject, org.eclipse.persistence.jpa.jpql.tools.model.query.LikeExpressionStateObject, org.eclipse.persistence.jpa.jpql.tools.model.query.NotExpressionStateObject, org.eclipse.persistence.jpa.jpql.tools.model.query.NullComparisonExpressionStateObject, org.eclipse.persistence.jpa.jpql.tools.model.query.OrderByItemStateObject, org.eclipse.persistence.jpa.jpql.tools.model.query.ResultVariableStateObject, org.eclipse.persistence.jpa.jpql.tools.model.query.SimpleStateObject, org.eclipse.persistence.jpa.jpql.tools.model.query.TreatExpressionStateObject, org.eclipse.persistence.jpa.jpql.tools.model.query.UpdateItemStateObject, org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractConditionalClauseStateObject, org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractEncapsulatedExpressionStateObject, org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractListHolderStateObject, org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractModifyClauseStateObject, org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractModifyStatementStateObject, org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractRangeVariableDeclarationStateObject, org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractSelectClauseStateObject, org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractSelectStatementStateObject
Annotations
@SuppressWarnings:nls
Static Imports
org.eclipse.persistence.jpa.jpql.parser.AbstractExpression.COMMA, .AbstractExpression.SPACE

The abstract definition of a StateObject.
Author
Pascal Filion
Since
2.4
Version
2.5

Field Summary

Modifier and TypeField and Description
private ChangeSupport
changeSupport

The object responsible to actually register the listeners and to notify them upon changes made to this StateObject.

private StateObject
decorator

The StateObject that is decorating this one by changing its behavior or null if none was set.

private Expression
expression

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).

private StateObject
parent

The parent of this state object.

Constructor Summary

AccessConstructor and Description
protected
AbstractStateObject(StateObject
The parent of this state object, which cannot be null
parent
)

Creates a new AbstractStateObject.

Method Summary

Modifier and TypeMethod and Description
protected boolean

Returns:

true if the call was successfully executed; false otherwise
acceptUnknownVisitor
(StateObjectVisitor
The StateObjectVisitor to visit this StateObject programmatically
visitor
)

The given StateObjectVisitor needs to visit this class but it is defined by a third-party provider.

protected void
acceptUnknownVisitor(StateObjectVisitor
The StateObjectVisitor to visit this StateObject programmatically
visitor
,
Class<?>
The type found in the hierarchy of the given StateObjectVisitor that will be used to retrieve the visit method
type
,
Class<?>
The parameter type of the visit method
parameterType
)

The given StateObjectVisitor needs to visit this class but it is defined by a third-party provider.

protected void
addChildren(List<StateObject>
The list used to store the children
children
)

Adds the children of this StateObject to the given list.

protected void
addProblems(List<Problem>
The list to which the problems are added
problems
)

Adds to the given list the problems that were found with the current state of this StateObject, which means there are validation issues.

public final void
addPropertyChangeListener(String
The name of the property for which the listener was registered
propertyName
,
IPropertyChangeListener<?>
The listener to be notified upon changes
listener
)

Implements org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject.addPropertyChangeListener.

Registers the given IPropertyChangeListener for the specified property.
protected final boolean

Returns:

true if both objects are equivalent; false otherwise
areEquivalent
(StateObject
The first StateObject to compare its content with the other one
stateObject1
,
StateObject
The second StateObject to compare its content with the other one
stateObject2
)

Determines whether the given two StateObject are equivalent, i.e. the information of both StateObject is the same.

protected final Problem

Returns:

The new Problem
buildProblem
(String
The key used to retrieve the localized message describing the problem found with the current state of this StateObject
messageKey
)

Creates a new Problem describing a single issue found with the information contained in this StateObject.

protected final Problem

Returns:

The new Problem
buildProblem
(String
The key used to retrieve the localized message describing the problem found with the current state of this StateObject
messageKey
,
String...
A list of arguments that can be used to complete the message or an empty list if no additional information is necessary
arguments
)

Creates a new Problem describing a single issue found with the information contained in this StateObject.

protected <T extends StateObject> T

Returns:

A StateObject representation of the given JPQL fragment
buildStateObject
(CharSequence
A portion of a JPQL query that will be parsed and converted into a StateObject
jpqlFragment
,
String
The unique identifier of the BNF that determines how to parse the fragment
queryBNFId
)

Parses the given JPQL fragment using the given JPQL query BNF.

protected <T extends StateObject> List<T>

Returns:

A list of StateObjects representing the given JPQL fragment, which means the list may contain a single StateObject or a multiple StateObjects if the fragment contains more than one expression of the same type. Example: "JOIN e.employees e LEFT JOIN e.address a", this would be parsed in two state objects
buildStateObjects
(CharSequence
A portion of a JPQL query that will be parsed and converted into either a single StateObject or a list of StateObject, which happens when the fragment contains a collection of items separated by either a comma or a space
jpqlFragment
,
String
The unique identifier of the BNF that will be used to parse the fragment
queryBNFId
)

Parses the given JPQL fragment using the given JPQL query BNF.

protected StateObject

Returns:

The given object
checkParent
(StateObject
The parent of this state object
parent
)

Checks whether the given parent is null or not.

public final Iterable<StateObject>
public void
decorate(StateObject
The StateObject decorating this one
decorator
)

Implements org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject.decorate.

Decorates this StateObject with the given decorator.
public final boolean
equals(Object
the reference object with which to compare.
object
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.
public IdentificationVariableStateObject
findIdentificationVariable(String
The name of the identification variable to retrieve its state object
identificationVariable
)

Implements org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject.findIdentificationVariable.

Returns the IdentificationVariableStateObject representing the given identification variable.
protected final void
firePropertyChanged(String
The name of the property associated with the property change
propertyName
,
Object
The old value of the property that changed
oldValue
,
Object
The new value of the property that changed
newValue
)

Notifies the IPropertyChangeListeners that have been registered with the given property name that the property has changed.

protected final ChangeSupport

Returns:

The manager of listeners and notification
getChangeSupport
()

Returns the object responsible to actually register the listeners and to notify them upon changes made to this StateObject.

public DeclarationStateObject
getDeclaration()

Implements org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject.getDeclaration.

Returns the declaration clause which defines the domain of the query by declaring identification variables.
public StateObject
getDecorator()

Implements org.eclipse.persistence.jpa.jpql.tools.model.query.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.
public Expression
getExpression()

Implements org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject.getExpression.

Returns the actual parsed object if this StateObject representation of the JPQL query was created by parsing an existing JPQL query.
public JPQLGrammar
getGrammar()

Implements org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject.getGrammar.

Returns the grammar that defines how to parse a JPQL query.
public IManagedTypeProvider
public StateObject
public IJPQLQueryBuilder
getQueryBuilder()

Implements org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject.getQueryBuilder.

Returns the IJPQLQueryBuilder that is responsible to create various part of the StateObject hierarchy.
public JPQLQueryStateObject
public IType

Returns:

The external form of the given type
getType
(Class<?>
The Java type to wrap with an external form
type
)

Retrieves the external type for the given Java type.

public IType

Returns:

The external form of the class to retrieve
getType
(String
The fully qualified class name of the class to retrieve
typeName
)

Retrieves the external class for the given fully qualified class name.

public TypeHelper

Returns:

A helper containing a collection of methods related to IType
getTypeHelper
()

Returns a helper that gives access to the most common types.

public ITypeRepository

Returns:

The repository of ITypes
getTypeRepository
()

Returns the type repository for the application.

public final int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for the object.
protected void
initialize()

Initializes this state object.

public boolean
isDecorated()

Implements org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject.isDecorated.

Determines whether this StateObject is being decorated by another StateObject, which means the behavior is modified by the given one.
public boolean
isEquivalent(StateObject
The StateObject to compare its content to this one
stateObject
)

Implements org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject.isEquivalent.

Determines whether the given StateObject is equivalent to this one, i.e. the information of both StateObject is the same.
protected <T extends StateObject> List<T>

Returns:

The given list of StateObject
parent
(List<T>
The list of StateObject to have this one as its parent
stateObjects
)

Makes sure the given list of StateObject has this one as its parent.

protected final <T extends StateObject> T[]

Returns:

The given list of StateObject
parent
(T...
The list of StateObject to have this one as its parent
stateObjects
)

Makes sure the given list of StateObject has this one as its parent.

protected <T extends StateObject> T

Returns:

The given StateObject
parent
(T
The StateObject to have this one as its parent
stateObject
)

Makes sure the given StateObject has this one as its parent.

public final void
removePropertyChangeListener(String
The name of the property for which the listener was registered
propertyName
,
IPropertyChangeListener<?>
The listener to unregister
listener
)

Implements org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject.removePropertyChangeListener.

Unregisters the given IPropertyChangeListener that was registered for the specified property.
public void
setExpression(Expression
The parsed object when a JPQL query is parsed
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.

public final void
setParent(StateObject
The new parent StateObject of this one, which cannot be null
parent
)

Implements org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject.setParent.

Sets the given StateObject to become the parent of this one.
public final String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public final void
toString(Appendable
The writer used to print out the string representation
writer
)

Implements org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject.toString.

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.
protected final void
toStringInternal(Appendable
The writer used to print out the string representation
writer
)

Prints out a string representation of this StateObject.

protected void
toStringItems(Appendable writer, List<? extends StateObject> items, boolean useComma)

public final void
toText(Appendable
The writer used to print out the string representation
writer
)

Implements org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject.toText.

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.
protected abstract void
toTextInternal(Appendable
The writer used to print out the string representation
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.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait