public class ObjectActionImpl extends ObjectMemberAbstract implements ObjectAction
ObjectAction.Filters, ObjectAction.Predicates, ObjectAction.UtilsdefaultName| Constructor and Description |
|---|
ObjectActionImpl(FacetedMethod facetedMethod,
ObjectMemberContext objectMemberContext) |
| Modifier and Type | Method and Description |
|---|---|
ActionInvocationContext |
createActionInvocationInteractionContext(AuthenticationSession session,
InteractionInvocationMethod invocationMethod,
ObjectAdapter targetObject,
ObjectAdapter[] proposedArguments)
Creates an
interaction context
representing an attempt to invoke this action. |
UsabilityContext<?> |
createUsableInteractionContext(AuthenticationSession session,
InteractionInvocationMethod invocationMethod,
ObjectAdapter targetObjectAdapter,
org.apache.isis.applib.annotation.Where where)
Create an
InteractionContext to represent an attempt to
use this member (that is, to
check if it is usable or not). |
VisibilityContext<?> |
createVisibleInteractionContext(AuthenticationSession session,
InteractionInvocationMethod invocationMethod,
ObjectAdapter targetObjectAdapter,
org.apache.isis.applib.annotation.Where where)
Create an
InteractionContext to represent an attempt to view this
member (that is, to check if it is visible or not). |
String |
debugData() |
ObjectAdapter |
execute(ObjectAdapter target,
ObjectAdapter[] arguments)
Invokes the action's method on the target object given the specified set
of parameters.
|
protected ActionInvocationFacet |
getActionInvocationFacet() |
ObjectAdapter[][] |
getChoices(ObjectAdapter target)
Returns a list of possible references/values for each parameter, which
the user can choose from.
|
ObjectAdapter[] |
getDefaults(ObjectAdapter target)
Returns the defaults references/values to be used for the action.
|
Instance |
getInstance(ObjectAdapter adapter)
|
ObjectSpecification |
getOnType()
Returns the specification for the type of object that this action can be
invoked upon.
|
ObjectActionParameter |
getParameterById(String paramId)
Returns the parameter with provided id.
|
ObjectActionParameter |
getParameterByName(String paramName)
Returns the parameter with provided name.
|
int |
getParameterCount()
Returns the number of parameters used by this method.
|
List<ObjectActionParameter> |
getParameters()
Build lazily by
getParameters(). |
List<ObjectActionParameter> |
getParameters(org.apache.isis.applib.filter.Filter<ObjectActionParameter> filter)
Returns set of parameter information matching the supplied filter.
|
List<ObjectSpecification> |
getParameterTypes()
Returns the
type of each of the
parameters. |
ObjectSpecification |
getReturnType()
Returns the specifications for the return type.
|
org.apache.isis.applib.annotation.ActionSemantics.Of |
getSemantics()
The semantics of this action.
|
ObjectSpecification |
getSpecification()
Always returns null.
|
ActionType |
getType() |
static ActionType |
getType(String typeStr) |
boolean |
hasReturn()
Returns true if the represented action returns something, else returns
false.
|
Consent |
isProposedArgumentSetValid(ObjectAdapter target,
ObjectAdapter[] proposedArguments)
TODO: currently this method is hard-coded to assume all interactions are
initiated
by user. |
boolean |
promptForParameters(ObjectAdapter target) |
String |
toString() |
addFacet, addFacet, containsDoOpFacet, containsFacet, getAdapterManager, getAuthenticationSession, getAuthenticationSessionProvider, getCollectionTypeRegistry, getDeploymentCategory, getDescription, getFacet, getFacetedMethod, getFacets, getFacetTypes, getFeatureType, getHelp, getId, getIdentifier, getName, getQuerySubmitter, getServicesProvider, getSpecification, getSpecificationLookup, isAction, isAlwaysHidden, isOneToManyAssociation, isOneToOneAssociation, isPropertyOrCollection, isUsable, isVisible, removeFacet, removeFacetclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetHelp, isAction, isAlwaysHidden, isOneToManyAssociation, isOneToOneAssociation, isPropertyOrCollection, isUsable, isVisiblegetDescription, getId, getNamegetFeatureTypegetIdentifieraddFacet, addFacet, containsDoOpFacet, containsFacet, getFacet, getFacets, getFacetTypes, removeFacet, removeFacetpublic ObjectActionImpl(FacetedMethod facetedMethod, ObjectMemberContext objectMemberContext)
public static ActionType getType(String typeStr)
public ObjectSpecification getSpecification()
getSpecification in interface ObjectFeaturepublic ObjectSpecification getReturnType()
ObjectActiongetReturnType in interface ObjectActionpublic boolean hasReturn()
hasReturn in interface ObjectActionpublic ObjectSpecification getOnType()
ObjectActiongetOnType in interface ObjectActionpublic org.apache.isis.applib.annotation.ActionSemantics.Of getSemantics()
ObjectActiongetSemantics in interface ObjectActionpublic Instance getInstance(ObjectAdapter adapter)
SpecificationInstance of this Specification with respect to
the provided ObjectAdapter.
For example, if the Specification is a
OneToOneAssociation, then is an Instance implementation
representing the { ObjectAdapter/ OneToOneAssociation
tuple.
Implementations are expected to use a double-dispatch back to the
provided ObjectAdapter (passing themselves as a parameter), using
ObjectAdapter.getInstance(Specification).
Note: this method may throw an UnsupportedOperationException; see
ObjectAdapter.getInstance(Specification) for details.
getInstance in interface Specificationpublic ActionType getType()
getType in interface ObjectActionpublic int getParameterCount()
ObjectActiongetParameterCount in interface ObjectActionpublic boolean promptForParameters(ObjectAdapter target)
promptForParameters in interface ObjectActionpublic List<ObjectActionParameter> getParameters()
getParameters().
Although this is lazily loaded, the method is also synchronized so there shouldn't be any thread race conditions.
getParameters in interface ObjectActionpublic List<ObjectSpecification> getParameterTypes()
ObjectActiontype of each of the
parameters.getParameterTypes in interface ObjectActionpublic ObjectActionParameter getParameterById(String paramId)
ObjectActiongetParameterById in interface ObjectActionpublic ObjectActionParameter getParameterByName(String paramName)
ObjectActiongetParameterByName in interface ObjectActionpublic List<ObjectActionParameter> getParameters(org.apache.isis.applib.filter.Filter<ObjectActionParameter> filter)
ObjectActiongetParameters in interface ObjectActionpublic VisibilityContext<?> createVisibleInteractionContext(AuthenticationSession session, InteractionInvocationMethod invocationMethod, ObjectAdapter targetObjectAdapter, org.apache.isis.applib.annotation.Where where)
ObjectMemberInteractionContext to represent an attempt to view this
member (that is, to check if it is visible or not).
Typically it is easier to just call
ObjectMember.isVisible(AuthenticationSession, ObjectAdapter, Where) or
#isVisibleResult(AuthenticationSession, ObjectAdapter); this is
provided as API for symmetry with interactions (such as
AccessContext accesses) have no corresponding vetoing methods.
createVisibleInteractionContext in interface ObjectMemberpublic UsabilityContext<?> createUsableInteractionContext(AuthenticationSession session, InteractionInvocationMethod invocationMethod, ObjectAdapter targetObjectAdapter, org.apache.isis.applib.annotation.Where where)
ObjectMemberInteractionContext to represent an attempt to
use this member (that is, to
check if it is usable or not).
Typically it is easier to just call
ObjectMember.isUsable(AuthenticationSession, ObjectAdapter, Where) or
#isUsableResult(AuthenticationSession, ObjectAdapter); this is
provided as API for symmetry with interactions (such as
AccessContext accesses) have no corresponding vetoing methods.
createUsableInteractionContext in interface ObjectMemberpublic Consent isProposedArgumentSetValid(ObjectAdapter target, ObjectAdapter[] proposedArguments)
by user.isProposedArgumentSetValid in interface ObjectActionpublic ActionInvocationContext createActionInvocationInteractionContext(AuthenticationSession session, InteractionInvocationMethod invocationMethod, ObjectAdapter targetObject, ObjectAdapter[] proposedArguments)
ObjectActioninteraction context
representing an attempt to invoke this action.
Typically it is easier to just call {@link #isProposedArgumentSetValid(ObjectAdapter, ObjectAdapter[])
createActionInvocationInteractionContext in interface ObjectActionpublic ObjectAdapter execute(ObjectAdapter target, ObjectAdapter[] arguments)
ObjectActionexecute in interface ObjectActionprotected ActionInvocationFacet getActionInvocationFacet()
public ObjectAdapter[] getDefaults(ObjectAdapter target)
ObjectActiongetDefaults in interface ObjectActionpublic ObjectAdapter[][] getChoices(ObjectAdapter target)
ObjectActiongetChoices in interface ObjectActionpublic String debugData()
debugData in interface ObjectMemberpublic String toString()
toString in class ObjectMemberAbstractCopyright © 2010–2014 The Apache Software Foundation. All rights reserved.