Class ActionIterator<A extends Action>
- All Implemented Interfaces:
Iterator<A>
Registry.useExtensions(ClientContext, ExtensionsFilter, String...)
.
That method returns an ExtensionsInvoker
object which
in it's turn uses this iterator.
Note the phrase "will be created" above. The actions
are created on demand as this iterator moves on the
next item. This happens in the hasNext()
method, which,
for each extension, calls Extension.getActionFactory()
and then ActionFactory.getActions(InvokationContext)
.
The actions returned from the extensions are piled up in an
internal buffer that the next()
method pick items from.
When the buffer is empty the iterator moves on to the actions from
next extension until there are no more extensions and the action
buffer is empty.
- Version:
- 2.7
- Author:
- nicklas
- Last modified
- $Date:2008-03-20 12:15:25 +0100 (Thu, 20 Mar 2008) $
-
Field Summary
Modifier and TypeFieldDescriptionprivate A[]
private boolean
private A
private ExtensionContext<A>
private boolean
private final Iterator<ExtensionContext<A>>
private int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Clear any error that has been registered for the current action.Get the extension that created the current action.ExtensionPoint<? super A>
Get the extension point that the current action belongs to.Gets the renderer for the current action.void
handleEvent
(EventType event) Send the event to event handlers registered in the registry.boolean
hasNext()
next()
void
remove()
Not supported.void
Register an error with a message for the current action.void
Register an error for the current action.private boolean
validActions
(A[] actions) Check that the actions array is a not-null, non-empty array and contains actions of a type that is compatible with theExtensionPoint.getActionClass()
class.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining
-
Field Details
-
currentContext
-
currentAction
-
iterator
-
actions
-
offset
private int offset -
checkNext
private boolean checkNext -
hasNext
private boolean hasNext
-
-
Constructor Details
-
ActionIterator
ActionIterator(Iterator<ExtensionContext<A>> iterator)
-
-
Method Details
-
hasNext
public boolean hasNext() -
next
-
remove
public void remove()Not supported.- Specified by:
remove
in interfaceIterator<A extends Action>
- Throws:
UnsupportedOperationException
- Always
-
getExtensionPoint
Get the extension point that the current action belongs to. -
getExtension
Get the extension that created the current action. -
getRenderer
Gets the renderer for the current action.- Since:
- 2.9
-
handleEvent
Send the event to event handlers registered in the registry.- Since:
- 3.10
- See Also:
-
clearError
public void clearError()Clear any error that has been registered for the current action.- Since:
- 2.9
- See Also:
-
setError
Register an error for the current action. The error is handled by the error handler for the extension point.- Parameters:
t
- The error to register- Since:
- 2.9
-
setError
Register an error with a message for the current action. The error is handled by the error handler for the extension point.- Parameters:
t
- The error to registermessage
- An optional message- Since:
- 2.17
-
validActions
Check that the actions array is a not-null, non-empty array and contains actions of a type that is compatible with theExtensionPoint.getActionClass()
class.NOTE! If the array contains at least one invalid action, all actions, including the valid ones, will be ignored. No exception will be thrown. An error-level log message is written to the log file.
- Parameters:
actions
- The actions to check- Returns:
- TRUE if the actions are valid, FALSE otherwise
-