T
- the type of object to add to; typically an Actionable
subtype,
but may specify a type such as TopLevelItem
most of whose implementations are in fact Actionable
public abstract class TransientActionFactory<T> extends Object implements ExtensionPoint
Actionable.getAllActions()
ExtensionPoint.LegacyInstancesAreScopedToHudson
Constructor and Description |
---|
TransientActionFactory() |
Modifier and Type | Method and Description |
---|---|
Class<? extends Action> |
actionType()
A supertype of any actions this factory might produce.
|
abstract Collection<? extends Action> |
createFor(T target)
Creates actions for a given object.
|
static Iterable<? extends TransientActionFactory<?>> |
factoriesFor(Class<?> type,
Class<? extends Action> actionType) |
abstract Class<T> |
type()
The type of object this factory cares about.
|
public abstract Class<T> type()
createFor(T)
do a check-cast,
so that method bodies are not loaded until actually needed.T
public Class<? extends Action> actionType()
Actionable.getAction(Class)
.
For historical reasons this defaults to Action
itself.
If your implementation was returning multiple disparate kinds of actions, it is best to split it into two factories.
If an API defines a abstract Action
subtype and you are providing a concrete implementation,
you may return the API type here to delay class loading.
createFor(T)
@NonNull public abstract Collection<? extends Action> createFor(@NonNull T target)
target
- an actionable objectCollections.emptySet()
or Collections.singleton(T)
)@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public static Iterable<? extends TransientActionFactory<?>> factoriesFor(Class<?> type, Class<? extends Action> actionType)
Copyright © 2004–2021. All rights reserved.