org.nakedobjects.metamodel.spec.feature
Interface NakedObjectMember

All Superinterfaces:
FacetHolder, Identified, NakedObjectFeature, NamedAndDescribed, Specification, TypedSpecification
All Known Subinterfaces:
NakedObjectAction, NakedObjectAssociation, OneToManyAssociation, OneToOneAssociation
All Known Implementing Classes:
NakedObjectActionImpl, NakedObjectActionSet, NakedObjectAssociationAbstract, NakedObjectMemberAbstract, OneToManyAssociationImpl, OneToOneAssociationImpl

public interface NakedObjectMember
extends NakedObjectFeature

Provides reflective access to an action or a field on a domain object.


Method Summary
 UsabilityContext<?> createUsableInteractionContext(AuthenticationSession session, InteractionInvocationMethod invocationMethod, NakedObject target)
          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, NakedObject targetNakedObject)
          Create an InteractionContext to represent an attempt to view this member (that is, to check if it is visible or not).
 java.lang.String debugData()
           
 java.lang.String getHelp()
          Return the help text for this member - the field or action - to complement the description.
 java.lang.String getId()
          Returns the identifier of the member, which must not change.
 boolean isAction()
          Whether this member represents a NakedObjectAction.
 boolean isAssociation()
          Whether this member represents a NakedObjectAssociation.
 boolean isOneToManyAssociation()
          Whether this member represents a OneToManyAssociation.
 boolean isOneToOneAssociation()
          Whether this member represents a OneToOneAssociation.
 Consent isUsable(AuthenticationSession session, NakedObject target)
          Determines whether this member is usable, represented as a Consent.
 Consent isVisible(AuthenticationSession session, NakedObject target)
          Determines if this member is visible, represented as a Consent.
 
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

getId

java.lang.String getId()
Returns the identifier of the member, which must not change. This should be all camel-case with no spaces: so if the member is called 'Return Date' then the a suitable id would be 'ReturnDate'.


getHelp

java.lang.String getHelp()
Return the help text for this member - the field or action - to complement the description.

See Also:
NamedAndDescribed.getDescription()

createVisibleInteractionContext

VisibilityContext<?> createVisibleInteractionContext(AuthenticationSession session,
                                                     InteractionInvocationMethod invocationMethod,
                                                     NakedObject targetNakedObject)
Create an InteractionContext 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 isVisible(AuthenticationSession, NakedObject) or #isVisibleResult(AuthenticationSession, NakedObject); this is provided as API for symmetry with interactions (such as AccessContext accesses) have no corresponding vetoing methods.

Parameters:
session -
targetNakedObject -
Returns:

isVisible

Consent isVisible(AuthenticationSession session,
                  NakedObject target)
Determines if this member is visible, represented as a Consent.

Parameters:
session -
target - may be null if just checking for authorization.
See Also:
#isVisibleResult(AuthenticationSession, NakedObject)

createUsableInteractionContext

UsabilityContext<?> createUsableInteractionContext(AuthenticationSession session,
                                                   InteractionInvocationMethod invocationMethod,
                                                   NakedObject target)
Create an InteractionContext 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 isUsable(AuthenticationSession, NakedObject) or #isUsableResult(AuthenticationSession, NakedObject); this is provided as API for symmetry with interactions (such as AccessContext accesses) have no corresponding vetoing methods.

Parameters:
session -
target -
Returns:

isUsable

Consent isUsable(AuthenticationSession session,
                 NakedObject target)
Determines whether this member is usable, represented as a Consent.

Parameters:
session -
target - may be null if just checking for authorization.
See Also:
#isUsableResult(AuthenticationSession, NakedObject)

isAssociation

boolean isAssociation()
Whether this member represents a NakedObjectAssociation.

If so, can be safely downcast to NakedObjectAssociation.


isOneToManyAssociation

boolean isOneToManyAssociation()
Whether this member represents a OneToManyAssociation.

If so, can be safely downcast to OneToManyAssociation.


isOneToOneAssociation

boolean isOneToOneAssociation()
Whether this member represents a OneToOneAssociation.

If so, can be safely downcast to OneToOneAssociation.


isAction

boolean isAction()
Whether this member represents a NakedObjectAction.

If so, can be safely downcast to NakedObjectAction.


debugData

java.lang.String debugData()


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