Package org.apache.isis.core.metamodel.facets.object.immutable

Examples of org.apache.isis.core.metamodel.facets.object.immutable.ImmutableFacet.when()


    protected boolean valid(final Request request, final ObjectAdapter adapter) {
        final ObjectSpecification specification = adapter.getSpecification();
        final AuthenticationSession session = IsisContext.getAuthenticationSession();
        final List<ObjectAssociation> visibleFields = specification.getAssociations(Contributed.EXCLUDED, ObjectAssociation.Filters.dynamicallyVisible(session, adapter, where));
        final ImmutableFacet facet = specification.getFacet(ImmutableFacet.class);
        final boolean isImmutable = facet != null && facet.when() == When.ALWAYS;
        final boolean isImmutableOncePersisted = facet != null && facet.when() == When.ONCE_PERSISTED && adapter.representsPersistent();
        return visibleFields.size() > 0 && !isImmutable && !isImmutableOncePersisted;
    }

    @Override
View Full Code Here


        final ObjectSpecification specification = adapter.getSpecification();
        final AuthenticationSession session = IsisContext.getAuthenticationSession();
        final List<ObjectAssociation> visibleFields = specification.getAssociations(Contributed.EXCLUDED, ObjectAssociation.Filters.dynamicallyVisible(session, adapter, where));
        final ImmutableFacet facet = specification.getFacet(ImmutableFacet.class);
        final boolean isImmutable = facet != null && facet.when() == When.ALWAYS;
        final boolean isImmutableOncePersisted = facet != null && facet.when() == When.ONCE_PERSISTED && adapter.representsPersistent();
        return visibleFields.size() > 0 && !isImmutable && !isImmutableOncePersisted;
    }

    @Override
    protected String linkLabel(final String name, final ObjectAdapter object) {
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.