Package org.apache.isis.core.metamodel.facets.members.resolve

Examples of org.apache.isis.core.metamodel.facets.members.resolve.RenderFacet


    @Override
    public JsonRepresentation render() {

        renderMemberContent();
       
        final RenderFacet renderFacet = objectMember.getFacet(RenderFacet.class);
        boolean eagerlyRender = renderFacet != null && renderFacet.value() == Type.EAGERLY;
       
        if ((mode.isInline() && eagerlyRender) || mode.isStandalone() || mode.isMutated() || mode.isEventSerialization() || !objectAdapter.representsPersistent()) {
            addValue();
        }
        if(!mode.isEventSerialization()) {
View Full Code Here


        final ObjectAdapter valueAdapter = objectMember.get(objectAdapter);
        if (valueAdapter == null) {
            return;
        }
       
        final RenderFacet renderFacet = objectMember.getFacet(RenderFacet.class);
        boolean eagerlyRender = renderFacet != null && renderFacet.value() == Type.EAGERLY && rendererContext.canEagerlyRender(valueAdapter);

        final CollectionFacet facet = CollectionFacetUtils.getCollectionFacetFromSpec(valueAdapter);
        final List<JsonRepresentation> list = Lists.newArrayList();
        for (final ObjectAdapter elementAdapter : facet.iterable(valueAdapter)) {
View Full Code Here

        if (valueFacet != null) {
            JsonValueEncoder.appendValueAndFormat(spec, valueAdapter, representation);
            return;
        }

        final RenderFacet renderFacet = objectMember.getFacet(RenderFacet.class);
        boolean eagerlyRender = renderFacet != null && renderFacet.value() == Type.EAGERLY && rendererContext.canEagerlyRender(valueAdapter);

        if(valueAdapter == null) {
            representation.mapPut("value", NullNode.getInstance());
        } else {
            final TitleFacet titleFacet = spec.getFacet(TitleFacet.class);
View Full Code Here

        if(pagedFacet != null && !pagedFacet.isNoop()) {
            PagedFacetRepr pagedFacetRepr = new PagedFacetRepr();
            pagedFacetRepr.value = pagedFacet.value();
            memberRepr.paged = pagedFacetRepr;
        }
        RenderFacet renderFacet = assoc.getFacet(RenderFacet.class);
        if(renderFacet != null && !renderFacet.isNoop()) {
            RenderFacetRepr renderFacetRepr = new RenderFacetRepr();
            renderFacetRepr.value = renderFacet.value();
            memberRepr.render = renderFacetRepr;
        }
        TypicalLengthFacet typicalLengthFacet = assoc.getFacet(TypicalLengthFacet.class);
        if(typicalLengthFacet != null && !typicalLengthFacet.isNoop()) {
            TypicalLengthFacetRepr typicalLengthFacetRepr = new TypicalLengthFacetRepr();
View Full Code Here

        facetFactory.process(new ProcessMethodContext(Customer.class, null, null, facetedMethod.getMethod(), methodRemover, facetedMethod));

        final Facet facet = facetedMethod.getFacet(RenderFacet.class);
        assertNotNull(facet);
        assertTrue(facet instanceof RenderFacetAnnotation);
        RenderFacet resolveFacet = (RenderFacet) facet;
        assertThat(resolveFacet.value(), is(Render.Type.EAGERLY));

        assertNoMethodsRemoved();
    }
View Full Code Here

        }

        facetedMethod = FacetedMethod.createForProperty(Customer.class, "numberOfOrders");
        facetFactory.process(new ProcessMethodContext(Customer.class, null, null, facetedMethod.getMethod(), methodRemover, facetedMethod));

        final RenderFacet facet = facetedMethod.getFacet(RenderFacet.class);
        assertThat(facet.value(), is(Render.Type.EAGERLY));
    }
View Full Code Here

        }

        facetedMethod = FacetedMethod.createForProperty(Customer.class, "numberOfOrders");
        facetFactory.process(new ProcessMethodContext(Customer.class, null, null, facetedMethod.getMethod(), methodRemover, facetedMethod));

        final RenderFacet facet = facetedMethod.getFacet(RenderFacet.class);
        assertThat(facet.value(), is(Render.Type.LAZILY));
    }
View Full Code Here

        facetFactory.process(new ProcessMethodContext(Customer.class, null, null, facetedMethod.getMethod(), methodRemover, facetedMethod));

        final Facet facet = facetedMethod.getFacet(RenderFacet.class);
        assertNotNull(facet);
        assertTrue(facet instanceof RenderFacetAnnotation);
        RenderFacet resolveFacet = (RenderFacet) facet;
        assertThat(resolveFacet.value(), is(Render.Type.EAGERLY));

        assertNoMethodsRemoved();
    }
View Full Code Here

            }
        }
        facetedMethod = FacetedMethod.createForCollection(Customer.class, "orders");
        facetFactory.process(new ProcessMethodContext(Customer.class, null, null, facetedMethod.getMethod(), methodRemover, facetedMethod));

        final RenderFacet facet = facetedMethod.getFacet(RenderFacet.class);
        assertThat(facet.value(), is(Render.Type.EAGERLY));
    }
View Full Code Here

            }
        }
        facetedMethod = FacetedMethod.createForCollection(Customer.class, "orders");
        facetFactory.process(new ProcessMethodContext(Customer.class, null, null, facetedMethod.getMethod(), methodRemover, facetedMethod));

        final RenderFacet facet = facetedMethod.getFacet(RenderFacet.class);
        assertThat(facet.value(), is(Render.Type.LAZILY));
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.core.metamodel.facets.members.resolve.RenderFacet

Copyright © 2018 www.massapicom. 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.