org.nakedobjects.metamodel.specloader.internal
Class OneToOneActionParameterImpl

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

public class OneToOneActionParameterImpl
extends NakedObjectActionParameterAbstract
implements OneToOneActionParameter


Constructor Summary
OneToOneActionParameterImpl(int index, NakedObjectActionImpl actionImpl, NakedObjectActionParamPeer peer)
           
 
Method Summary
 NakedObject get(NakedObject owner)
          Gets the proposed value of the Instance (downcast as a MutableProposed, wrapping the proposed value into a NakedObject.
 Instance getInstance(NakedObject nakedObject)
          Return an Instance of this Specification with respect to the provided NakedObject.
 boolean isObject()
          Subclasses should override either NakedObjectActionParameterAbstract.isObject() or NakedObjectActionParameterAbstract.isCollection().
 java.lang.String isValid(NakedObject nakedObject, java.lang.Object proposedValue)
          TODO: need to be able to validate parameters individually, eg if have RegEx annotation; should delegate to the Check framework instead.
 void set(NakedObject owner, NakedObject newValue)
          Sets the proposed value of the Instance (downcast as a MutableProposed, unwrapped the proposed value from a NakedObject.
 
Methods inherited from class org.nakedobjects.metamodel.specloader.internal.NakedObjectActionParameterAbstract
addFacet, addFacet, checkChoicesType, containsFacet, createProposedArgumentInteractionContext, getAction, getAuthenticationSession, getChoices, getDefault, getDescription, getFacet, getFacets, getFacetTypes, getIdentifier, getName, getNumber, getRuntimeContext, getSpecification, isCollection, isOptional, isUsable, removeFacet, removeFacet
 
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
createProposedArgumentInteractionContext, getAction, getChoices, getDefault, getNumber, isCollection, isOptional
 
Methods inherited from interface org.nakedobjects.metamodel.spec.TypedSpecification
getSpecification
 
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
 

Constructor Detail

OneToOneActionParameterImpl

public OneToOneActionParameterImpl(int index,
                                   NakedObjectActionImpl actionImpl,
                                   NakedObjectActionParamPeer peer)
Method Detail

isObject

public boolean isObject()
Description copied from class: NakedObjectActionParameterAbstract
Subclasses should override either NakedObjectActionParameterAbstract.isObject() or NakedObjectActionParameterAbstract.isCollection().

Specified by:
isObject in interface NakedObjectActionParameter
Overrides:
isObject in class NakedObjectActionParameterAbstract

isValid

public java.lang.String isValid(NakedObject nakedObject,
                                java.lang.Object proposedValue)
TODO: need to be able to validate parameters individually, eg if have RegEx annotation; should delegate to the Check framework instead.

Specified by:
isValid in interface NakedObjectActionParameter
Returns:

getInstance

public Instance getInstance(NakedObject nakedObject)
Description copied from interface: Specification
Return an Instance of this Specification with respect to the provided NakedObject.

For example, if the Specification is a OneToOneAssociation, then is an Instance implementation representing the { NakedObject/ OneToOneAssociation } tuple.

Implementations are expected to use a double-dispatch back to the provided NakedObject (passing themselves as a parameter), using NakedObjectMM.getInstance(Specification).

Note: this method may throw an UnsupportedOperationException; see NakedObjectMM.getInstance(Specification) for details.

Specified by:
getInstance in interface Specification

get

public NakedObject get(NakedObject owner)
Gets the proposed value of the Instance (downcast as a MutableProposed, wrapping the proposed value into a NakedObject.

Specified by:
get in interface CurrentHolder

set

public void set(NakedObject owner,
                NakedObject newValue)
Sets the proposed value of the Instance (downcast as a MutableProposed, unwrapped the proposed value from a NakedObject.



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