// ///////////////////////////////////////////////////////////////////
//
// ///////////////////////////////////////////////////////////////////
public static Object valueOrRef(final ResourceContext resourceContext, final ObjectAdapter objectAdapter, final ObjectSpecification objectSpec) {
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());