Interface ListHolderStateObject<T>
- All Superinterfaces:
StateObject
- All Known Implementing Classes:
AbstractFromClauseStateObject,AbstractIdentificationVariableDeclarationStateObject,AbstractListHolderStateObject,AbstractPathExpressionStateObject,CaseExpressionStateObject,CoalesceExpressionStateObject,CollectionValuedPathExpressionStateObject,ConcatExpressionStateObject,ConstructorExpressionStateObject,DerivedPathIdentificationVariableDeclarationStateObject,FromClauseStateObject,FunctionExpressionStateObject,GroupByClauseStateObject,IdentificationVariableDeclarationStateObject,InExpressionStateObject,OrderByClauseStateObject,SelectClauseStateObject,SimpleFromClauseStateObject,StateFieldPathExpressionStateObject,UpdateClauseStateObject
A
ListHolderStateObject is a StateObject having a list of children and this
gives access to some operation over the list.- Since:
- 2.4
- Version:
- 2.5
-
Method Summary
Modifier and TypeMethodDescription<S extends T>
SaddItem(S item) Adds the givenStateObjectas a child of this one.voidAdds the given list ofStateObjectsas children of this one.voidaddListChangeListener(String listName, IListChangeListener<T> listener) Registers the givenIListChangeListenerfor the specified list.booleancanMoveDown(T item) Determines whether the givenStateObjectcan be moved down by one position in the list owned by its parent.booleanDetermines whether the givenStateObjectcan be moved up by one position in the list owned by its parent.getItem(int index) Returns theStateObjectat the given positions from the listbooleanhasItems()Determines whether thisStateObjecthas any children.ListIterable<? extends T> items()Returns anListIterableover the children.intReturns the number of children this list holder has.Moves the givenStateObjectdown by one position in the list owned by its parent.Moves the givenStateObjectup by one position in the list owned by its parent.voidremoveItem(T item) Removes the givenStateObjectfrom the list of children.voidremoveItems(Collection<T> items) Removes the givenStateObjectfrom the list of children.voidremoveListChangeListener(String listName, IListChangeListener<T> listener) Unregisters the givenIListChangeListenerthat was registered for the specified list.Methods inherited from interface org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject
accept, addPropertyChangeListener, children, decorate, findIdentificationVariable, getDeclaration, getDecorator, getExpression, getGrammar, getManagedTypeProvider, getParent, getQueryBuilder, getRoot, isDecorated, isEquivalent, removePropertyChangeListener, setParent, toString, toText
-
Method Details
-
addItem
Adds the givenStateObjectas a child of this one.- Parameters:
item- The childStateObjectto become a child of this one return The given item
-
addItems
Adds the given list ofStateObjectsas children of this one.- Parameters:
items- TheStateObjectsto become children of this one
-
addListChangeListener
Registers the givenIListChangeListenerfor the specified list. The listener will be notified only when items are added, removed, moved from the list.- Parameters:
listName- The name of the list for which the listener will be notified when the content of the list has changedlistener- The listener to be notified upon changes- Throws:
NullPointerException-IListChangeListenercannot benullIllegalArgumentException- The listener is already registered with the list name
-
canMoveDown
Determines whether the givenStateObjectcan be moved down by one position in the list owned by its parent.- Parameters:
item- TheStateObjectthat could potentially be moved down- Returns:
trueif the object can be moved down by one unit;falseotherwise
-
canMoveUp
Determines whether the givenStateObjectcan be moved up by one position in the list owned by its parent.- Parameters:
item- TheStateObjectthat could potentially be moved up- Returns:
trueif the object can be moved up by one unit;falseotherwise
-
getItem
Returns theStateObjectat the given positions from the list- Parameters:
index- The position of theStateObjectto retrieve- Returns:
- The
StateObjectat the given position
-
hasItems
boolean hasItems()Determines whether thisStateObjecthas any children.- Returns:
trueif thisStateObjecthas children;falseotherwise
-
items
ListIterable<? extends T> items()Returns anListIterableover the children.- Returns:
- An
ListIterablethat is iterating over the children
-
itemsSize
int itemsSize()Returns the number of children this list holder has.- Returns:
- The count of
StateObjectsthat are children of this one
-
moveDown
Moves the givenStateObjectdown by one position in the list owned by its parent.- Parameters:
item- TheStateObjectto move down in the list- Returns:
- The given item
-
moveUp
Moves the givenStateObjectup by one position in the list owned by its parent.- Parameters:
item- TheStateObjectto move up in the list- Returns:
- The given item
-
removeItem
Removes the givenStateObjectfrom the list of children.- Parameters:
item- The childStateObjectto not longer be a child
-
removeItems
Removes the givenStateObjectfrom the list of children.- Parameters:
items- TheStateObjectsto remove from this one
-
removeListChangeListener
Unregisters the givenIListChangeListenerthat was registered for the specified list. The listener will no longer be notified only when items are added, removed, moved from the list.- Parameters:
listName- The name of the list for which the listener was registeredlistener- The listener to unregister- Throws:
NullPointerException-IListChangeListenercannot benullIllegalArgumentException- The listener was never registered with the list name
-