org.nakedobjects.metamodel.specloader.internal
Class NakedObjectActionParameterAbstract

java.lang.Object
  extended by org.nakedobjects.metamodel.specloader.internal.NakedObjectActionParameterAbstract
All Implemented Interfaces:
FacetHolder, CurrentHolder, NakedObjectActionParameter, NakedObjectFeature, Identified, NamedAndDescribed, Specification, TypedSpecification
Direct Known Subclasses:
NakedObjectActionParameterParseable, OneToOneActionParameterImpl

public abstract class NakedObjectActionParameterAbstract
extends java.lang.Object
implements NakedObjectActionParameter


Constructor Summary
protected NakedObjectActionParameterAbstract(int number, NakedObjectActionImpl nakedObjectAction, NakedObjectActionParamPeer peer)
           
 
Method Summary
 void addFacet(Facet facet)
          Adds the facet, extracting its type as the key.
 void addFacet(MultiTypedFacet facet)
          Adds the multi-typed facet, extracting each of its types as keys.
protected static void checkChoicesType(RuntimeContext runtimeContext, java.lang.Object[] objects, NakedObjectSpecification paramSpec)
           
 boolean containsFacet(java.lang.Class<? extends Facet> facetType)
          Whether there is a facet registered of the specified type.
 ActionArgumentContext createProposedArgumentInteractionContext(AuthenticationSession session, InteractionInvocationMethod invocationMethod, NakedObject targetObject, NakedObject[] proposedArguments, int position)
           
 NakedObjectAction getAction()
          Owning NakedObjectAction.
protected  AuthenticationSession getAuthenticationSession()
           
 NakedObject[] getChoices(NakedObject nakedObject)
           
 NakedObject getDefault(NakedObject nakedObject)
           
 java.lang.String getDescription()
          Returns a description of how the member is used - this complements the help text.
<T extends Facet>
T
getFacet(java.lang.Class<T> cls)
          Get the facet of the specified type (as per the type it reports from Facet.facetType()).
 Facet[] getFacets(Filter<Facet> filter)
          Returns all Facets matching the specified FacetFilter.
 java.lang.Class<? extends Facet>[] getFacetTypes()
          Get the list of all facet types that are supported by objects of this specification.
 Identifier getIdentifier()
          Identifier of this feature.
 java.lang.String getName()
          Return the name for this member - the field or action.
 int getNumber()
          Parameter number, 0-based.
protected  RuntimeContext getRuntimeContext()
           
 NakedObjectSpecification getSpecification()
          The specification of the underlying type.
 boolean isCollection()
          Subclasses should override either isObject() or isCollection().
 boolean isObject()
          Subclasses should override either isObject() or isCollection().
 boolean isOptional()
          Returns a flag indicating if it can be left unset when the action can be invoked.
 Consent isUsable()
           
 void removeFacet(java.lang.Class<? extends Facet> facetType)
          Remove the facet of the specified type.
 void removeFacet(Facet facet)
          Remove the facet whose type is that reported by Facet.facetType().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.nakedobjects.metamodel.spec.feature.NakedObjectActionParameter
isValid
 
Methods inherited from interface org.nakedobjects.metamodel.spec.Specification
getInstance
 
Methods inherited from interface org.nakedobjects.metamodel.spec.feature.CurrentHolder
get
 

Constructor Detail

NakedObjectActionParameterAbstract

protected NakedObjectActionParameterAbstract(int number,
                                             NakedObjectActionImpl nakedObjectAction,
                                             NakedObjectActionParamPeer peer)
Method Detail

isObject

public boolean isObject()
Subclasses should override either isObject() or isCollection().

Specified by:
isObject in interface NakedObjectActionParameter

isCollection

public boolean isCollection()
Subclasses should override either isObject() or isCollection().

Specified by:
isCollection in interface NakedObjectActionParameter

getNumber

public int getNumber()
Parameter number, 0-based.

Specified by:
getNumber in interface NakedObjectActionParameter

getAction

public NakedObjectAction getAction()
Description copied from interface: NakedObjectActionParameter
Owning NakedObjectAction.

Specified by:
getAction in interface NakedObjectActionParameter

getSpecification

public NakedObjectSpecification getSpecification()
Description copied from interface: TypedSpecification
The specification of the underlying type.

For example:

Specified by:
getSpecification in interface TypedSpecification

getIdentifier

public Identifier getIdentifier()
Description copied from interface: Identified
Identifier of this feature.

Specified by:
getIdentifier in interface Identified

getName

public java.lang.String getName()
Description copied from interface: NamedAndDescribed
Return the name for this member - the field or action. This is based on the name of this member.

Specified by:
getName in interface NamedAndDescribed
See Also:
#getIdentifier()

getDescription

public java.lang.String getDescription()
Description copied from interface: NamedAndDescribed
Returns a description of how the member is used - this complements the help text.

Specified by:
getDescription in interface NamedAndDescribed
See Also:
#getHelp()

isOptional

public boolean isOptional()
Description copied from interface: NakedObjectActionParameter
Returns a flag indicating if it can be left unset when the action can be invoked.

Specified by:
isOptional in interface NakedObjectActionParameter

isUsable

public Consent isUsable()

containsFacet

public boolean containsFacet(java.lang.Class<? extends Facet> facetType)
Description copied from interface: FacetHolder
Whether there is a facet registered of the specified type.

Convenience; saves having to FacetHolder.getFacet(Class) and then check if null.

Specified by:
containsFacet in interface FacetHolder

getFacet

public <T extends Facet> T getFacet(java.lang.Class<T> cls)
Description copied from interface: FacetHolder
Get the facet of the specified type (as per the type it reports from Facet.facetType()).

Specified by:
getFacet in interface FacetHolder

getFacetTypes

public java.lang.Class<? extends Facet>[] getFacetTypes()
Description copied from interface: FacetHolder
Get the list of all facet types that are supported by objects of this specification.

Specified by:
getFacetTypes in interface FacetHolder

getFacets

public Facet[] getFacets(Filter<Facet> filter)
Description copied from interface: FacetHolder
Returns all Facets matching the specified FacetFilter.

Specified by:
getFacets in interface FacetHolder
Returns:

addFacet

public void addFacet(Facet facet)
Description copied from interface: FacetHolder
Adds the facet, extracting its type as the key.

If there are any facet of the same type, they will be overwritten provided that either the Facet specifies to always replace or if the existing Facet is a no-op.

Specified by:
addFacet in interface FacetHolder

addFacet

public void addFacet(MultiTypedFacet facet)
Description copied from interface: FacetHolder
Adds the multi-typed facet, extracting each of its types as keys.

If there are any facet of the same type, they will be overwritten provided that either the Facet specifies to always replace or if the existing Facet is a no-op.

Specified by:
addFacet in interface FacetHolder

removeFacet

public void removeFacet(Facet facet)
Description copied from interface: FacetHolder
Remove the facet whose type is that reported by Facet.facetType().

Specified by:
removeFacet in interface FacetHolder

removeFacet

public void removeFacet(java.lang.Class<? extends Facet> facetType)
Description copied from interface: FacetHolder
Remove the facet of the specified type.

Specified by:
removeFacet in interface FacetHolder

createProposedArgumentInteractionContext

public ActionArgumentContext createProposedArgumentInteractionContext(AuthenticationSession session,
                                                                      InteractionInvocationMethod invocationMethod,
                                                                      NakedObject targetObject,
                                                                      NakedObject[] proposedArguments,
                                                                      int position)
Specified by:
createProposedArgumentInteractionContext in interface NakedObjectActionParameter

getChoices

public NakedObject[] getChoices(NakedObject nakedObject)
Specified by:
getChoices in interface NakedObjectActionParameter

checkChoicesType

protected static void checkChoicesType(RuntimeContext runtimeContext,
                                       java.lang.Object[] objects,
                                       NakedObjectSpecification paramSpec)

getDefault

public NakedObject getDefault(NakedObject nakedObject)
Specified by:
getDefault in interface NakedObjectActionParameter

getRuntimeContext

protected RuntimeContext getRuntimeContext()

getAuthenticationSession

protected AuthenticationSession getAuthenticationSession()


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