org.nakedobjects.metamodel.runtimecontext.spec.feature
Class NakedObjectAssociationAbstract

java.lang.Object
  extended by org.nakedobjects.metamodel.runtimecontext.spec.feature.NakedObjectMemberAbstract
      extended by org.nakedobjects.metamodel.runtimecontext.spec.feature.NakedObjectAssociationAbstract
All Implemented Interfaces:
FacetHolder, CurrentHolder, NakedObjectAssociation, NakedObjectFeature, NakedObjectMember, Identified, NamedAndDescribed, Specification, TypedSpecification
Direct Known Subclasses:
OneToManyAssociationImpl, OneToOneAssociationImpl

public abstract class NakedObjectAssociationAbstract
extends NakedObjectMemberAbstract
implements NakedObjectAssociation


Nested Class Summary
 
Nested classes/interfaces inherited from class org.nakedobjects.metamodel.runtimecontext.spec.feature.NakedObjectMemberAbstract
NakedObjectMemberAbstract.MemberType
 
Field Summary
 
Fields inherited from class org.nakedobjects.metamodel.runtimecontext.spec.feature.NakedObjectMemberAbstract
defaultName
 
Constructor Summary
NakedObjectAssociationAbstract(java.lang.String associationId, NakedObjectSpecification specification, NakedObjectMemberAbstract.MemberType memberType, Identified facetHolder, RuntimeContext runtimeContext)
           
 
Method Summary
abstract  NakedObject get(NakedObject fromObject)
          Returns the referenced NakedObject for the owning NakedObject.
 java.lang.String getBusinessKeyName()
          Get the name for the business key, if one has been specified.
 NakedObjectSpecification getSpecification()
          Return the specification of the object (or objects) that this field holds.
 boolean hasChoices()
          Whether there are any choices provided (eg choicesXxx supporting method) for the association.
abstract  boolean isEmpty(NakedObject adapter)
          Returns true if this field on the specified object is deemed to be empty, or has no content.
 boolean isMandatory()
          Determines if this field must be complete before the object is in a valid state
 boolean isNotDerived()
          Returns true if not calculated from other data in the object, that is, should be persisted.
 boolean isOneToOneAssociation()
          Whether this member represents a OneToOneAssociation.
 
Methods inherited from class org.nakedobjects.metamodel.runtimecontext.spec.feature.NakedObjectMemberAbstract
addFacet, addFacet, containsFacet, getAuthenticationSession, getDescription, getFacet, getFacets, getFacetTypes, getHelp, getId, getIdentifier, getName, getRuntimeContext, isAction, isAssociation, isOneToManyAssociation, isUsable, isVisible, removeFacet, removeFacet, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.nakedobjects.metamodel.spec.feature.NakedObjectAssociation
getChoices, getDefault, toDefault
 
Methods inherited from interface org.nakedobjects.metamodel.spec.feature.NakedObjectMember
createUsableInteractionContext, createVisibleInteractionContext, debugData, getHelp, getId, isAction, isAssociation, isOneToManyAssociation, isUsable, isVisible
 
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
 

Constructor Detail

NakedObjectAssociationAbstract

public NakedObjectAssociationAbstract(java.lang.String associationId,
                                      NakedObjectSpecification specification,
                                      NakedObjectMemberAbstract.MemberType memberType,
                                      Identified facetHolder,
                                      RuntimeContext runtimeContext)
Method Detail

get

public abstract NakedObject get(NakedObject fromObject)
Description copied from interface: CurrentHolder
Returns the referenced NakedObject for the owning NakedObject.

For example, if this is an OneToOneAssociation, then returns the referenced object.

Specified by:
get in interface CurrentHolder

getSpecification

public NakedObjectSpecification getSpecification()
Return the specification of the object (or objects) that this field holds. For a value are one-to-one reference this will be type that the accessor returns. For a collection it will be the type of element, not the type of collection.

Specified by:
getSpecification in interface TypedSpecification

isNotDerived

public boolean isNotDerived()
Description copied from interface: NakedObjectAssociation
Returns true if not calculated from other data in the object, that is, should be persisted.

Specified by:
isNotDerived in interface NakedObjectAssociation

hasChoices

public boolean hasChoices()
Description copied from interface: NakedObjectAssociation
Whether there are any choices provided (eg choicesXxx supporting method) for the association.

Specified by:
hasChoices in interface NakedObjectAssociation

isMandatory

public boolean isMandatory()
Description copied from interface: NakedObjectAssociation
Determines if this field must be complete before the object is in a valid state

Specified by:
isMandatory in interface NakedObjectAssociation

isEmpty

public abstract boolean isEmpty(NakedObject adapter)
Description copied from interface: NakedObjectAssociation
Returns true if this field on the specified object is deemed to be empty, or has no content.

Specified by:
isEmpty in interface NakedObjectAssociation

isOneToOneAssociation

public boolean isOneToOneAssociation()
Description copied from interface: NakedObjectMember
Whether this member represents a OneToOneAssociation.

If so, can be safely downcast to OneToOneAssociation.

Specified by:
isOneToOneAssociation in interface NakedObjectMember
Overrides:
isOneToOneAssociation in class NakedObjectMemberAbstract

getBusinessKeyName

public java.lang.String getBusinessKeyName()
Description copied from interface: NakedObjectAssociation
Get the name for the business key, if one has been specified.

Specified by:
getBusinessKeyName in interface NakedObjectAssociation


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