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

Examples of org.apache.isis.core.metamodel.facets.object.title.TitleFacet.title()


        if(valueAdapter == null) {
            representation.mapPut("value", NullNode.getInstance());
        } else {
            final TitleFacet titleFacet = spec.getFacet(TitleFacet.class);
            final String title = titleFacet.title(valueAdapter, rendererContext.getLocalization());
           
            final LinkBuilder valueLinkBuilder = DomainObjectReprRenderer.newLinkToBuilder(rendererContext, Rel.VALUE, valueAdapter).withTitle(title);
            if(eagerlyRender) {
                final DomainObjectReprRenderer renderer = new DomainObjectReprRenderer(rendererContext, getLinkFollowSpecs(), JsonRepresentation.newMap());
                renderer.with(valueAdapter);
View Full Code Here


    public static Object valueOrRef(final RendererContext resourceContext, final ObjectAdapter objectAdapter, final ObjectSpecification objectSpec) {
        if(objectAdapter.isValue()) {
            return JsonValueEncoder.asObject(objectAdapter);
        }
        final TitleFacet titleFacet = objectSpec.getFacet(TitleFacet.class);
        final String title = titleFacet.title(objectAdapter, resourceContext.getLocalization());
        return DomainObjectReprRenderer.newLinkToBuilder(resourceContext, Rel.VALUE, objectAdapter).withTitle(title).build();
    }

   
View Full Code Here

        if(objectAdapter.isValue()) {
            String format = null; // TODO
            return JsonValueEncoder.asObject(objectAdapter, format);
        }
        final TitleFacet titleFacet = objectSpec.getFacet(TitleFacet.class);
        final String title = titleFacet.title(objectAdapter, resourceContext.getLocalization());
        return DomainObjectReprRenderer.newLinkToBuilder(resourceContext, Rel.VALUE, objectAdapter).withTitle(title).build();
    }

   
View Full Code Here

            final NullNode value = NullNode.getInstance();
            representation.mapPut("value", value);
            return value;
        } else {
            final TitleFacet titleFacet = spec.getFacet(TitleFacet.class);
            final String title = titleFacet.title(valueAdapter, rendererContext.getLocalization());
           
            final LinkBuilder valueLinkBuilder = DomainObjectReprRenderer.newLinkToBuilder(rendererContext, Rel.VALUE, valueAdapter).withTitle(title);
            if(eagerlyRender) {
                final DomainObjectReprRenderer renderer = new DomainObjectReprRenderer(rendererContext, getLinkFollowSpecs(), JsonRepresentation.newMap());
                renderer.with(valueAdapter);
View Full Code Here

     */
    protected String titleString(final ObjectAdapter propertyOrParamValue, final FacetHolder propertyOrParam, final FacetHolder propertyOrParamTypeSpecification) {

        final TitleFacet titleFacet = propertyOrParam.getFacet(TitleFacet.class);
        if (titleFacet != null) {
            return titleFacet.title(propertyOrParamValue, null);
        } else {
            return propertyOrParamValue.titleString();
        }
    }

View Full Code Here

        final ValueFacet valueFacet = objectSpec.getFacet(ValueFacet.class);
        if (valueFacet != null) {
            return new JsonValueEncoder().asObject(objectAdapter);
        }
        final TitleFacet titleFacet = objectSpec.getFacet(TitleFacet.class);
        final String title = titleFacet.title(objectAdapter, resourceContext.getLocalization());
        return DomainObjectReprRenderer.newLinkToBuilder(resourceContext, Rel.OBJECT, objectAdapter).withTitle(title).build();
    }

}
View Full Code Here

    protected String titleString(final ObjectAdapter propertyOrParamValue, final FacetHolder propertyOrParam,
        final FacetHolder propertyOrParamTypeSpecification) {

        final TitleFacet titleFacet = propertyOrParam.getFacet(TitleFacet.class);
        if (titleFacet != null) {
            return titleFacet.title(propertyOrParamValue, null);
        } else {
            return propertyOrParamValue.titleString();
        }
    }
View Full Code Here

        if(valueFacet != null) {
            EncodableFacet encodableFacet = getMemberSpecFacet(EncodableFacet.class);
            return encodableFacet.toEncodedString(valueAdapter);
        }
        TitleFacet titleFacet = getMemberSpecFacet(TitleFacet.class);
        String title = titleFacet.title(valueAdapter, getLocalization());
        return LinkRepBuilder.newBuilder(repContext, "value", urlForObject()).withTitle(title).build();
    }

}
View Full Code Here

        if(valueAdapter == null) {
            representation.mapPut("value", NullNode.getInstance());
        } else {
            final TitleFacet titleFacet = spec.getFacet(TitleFacet.class);
            final String title = titleFacet.title(valueAdapter, rendererContext.getLocalization());
           
            final LinkBuilder valueLinkBuilder = DomainObjectReprRenderer.newLinkToBuilder(rendererContext, Rel.VALUE, valueAdapter).withTitle(title);
            if(eagerlyRender) {
                final DomainObjectReprRenderer renderer = new DomainObjectReprRenderer(rendererContext, getLinkFollowSpecs(), JsonRepresentation.newMap());
                renderer.with(valueAdapter);
View Full Code Here

        if(objectAdapter.isValue()) {
            String format = null; // TODO
            return JsonValueEncoder.asObject(objectAdapter, format);
        }
        final TitleFacet titleFacet = objectSpec.getFacet(TitleFacet.class);
        final String title = titleFacet.title(objectAdapter, resourceContext.getLocalization());
        return DomainObjectReprRenderer.newLinkToBuilder(resourceContext, Rel.VALUE, objectAdapter).withTitle(title).build();
    }

   
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.