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

public final Class CollectionExpressionStateObject

extends AbstractStateObject
Class Inheritance
Imports
java.io.IOException, java.util.List, org.eclipse.persistence.jpa.jpql.parser.CollectionExpression

This StateObject is a temporary object used to store a list of StateObjects. Those objects are not parented. StateObjectVisitor is not aware of this object either, to visit it, the visitor will be notified via reflection, see AbstractStateObject#acceptUnknownVisitor(StateObjectVisitor).
Author
Pascal Filion
Since
2.4
Version
2.4
See Also
CollectionExpression

Field Summary

Modifier and TypeField and Description
private List<? extends StateObject>
items

The list of children owned by this state object.

Constructor Summary

AccessConstructor and Description
public
CollectionExpressionStateObject(StateObject
The parent of this state object, which cannot be null
parent
,
List<? extends StateObject>
The list of children owned by this state object
items
)

Creates a new CollectionExpressionStateObject.

Method Summary

Modifier and TypeMethod and Description
public void
protected void
addChildren(List<StateObject>
The list used to store the children
children
)

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject.addChildren.

Adds the children of this StateObject to the given list.
protected boolean

Returns:

true if both have equivalent children; false otherwise
areChildrenEquivalent
(CollectionExpressionStateObject
The StateObject to compare its children to this one's children
stateObject
)

Determines whether the children of this StateObject are equivalent to the children of the given one, i.e. the information of the StateObjects is the same.

public CollectionExpression
getExpression()

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject.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 boolean
isEquivalent(StateObject
The StateObject to compare its content to this one
stateObject
)

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject.isEquivalent.

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.
public void
setExpression(CollectionExpression
The parsed object representing a collection expression
expression
)

Keeps a reference of the parsed object object, which should only be done when this object is instantiated during the conversion of a parsed JPQL query into StateObjects.

protected void
toTextInternal(Appendable
The writer used to print out the string representation
writer
)

Implements abstract org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject.toTextInternal.

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 org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject:
acceptUnknownVisitoracceptUnknownVisitoraddProblemsaddPropertyChangeListenerareEquivalentbuildProblembuildProblembuildStateObjectbuildStateObjectscheckParentchildrendecorateequalsfindIdentificationVariablefirePropertyChangedgetChangeSupportgetDeclarationgetDecoratorgetGrammargetManagedTypeProvidergetParentgetQueryBuildergetRootgetTypegetTypegetTypeHelpergetTypeRepositoryhashCodeinitializeisDecoratedparentparentparentremovePropertyChangeListenersetExpressionsetParenttoStringtoStringtoStringInternaltoStringItemstoText

Field Detail

itemsback to summary
private List<? extends StateObject> items

The list of children owned by this state object.

Constructor Detail

CollectionExpressionStateObjectback to summary
public CollectionExpressionStateObject(StateObject parent, List<? extends StateObject> items)

Creates a new CollectionExpressionStateObject.

Parameters
parent:StateObject

The parent of this state object, which cannot be null

items:List<? extends StateObject>

The list of children owned by this state object

Exceptions
NullPointerException:
The given parent cannot be null

Method Detail

acceptback to summary
public void accept(StateObjectVisitor visitor)

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

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject.accept.

Visits this StateObject by the given visitor.

Parameters
visitor:StateObjectVisitor

The visitor to visit this object

Annotations
@Override
addChildrenback to summary
protected void addChildren(List<StateObject> children)

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject.addChildren.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject.addChildren.

Adds the children of this StateObject to the given list.

Parameters
children:List<StateObject>

The list used to store the children

Annotations
@Override
areChildrenEquivalentback to summary
protected boolean areChildrenEquivalent(CollectionExpressionStateObject stateObject)

Determines whether the children of this StateObject are equivalent to the children of the given one, i.e. the information of the StateObjects is the same.

Parameters
stateObject:CollectionExpressionStateObject

The StateObject to compare its children to this one's children

Returns:boolean

true if both have equivalent children; false otherwise

getExpressionback to summary
public CollectionExpression getExpression()

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject.getExpression.

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

Doc from 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.

Returns:CollectionExpression

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)

Annotations
@Override
isEquivalentback to summary
public boolean isEquivalent(StateObject stateObject)

Overrides org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject.isEquivalent.

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

Doc from 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.

Parameters
stateObject:StateObject

The StateObject to compare its content to this one

Returns:boolean

true if both object are equivalent; false otherwise

Annotations
@Override
setExpressionback to summary
public void setExpression(CollectionExpression expression)

Keeps a reference of the parsed object object, which should only be done when this object is instantiated during the conversion of a parsed JPQL query into StateObjects.

Parameters
expression:CollectionExpression

The parsed object representing a collection expression

toTextInternalback to summary
protected void toTextInternal(Appendable writer) throws IOException

Implements abstract org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject.toTextInternal.

Doc from org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject.toTextInternal.

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.

Parameters
writer:Appendable

The writer used to print out the string representation

Annotations
@Override
Exceptions
IOException:
This should never happens, it is only required because Appendable is used instead of any concrete class