org.nakedobjects.metamodel.spec.feature
Interface NakedObjectAction

All Superinterfaces:
FacetHolder, Identified, NakedObjectFeature, NakedObjectMember, NamedAndDescribed, Specification, TypedSpecification
All Known Implementing Classes:
NakedObjectActionImpl, NakedObjectActionSet

public interface NakedObjectAction
extends NakedObjectMember


Method Summary
 ActionInvocationContext createActionInvocationInteractionContext(AuthenticationSession session, InteractionInvocationMethod invocationMethod, NakedObject targetObject, NakedObject[] proposedArguments)
          Creates an interaction context representing an attempt to invoke this action.
 NakedObject execute(NakedObject target, NakedObject[] parameters)
          Invokes the action's method on the target object given the specified set of parameters.
 NakedObjectAction[] getActions()
          Lists the sub-actions that are available under this name.
 NakedObject[][] getChoices(NakedObject target)
          Returns a list of possible references/values for each parameter, which the user can choose from.
 NakedObject[] getDefaults(NakedObject target)
          Returns the defaults references/values to be used for the action.
 NakedObjectSpecification getOnType()
          Returns the specification for the type of object that this action can be invoked upon.
 int getParameterCount()
          Returns the number of parameters used by this method.
 NakedObjectActionParameter[] getParameters()
          Returns set of parameter information.
 NakedObjectActionParameter[] getParameters(Filter<NakedObjectActionParameter> filter)
          Returns set of parameter information matching the supplied filter.
 NakedObjectSpecification[] getParameterTypes()
          Returns the type of each of the parameters.
 NakedObjectSpecification getReturnType()
          Returns the specifications for the return type.
 Target getTarget()
          Returns where the action should be executed: explicitly locally on the client; explicitly remotely on the server; or where it normally should be executed.
 NakedObjectActionType getType()
          Returns the type of action: user, exploration or debug, or that it is a set of actions.
 boolean hasReturn()
          Returns true if the represented action returns something, else returns false.
 boolean isContributed()
          Return true if the action is run on a service object using the target object as a parameter.
 Consent isProposedArgumentSetValid(NakedObject object, NakedObject[] proposedArguments)
          Whether the provided argument set is valid, represented as a Consent.
 boolean promptForParameters(NakedObject target)
           
 NakedObject realTarget(NakedObject target)
          Determine the real target for this action.
 
Methods inherited from interface org.nakedobjects.metamodel.spec.feature.NakedObjectMember
createUsableInteractionContext, createVisibleInteractionContext, debugData, getHelp, getId, isAction, isAssociation, isOneToManyAssociation, isOneToOneAssociation, isUsable, isVisible
 
Methods inherited from interface org.nakedobjects.metamodel.spec.TypedSpecification
getSpecification
 
Methods inherited from interface org.nakedobjects.metamodel.spec.Specification
getInstance
 
Methods inherited from interface org.nakedobjects.metamodel.spec.identifier.Identified
getIdentifier
 
Methods inherited from interface org.nakedobjects.metamodel.facets.FacetHolder
addFacet, addFacet, containsFacet, getFacet, getFacets, getFacetTypes, removeFacet, removeFacet
 
Methods inherited from interface org.nakedobjects.metamodel.spec.NamedAndDescribed
getDescription, getName
 

Method Detail

getTarget

Target getTarget()
Returns where the action should be executed: explicitly locally on the client; explicitly remotely on the server; or where it normally should be executed. By default instance methods should execute on the server, static methods should execute on the client.

See Also:
NakedObjectActionConstants.LOCAL, NakedObjectActionConstants.REMOTE, NakedObjectActionConstants.DEFAULT

realTarget

NakedObject realTarget(NakedObject target)
Determine the real target for this action. If this action represents an object action than the target is returned. If this action is on a service then that service will be returned.


getOnType

NakedObjectSpecification getOnType()
Returns the specification for the type of object that this action can be invoked upon.


isContributed

boolean isContributed()
Return true if the action is run on a service object using the target object as a parameter.


promptForParameters

boolean promptForParameters(NakedObject target)

getType

NakedObjectActionType getType()
Returns the type of action: user, exploration or debug, or that it is a set of actions.

See Also:
NakedObjectActionConstants.USER, NakedObjectActionConstants.EXPLORATION, NakedObjectActionConstants.DEBUG, NakedObjectActionConstants.SET

getReturnType

NakedObjectSpecification getReturnType()
Returns the specifications for the return type.


hasReturn

boolean hasReturn()
Returns true if the represented action returns something, else returns false.


execute

NakedObject execute(NakedObject target,
                    NakedObject[] parameters)
Invokes the action's method on the target object given the specified set of parameters.


createActionInvocationInteractionContext

ActionInvocationContext createActionInvocationInteractionContext(AuthenticationSession session,
                                                                 InteractionInvocationMethod invocationMethod,
                                                                 NakedObject targetObject,
                                                                 NakedObject[] proposedArguments)
Creates an interaction context representing an attempt to invoke this action.

Typically it is easier to just call #isProposedArgumentSetValid(NakedObject, NakedObject[]) {@link #isProposedArgumentSetValidResultSet(NakedObject, NakedObject[])}; this is provided as API for symmetry with interactions (such as {@link AccessContext} accesses) have no corresponding vetoing methods.


isProposedArgumentSetValid

Consent isProposedArgumentSetValid(NakedObject object,
                                   NakedObject[] proposedArguments)
Whether the provided argument set is valid, represented as a Consent.


getActions

NakedObjectAction[] getActions()
Lists the sub-actions that are available under this name.

If any actions are returned then this action is only a set and not an action itself.


getParameterCount

int getParameterCount()
Returns the number of parameters used by this method.


getParameters

NakedObjectActionParameter[] getParameters()
Returns set of parameter information.

Implementations may build this array lazily or eagerly as required.

Returns:

getParameterTypes

NakedObjectSpecification[] getParameterTypes()
Returns the type of each of the parameters.


getParameters

NakedObjectActionParameter[] getParameters(Filter<NakedObjectActionParameter> filter)
Returns set of parameter information matching the supplied filter.

Returns:

getDefaults

NakedObject[] getDefaults(NakedObject target)
Returns the defaults references/values to be used for the action.


getChoices

NakedObject[][] getChoices(NakedObject target)
Returns a list of possible references/values for each parameter, which the user can choose from.



Copyright © 2001-2009 Naked Objects Group Ltd.. All Rights Reserved.