Examples of OneToManyAssociation


Examples of org.apache.isis.core.metamodel.spec.feature.OneToManyAssociation

            if (intent == Intent.CHECK_IF_VALID) {
                throw new UnsupportedOperationException(String.format("Cannot invoke supporting method '%s'; use only collection accessor/mutator", memberName));
            }

            final OneToManyAssociation otma = (OneToManyAssociation) objectMember;
            if (intent == Intent.ACCESSOR) {
                return handleGetterMethodOnCollection(method, args, targetAdapter, otma, memberName);
            }
            if (intent == Intent.MODIFY_COLLECTION_ADD) {
                return handleCollectionAddToMethod(args, targetAdapter, otma, methodName);
View Full Code Here

Examples of org.apache.isis.core.metamodel.spec.feature.OneToManyAssociation

    // getInstance
    // /////////////////////////////////////////////////////////////

    @Override
    public Instance getInstance(final ObjectAdapter adapter) {
        final OneToManyAssociation specification = this;
        return adapter.getInstance(specification);
    }
View Full Code Here

Examples of org.apache.isis.core.metamodel.spec.feature.OneToManyAssociation

                }
                rows.add(new MetaModelRow(spec, otoa));
            }
            final List<ObjectAssociation> associations = spec.getAssociations(Contributed.EXCLUDED, ObjectAssociation.Filters.COLLECTIONS);
            for (ObjectAssociation collection : associations) {
                final OneToManyAssociation otma = (OneToManyAssociation) collection;
                if (exclude(otma)) {
                    continue;
                }
                rows.add(new MetaModelRow(spec, otma));
            }
View Full Code Here

Examples of org.apache.isis.core.metamodel.spec.feature.OneToManyAssociation

    // getInstance
    // /////////////////////////////////////////////////////////////

    @Override
    public Instance getInstance(final ObjectAdapter adapter) {
        final OneToManyAssociation specification = this;
        return adapter.getInstance(specification);
    }
View Full Code Here

Examples of org.apache.isis.core.metamodel.spec.feature.OneToManyAssociation

    @Override
    public void objectActionResult(final ObjectAdapter result, final Placement placement) {
        // same as in TreeNodeBorder
        final OneToManyField internalCollectionContent = (OneToManyField) getContent();
        final OneToManyAssociation field = internalCollectionContent.getOneToManyAssociation();
        final ObjectAdapter target = ((ObjectContent) getParent().getContent()).getObject();

        final Consent valid = field.isValidToAdd(target, result);
        if (valid.isAllowed()) {
            field.addElement(target, result);
        }
        super.objectActionResult(result, placement);
    }
View Full Code Here

Examples of org.apache.isis.core.metamodel.spec.feature.OneToManyAssociation

            if (association.isOneToOneAssociation()) {
                final OneToOneAssociation property = (OneToOneAssociation) association;
                final LinkBuilder linkBuilder = PropertyDescriptionReprRenderer.newLinkToBuilder(getRendererContext(), Rel.PROPERTY, objectSpecification, property);
                membersList.arrayAdd(linkBuilder.build());
            } else if (association.isOneToManyAssociation()) {
                final OneToManyAssociation collection = (OneToManyAssociation) association;
                final LinkBuilder linkBuilder = CollectionDescriptionReprRenderer.newLinkToBuilder(getRendererContext(), Rel.PROPERTY, objectSpecification, collection);
                membersList.arrayAdd(linkBuilder.build());
            }
        }
        final List<ObjectAction> actions = objectSpecification.getObjectActions(Contributed.INCLUDED);
View Full Code Here

Examples of org.apache.isis.core.metamodel.spec.feature.OneToManyAssociation

    public void doHandle(final PerformContext performContext) {

        final ObjectAdapter onAdapter = performContext.getOnAdapter();
        final ObjectMember nakedObjectMember = performContext.getObjectMember();

        final OneToManyAssociation otma = (OneToManyAssociation) nakedObjectMember;

        result = otma.get(onAdapter);
    }
View Full Code Here

Examples of org.apache.isis.core.metamodel.spec.feature.OneToManyAssociation

    @Override
    protected Consent determineConsent(final PerformContext performContext, final ObjectAdapter toValidateAdapter) {

        final ObjectAdapter onAdapter = performContext.getOnAdapter();
        final OneToManyAssociation otma = (OneToManyAssociation) performContext.getObjectMember();

        return otma.isValidToRemove(onAdapter, toValidateAdapter);
    }
View Full Code Here

Examples of org.apache.isis.core.metamodel.spec.feature.OneToManyAssociation

    @Override
    public ObjectAdapter that(final PerformContext performContext) throws ScenarioBoundValueException {

        final ObjectAdapter onAdapter = performContext.getOnAdapter();
        final OneToManyAssociation otma = (OneToManyAssociation) performContext.getObjectMember();

        final ObjectAdapter nakedObjectRepresentingCollection = otma.get(onAdapter);
        final CollectionFacet collectionFacet = nakedObjectRepresentingCollection.getSpecification().getFacet(CollectionFacet.class);

        doThat(performContext, collectionFacet.iterable(nakedObjectRepresentingCollection));

        return nakedObjectRepresentingCollection; // can alias if wish
View Full Code Here

Examples of org.apache.isis.core.metamodel.spec.feature.OneToManyAssociation

            if (!(assoc instanceof OneToManyAssociation)) {
                continue;
            }

            final OneToManyAssociation collection = (OneToManyAssociation) assoc;

            final ObjectCollectionReprRenderer renderer = new ObjectCollectionReprRenderer(getRendererContext(), linkFollower, collection.getId(), JsonRepresentation.newMap());

            renderer.with(new ObjectAndCollection(objectAdapter, collection)).usingLinkTo(linkToBuilder);
            if(mode.isEventSerialization()) {
                renderer.asEventSerialization();
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.