|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nakedobjects.metamodel.runtimecontext.spec.feature.NakedObjectMemberAbstract
org.nakedobjects.metamodel.runtimecontext.spec.feature.NakedObjectAssociationAbstract
org.nakedobjects.metamodel.specloader.internal.OneToManyAssociationImpl
public class OneToManyAssociationImpl
| 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 | |
|---|---|
OneToManyAssociationImpl(NakedObjectAssociationPeer association,
RuntimeContext runtimeContext)
|
|
| Method Summary | |
|---|---|
void |
addElement(NakedObject ownerAdapter,
NakedObject referencedAdapter)
Add the specified element to this collection field in the specified object. |
void |
clearCollection(NakedObject ownerAdapter)
Remove all elements from this collection field in the specified object. |
UsabilityContext<?> |
createUsableInteractionContext(AuthenticationSession session,
InteractionInvocationMethod invocationMethod,
NakedObject ownerAdapter)
Create an InteractionContext to represent an attempt to use this member (that is, to check if it is usable or not). |
ValidityContext<?> |
createValidateAddInteractionContext(AuthenticationSession session,
InteractionInvocationMethod invocationMethod,
NakedObject ownerAdapter,
NakedObject proposedToAddAdapter)
Creates an InteractionContext that represents validation of a candidate object to be added to
the collection. |
ValidityContext<?> |
createValidateRemoveInteractionContext(AuthenticationSession session,
InteractionInvocationMethod invocationMethod,
NakedObject ownerAdapter,
NakedObject proposedToRemoveAdapter)
Creates an InteractionContext that represents validation of a candidate object to be removed
from the collection. |
VisibilityContext<?> |
createVisibleInteractionContext(AuthenticationSession session,
InteractionInvocationMethod invocationMethod,
NakedObject ownerAdapter)
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()
|
NakedObject |
get(NakedObject ownerAdapter)
Returns the referenced NakedObject for the owning NakedObject. |
NakedObject[] |
getChoices(NakedObject ownerAdapter)
Returns a list of possible references/values for this field, which the user can choose from. |
NakedObject |
getDefault(NakedObject ownerAdapter)
Return the default for this property. |
Instance |
getInstance(NakedObject nakedObject)
Return an Instance of this Specification with respect
to the provided NakedObject. |
boolean |
hasChoices()
Whether there are any choices provided (eg choicesXxx supporting method) for the association. |
boolean |
isEmpty(NakedObject parentAdapter)
Returns true if this field on the specified object is deemed to be empty, or has no
content. |
Consent |
isValidToAdd(NakedObject ownerAdapter,
NakedObject proposedToAddAdapter)
TODO: currently this method is hard-coded to assume all interactions are initiated by user. |
Consent |
isValidToRemove(NakedObject ownerAdapter,
NakedObject proposedToRemoveAdapter)
TODO: currently this method is hard-coded to assume all interactions are initiated by user. |
void |
removeAllAssociations(NakedObject ownerAdapter)
|
void |
removeElement(NakedObject ownerAdapter,
NakedObject referencedAdapter)
Remove the specified element from this collection field in the specified object. |
void |
toDefault(NakedObject ownerAdapter)
Set the property to it default references/values. |
java.lang.String |
toString()
|
| Methods inherited from class org.nakedobjects.metamodel.runtimecontext.spec.feature.NakedObjectAssociationAbstract |
|---|
getBusinessKeyName, getSpecification, isMandatory, isNotDerived, isOneToOneAssociation |
| 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 |
| 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 |
|---|
getBusinessKeyName, isMandatory, isNotDerived |
| Methods inherited from interface org.nakedobjects.metamodel.spec.feature.NakedObjectMember |
|---|
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.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 |
|---|
public OneToManyAssociationImpl(NakedObjectAssociationPeer association,
RuntimeContext runtimeContext)
| Method Detail |
|---|
public VisibilityContext<?> createVisibleInteractionContext(AuthenticationSession session,
InteractionInvocationMethod invocationMethod,
NakedObject ownerAdapter)
NakedObjectMemberInteractionContext 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 NakedObjectMember.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.
createVisibleInteractionContext in interface NakedObjectMember
public UsabilityContext<?> createUsableInteractionContext(AuthenticationSession session,
InteractionInvocationMethod invocationMethod,
NakedObject ownerAdapter)
NakedObjectMemberInteractionContext 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 NakedObjectMember.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.
createUsableInteractionContext in interface NakedObjectMember
public ValidityContext<?> createValidateAddInteractionContext(AuthenticationSession session,
InteractionInvocationMethod invocationMethod,
NakedObject ownerAdapter,
NakedObject proposedToAddAdapter)
OneToManyAssociationInteractionContext that represents validation of a candidate object to be added to
the collection.
Typically it is easier to just call OneToManyAssociation.isValidToAdd(NakedObject, NakedObject) or
#isValidToAddResult(NakedObject, NakedObject); this is provided as API for symmetry with
interactions (such as AccessContext accesses) have no corresponding vetoing methods.
createValidateAddInteractionContext in interface OneToManyAssociation
public Consent isValidToAdd(NakedObject ownerAdapter,
NakedObject proposedToAddAdapter)
by user.
isValidToAdd in interface OneToManyAssociation#isValidToAddResult(NakedObject, NakedObject)
public ValidityContext<?> createValidateRemoveInteractionContext(AuthenticationSession session,
InteractionInvocationMethod invocationMethod,
NakedObject ownerAdapter,
NakedObject proposedToRemoveAdapter)
OneToManyAssociationInteractionContext that represents validation of a candidate object to be removed
from the collection.
Typically it is easier to just call OneToManyAssociation.isValidToAdd(NakedObject, NakedObject) or
#isValidToAddResult(NakedObject, NakedObject); this is provided as API for symmetry with
interactions (such as AccessContext accesses) have no corresponding vetoing methods.
createValidateRemoveInteractionContext in interface OneToManyAssociation
public Consent isValidToRemove(NakedObject ownerAdapter,
NakedObject proposedToRemoveAdapter)
by user.
isValidToRemove in interface OneToManyAssociationOneToManyAssociation.removeElement(NakedObject, NakedObject),
#isValidToAddResult(NakedObject, NakedObject)public NakedObject get(NakedObject ownerAdapter)
CurrentHolderNakedObject for the owning NakedObject.
For example, if this is an OneToOneAssociation, then returns the referenced object.
get in interface CurrentHolderget in class NakedObjectAssociationAbstractpublic boolean isEmpty(NakedObject parentAdapter)
NakedObjectAssociationtrue if this field on the specified object is deemed to be empty, or has no
content.
isEmpty in interface NakedObjectAssociationisEmpty in class NakedObjectAssociationAbstract
public void addElement(NakedObject ownerAdapter,
NakedObject referencedAdapter)
OneToManyAssociation
addElement in interface OneToManyAssociation
public void removeElement(NakedObject ownerAdapter,
NakedObject referencedAdapter)
OneToManyAssociation
removeElement in interface OneToManyAssociationpublic void removeAllAssociations(NakedObject ownerAdapter)
public void clearCollection(NakedObject ownerAdapter)
OneToManyAssociation
clearCollection in interface OneToManyAssociationpublic NakedObject getDefault(NakedObject ownerAdapter)
NakedObjectAssociation
getDefault in interface NakedObjectAssociationpublic void toDefault(NakedObject ownerAdapter)
NakedObjectAssociation
toDefault in interface NakedObjectAssociationpublic NakedObject[] getChoices(NakedObject ownerAdapter)
NakedObjectAssociation
getChoices in interface NakedObjectAssociationpublic boolean hasChoices()
NakedObjectAssociation
hasChoices in interface NakedObjectAssociationhasChoices in class NakedObjectAssociationAbstractpublic Instance getInstance(NakedObject nakedObject)
SpecificationInstance 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.
getInstance in interface Specificationpublic java.lang.String debugData()
debugData in interface NakedObjectMemberpublic java.lang.String toString()
toString in class NakedObjectMemberAbstract
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||