public class OneToManyAssociationImpl extends ObjectAssociationAbstract implements OneToManyAssociation
ObjectAssociation.Filters, ObjectAssociation.Functions, ObjectAssociation.Predicates, ObjectAssociation.UtilOneToManyFeature.CollectionSemanticsdefaultName| Modifier | Constructor and Description |
|---|---|
|
OneToManyAssociationImpl(FacetedMethod facetedMethod,
ObjectMemberContext objectMemberContext) |
protected |
OneToManyAssociationImpl(FacetedMethod facetedMethod,
ObjectSpecification objectSpec,
ObjectMemberContext objectMemberContext) |
| Modifier and Type | Method and Description |
|---|---|
void |
addElement(ObjectAdapter ownerAdapter,
ObjectAdapter referencedAdapter)
Add the specified element to this collection field in the specified
object.
|
void |
clearCollection(ObjectAdapter ownerAdapter)
Remove all elements from this collection field in the specified object.
|
UsabilityContext<?> |
createUsableInteractionContext(AuthenticationSession session,
InteractionInvocationMethod invocationMethod,
ObjectAdapter ownerAdapter,
org.apache.isis.applib.annotation.Where where)
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,
ObjectAdapter ownerAdapter,
ObjectAdapter proposedToAddAdapter)
Creates an
InteractionContext that represents validation of a
candidate object to be added to the collection. |
ValidityContext<?> |
createValidateRemoveInteractionContext(AuthenticationSession session,
InteractionInvocationMethod invocationMethod,
ObjectAdapter ownerAdapter,
ObjectAdapter proposedToRemoveAdapter)
Creates an
InteractionContext that represents validation of a
candidate object to be removed from the collection. |
VisibilityContext<?> |
createVisibleInteractionContext(AuthenticationSession session,
InteractionInvocationMethod invocationMethod,
ObjectAdapter ownerAdapter,
org.apache.isis.applib.annotation.Where where)
Create an
InteractionContext to represent an attempt to view this
member (that is, to check if it is visible or not). |
String |
debugData() |
ObjectAdapter |
get(ObjectAdapter ownerAdapter)
Returns the referenced
ObjectAdapter for the owning
ObjectAdapter. |
ObjectAdapter[] |
getAutoComplete(ObjectAdapter object,
String searchArg)
Returns a list of possible references/values for this field, which the
user can choose from, based on the provided search argument.
|
int |
getAutoCompleteMinLength() |
ObjectAdapter[] |
getChoices(ObjectAdapter ownerAdapter)
Returns a list of possible references/values for this field, which the
user can choose from.
|
OneToManyFeature.CollectionSemantics |
getCollectionSemantics() |
ObjectAdapter |
getDefault(ObjectAdapter ownerAdapter)
Return the default for this property.
|
Instance |
getInstance(ObjectAdapter adapter)
|
boolean |
hasAutoComplete()
Whether there are any auto-complete provided (eg autoCompleteXxx supporting
method) for the association.
|
boolean |
hasChoices()
Whether there are any choices provided (eg choicesXxx supporting
method) for the association.
|
boolean |
isEmpty(ObjectAdapter parentAdapter)
Returns
true if this field on the specified object is deemed
to be empty, or has no content. |
Consent |
isValidToAdd(ObjectAdapter ownerAdapter,
ObjectAdapter proposedToAddAdapter)
TODO: currently this method is hard-coded to assume all interactions are
initiated
by user. |
Consent |
isValidToRemove(ObjectAdapter ownerAdapter,
ObjectAdapter proposedToRemoveAdapter)
TODO: currently this method is hard-coded to assume all interactions are
initiated
by user. |
void |
removeAllAssociations(ObjectAdapter ownerAdapter) |
void |
removeElement(ObjectAdapter ownerAdapter,
ObjectAdapter referencedAdapter)
Remove the specified element from this collection field in the specified
object.
|
void |
toDefault(ObjectAdapter ownerAdapter)
Set the property to it default references/values.
|
String |
toString() |
getBusinessKeyName, getSpecification, isMandatory, isNotPersisted, isOneToOneAssociationaddFacet, addFacet, containsDoOpFacet, containsFacet, getAdapterManager, getAuthenticationSession, getAuthenticationSessionProvider, getCollectionTypeRegistry, getDeploymentCategory, getDescription, getFacet, getFacetedMethod, getFacets, getFacetTypes, getFeatureType, getHelp, getId, getIdentifier, getName, getQuerySubmitter, getServicesProvider, getSpecification, getSpecificationLookup, isAction, isAlwaysHidden, isOneToManyAssociation, isPropertyOrCollection, isUsable, isVisible, removeFacet, removeFacetclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetBusinessKeyName, isMandatory, isNotPersistedgetHelp, isAction, isAlwaysHidden, isOneToManyAssociation, isOneToOneAssociation, isPropertyOrCollection, isUsable, isVisiblegetDescription, getId, getName, getSpecificationgetFeatureTypegetIdentifieraddFacet, addFacet, containsDoOpFacet, containsFacet, getFacet, getFacets, getFacetTypes, removeFacet, removeFacetpublic OneToManyAssociationImpl(FacetedMethod facetedMethod, ObjectMemberContext objectMemberContext)
protected OneToManyAssociationImpl(FacetedMethod facetedMethod, ObjectSpecification objectSpec, ObjectMemberContext objectMemberContext)
public OneToManyFeature.CollectionSemantics getCollectionSemantics()
getCollectionSemantics in interface OneToManyFeaturepublic VisibilityContext<?> createVisibleInteractionContext(AuthenticationSession session, InteractionInvocationMethod invocationMethod, ObjectAdapter ownerAdapter, org.apache.isis.applib.annotation.Where where)
ObjectMemberInteractionContext 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
ObjectMember.isVisible(AuthenticationSession, ObjectAdapter, Where) or
#isVisibleResult(AuthenticationSession, ObjectAdapter); this is
provided as API for symmetry with interactions (such as
AccessContext accesses) have no corresponding vetoing methods.
createVisibleInteractionContext in interface ObjectMemberpublic UsabilityContext<?> createUsableInteractionContext(AuthenticationSession session, InteractionInvocationMethod invocationMethod, ObjectAdapter ownerAdapter, org.apache.isis.applib.annotation.Where where)
ObjectMemberInteractionContext 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
ObjectMember.isUsable(AuthenticationSession, ObjectAdapter, Where) or
#isUsableResult(AuthenticationSession, ObjectAdapter); this is
provided as API for symmetry with interactions (such as
AccessContext accesses) have no corresponding vetoing methods.
createUsableInteractionContext in interface ObjectMemberpublic ValidityContext<?> createValidateAddInteractionContext(AuthenticationSession session, InteractionInvocationMethod invocationMethod, ObjectAdapter ownerAdapter, ObjectAdapter proposedToAddAdapter)
OneToManyAssociationInteractionContext that represents validation of a
candidate object to be added to the collection.
Typically it is easier to just call
OneToManyAssociation.isValidToAdd(ObjectAdapter, ObjectAdapter) or
#isValidToAddResult(ObjectAdapter, ObjectAdapter); this is
provided as API for symmetry with interactions (such as
AccessContext accesses) have no corresponding vetoing methods.
createValidateAddInteractionContext in interface OneToManyAssociationpublic Consent isValidToAdd(ObjectAdapter ownerAdapter, ObjectAdapter proposedToAddAdapter)
by user.isValidToAdd in interface OneToManyAssociation#isValidToAddResult(ObjectAdapter, ObjectAdapter)public ValidityContext<?> createValidateRemoveInteractionContext(AuthenticationSession session, InteractionInvocationMethod invocationMethod, ObjectAdapter ownerAdapter, ObjectAdapter proposedToRemoveAdapter)
OneToManyAssociationInteractionContext that represents validation of a
candidate object to be removed from the collection.
Typically it is easier to just call
OneToManyAssociation.isValidToAdd(ObjectAdapter, ObjectAdapter) or
#isValidToAddResult(ObjectAdapter, ObjectAdapter); this is
provided as API for symmetry with interactions (such as
AccessContext accesses) have no corresponding vetoing methods.
createValidateRemoveInteractionContext in interface OneToManyAssociationpublic Consent isValidToRemove(ObjectAdapter ownerAdapter, ObjectAdapter proposedToRemoveAdapter)
by user.isValidToRemove in interface OneToManyAssociationOneToManyAssociation.removeElement(ObjectAdapter, ObjectAdapter),
#isValidToAddResult(ObjectAdapter, ObjectAdapter)public ObjectAdapter get(ObjectAdapter ownerAdapter)
CurrentHolderObjectAdapter for the owning
ObjectAdapter.
For example, if this is an OneToOneAssociation, then returns the
referenced object.
get in interface CurrentHolderget in class ObjectAssociationAbstractpublic boolean isEmpty(ObjectAdapter parentAdapter)
ObjectAssociationtrue if this field on the specified object is deemed
to be empty, or has no content.isEmpty in interface ObjectAssociationisEmpty in class ObjectAssociationAbstractpublic void addElement(ObjectAdapter ownerAdapter, ObjectAdapter referencedAdapter)
OneToManyAssociationaddElement in interface OneToManyAssociationpublic void removeElement(ObjectAdapter ownerAdapter, ObjectAdapter referencedAdapter)
OneToManyAssociationremoveElement in interface OneToManyAssociationpublic void removeAllAssociations(ObjectAdapter ownerAdapter)
public void clearCollection(ObjectAdapter ownerAdapter)
OneToManyAssociationclearCollection in interface OneToManyAssociationpublic ObjectAdapter getDefault(ObjectAdapter ownerAdapter)
ObjectAssociationgetDefault in interface ObjectAssociationpublic void toDefault(ObjectAdapter ownerAdapter)
ObjectAssociationtoDefault in interface ObjectAssociationpublic ObjectAdapter[] getChoices(ObjectAdapter ownerAdapter)
ObjectAssociationgetChoices in interface ObjectAssociationpublic boolean hasChoices()
ObjectAssociationhasChoices in interface ObjectAssociationhasChoices in class ObjectAssociationAbstractpublic boolean hasAutoComplete()
ObjectAssociationhasAutoComplete in interface ObjectAssociationpublic ObjectAdapter[] getAutoComplete(ObjectAdapter object, String searchArg)
ObjectAssociationgetAutoComplete in interface ObjectAssociationpublic int getAutoCompleteMinLength()
getAutoCompleteMinLength in interface ObjectAssociationpublic Instance getInstance(ObjectAdapter adapter)
SpecificationInstance of this Specification with respect to
the provided ObjectAdapter.
For example, if the Specification is a
OneToOneAssociation, then is an Instance implementation
representing the { ObjectAdapter/ OneToOneAssociation
tuple.
Implementations are expected to use a double-dispatch back to the
provided ObjectAdapter (passing themselves as a parameter), using
ObjectAdapter.getInstance(Specification).
Note: this method may throw an UnsupportedOperationException; see
ObjectAdapter.getInstance(Specification) for details.
getInstance in interface Specificationpublic String debugData()
debugData in interface ObjectMemberpublic String toString()
toString in class ObjectMemberAbstractCopyright © 2010–2014 The Apache Software Foundation. All rights reserved.