|
||||||||||
| 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.OneToOneAssociationImpl
public class OneToOneAssociationImpl
| 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 | |
|---|---|
OneToOneAssociationImpl(NakedObjectAssociationPeer association,
RuntimeContext runtimeContext)
|
|
| Method Summary | |
|---|---|
void |
clearAssociation(NakedObject ownerAdapter)
Clear this reference field (make it null) in the specified object, and remove any
association back-link. |
PropertyAccessContext |
createAccessInteractionContext(AuthenticationSession session,
InteractionInvocationMethod interactionMethod,
NakedObject ownerAdapter)
TODO: currently this method is hard-coded to assume all interactions are initiated by user. |
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<?> |
createValidateInteractionContext(AuthenticationSession session,
InteractionInvocationMethod interactionMethod,
NakedObject ownerAdapter,
NakedObject proposedToReferenceAdapter)
Creates an InteractionContext that represents validation of a proposed new value for the
property. |
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 ownerAdapter)
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. |
void |
initAssociation(NakedObject ownerAdapter,
NakedObject referencedAdapter)
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 ownerAdapter,
NakedObject proposedToReferenceAdapter)
TODO: currently this method is hard-coded to assume all interactions are initiated by user. |
boolean |
isEmpty(NakedObject ownerAdapter)
Returns true if this field on the specified object is deemed to be empty, or has no
content. |
void |
set(NakedObject ownerAdapter,
NakedObject newReferencedAdapter)
Updates the referenced NakedObject for the owning NakedObject
with the new value provided, or clears the reference if null. |
void |
setAssociation(NakedObject ownerAdapter,
NakedObject newReferencedAdapter)
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). |
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 OneToOneAssociationImpl(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<?> createValidateInteractionContext(AuthenticationSession session,
InteractionInvocationMethod interactionMethod,
NakedObject ownerAdapter,
NakedObject proposedToReferenceAdapter)
OneToOneAssociationInteractionContext that represents validation of a proposed new value for the
property.
Typically it is easier to just call OneToOneAssociation.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.
createValidateInteractionContext in interface OneToOneAssociation
public Consent isAssociationValid(NakedObject ownerAdapter,
NakedObject proposedToReferenceAdapter)
by user.
isAssociationValid in interface OneToOneAssociation
public void initAssociation(NakedObject ownerAdapter,
NakedObject referencedAdapter)
OneToOneAssociation
initAssociation in interface OneToOneAssociationpublic 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 NakedObjectAssociationAbstract
public PropertyAccessContext createAccessInteractionContext(AuthenticationSession session,
InteractionInvocationMethod interactionMethod,
NakedObject ownerAdapter)
by user.
createAccessInteractionContext in interface OneToOneAssociationpublic boolean isEmpty(NakedObject ownerAdapter)
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 set(NakedObject ownerAdapter,
NakedObject newReferencedAdapter)
MutableCurrentHolderNakedObject for the owning NakedObject
with the new value provided, or clears the reference if null.
For example, if this is a OneToOneAssociation, then updates the
object referenced .
set in interface MutableCurrentHoldernewReferencedAdapter - - the new value, or null
public void setAssociation(NakedObject ownerAdapter,
NakedObject newReferencedAdapter)
OneToOneAssociationinitAssociation method should be used on each of the objects.
setAssociation in interface OneToOneAssociationOneToOneAssociation.initAssociation(NakedObject, NakedObject)public void clearAssociation(NakedObject ownerAdapter)
OneToOneAssociationnull) in the specified object, and remove any
association back-link.
clearAssociation in interface OneToOneAssociationOneToOneAssociation.setAssociation(NakedObject, NakedObject)public NakedObject getDefault(NakedObject ownerAdapter)
NakedObjectAssociation
getDefault in interface NakedObjectAssociationpublic void toDefault(NakedObject ownerAdapter)
NakedObjectAssociation
toDefault in interface NakedObjectAssociationpublic boolean hasChoices()
NakedObjectAssociation
hasChoices in interface NakedObjectAssociationhasChoices in class NakedObjectAssociationAbstractpublic NakedObject[] getChoices(NakedObject ownerAdapter)
NakedObjectAssociation
getChoices in interface NakedObjectAssociationpublic Instance getInstance(NakedObject ownerAdapter)
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 | |||||||||