org.nakedobjects.metamodel.spec.feature
Interface OneToOneAssociation

All Superinterfaces:
CurrentHolder, FacetHolder, Identified, MutableCurrentHolder, NakedObjectAssociation, NakedObjectFeature, NakedObjectMember, NamedAndDescribed, OneToOneFeature, Specification, TypedSpecification
All Known Implementing Classes:
OneToOneAssociationImpl

public interface OneToOneAssociation
extends NakedObjectAssociation, OneToOneFeature, MutableCurrentHolder

Provides reflective access to a field on a domain object that is used to reference another domain object.


Method Summary
 void clearAssociation(NakedObject inObject)
          Clear this reference field (make it null) in the specified object, and remove any association back-link.
 PropertyAccessContext createAccessInteractionContext(AuthenticationSession session, InteractionInvocationMethod interactionMethod, NakedObject targetNakedObject)
          Creates an InteractionContext that represents access to this property.
 ValidityContext<?> createValidateInteractionContext(AuthenticationSession session, InteractionInvocationMethod interactionMethod, NakedObject targetNakedObject, NakedObject proposedValue)
          Creates an InteractionContext that represents validation of a proposed new value for the property.
 void initAssociation(NakedObject inObject, NakedObject associate)
          Initialise this field in the specified object with the specified reference - this call should only affect the specified object, and not any related objects.
 Consent isAssociationValid(NakedObject inObject, NakedObject associate)
          Determines if the specified reference is valid for setting this field in the specified object, represented as a Consent.
 void setAssociation(NakedObject inObject, NakedObject associate)
          Set up the association represented by this field in the specified object with the specified reference - this call sets up the logical state of the object and might affect other objects that share this association (such as back-links or bidirectional association).
 
Methods inherited from interface org.nakedobjects.metamodel.spec.feature.NakedObjectAssociation
getBusinessKeyName, getChoices, getDefault, hasChoices, isEmpty, isMandatory, isNotDerived, toDefault
 
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
 
Methods inherited from interface org.nakedobjects.metamodel.spec.feature.MutableCurrentHolder
set
 
Methods inherited from interface org.nakedobjects.metamodel.spec.feature.CurrentHolder
get
 

Method Detail

initAssociation

void initAssociation(NakedObject inObject,
                     NakedObject associate)
Initialise this field in the specified object with the specified reference - this call should only affect the specified object, and not any related objects. It should also not be distributed. This is strictly for re-initialising the object and not specifying an association, which is only done once.


createAccessInteractionContext

PropertyAccessContext createAccessInteractionContext(AuthenticationSession session,
                                                     InteractionInvocationMethod interactionMethod,
                                                     NakedObject targetNakedObject)
Creates an InteractionContext that represents access to this property.


createValidateInteractionContext

ValidityContext<?> createValidateInteractionContext(AuthenticationSession session,
                                                    InteractionInvocationMethod interactionMethod,
                                                    NakedObject targetNakedObject,
                                                    NakedObject proposedValue)
Creates an InteractionContext that represents validation of a proposed new value for the property.

Typically it is easier to just call isAssociationValid(NakedObject, NakedObject) or #isAssociationValidResult(NakedObject, NakedObject); this is provided as API for symmetry with interactions (such as AccessContext accesses) have no corresponding vetoing methods.


isAssociationValid

Consent isAssociationValid(NakedObject inObject,
                           NakedObject associate)
Determines if the specified reference is valid for setting this field in the specified object, represented as a Consent.


setAssociation

void setAssociation(NakedObject inObject,
                    NakedObject associate)
Set up the association represented by this field in the specified object with the specified reference - this call sets up the logical state of the object and might affect other objects that share this association (such as back-links or bidirectional association). To initialise a recreated object to this logical state the initAssociation method should be used on each of the objects.

See Also:
initAssociation(NakedObject, NakedObject)

clearAssociation

void clearAssociation(NakedObject inObject)
Clear this reference field (make it null) in the specified object, and remove any association back-link.

See Also:
setAssociation(NakedObject, NakedObject)


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