@Override public Model getGETModel(Representation rep) { return ((ModelImpl) super.getGETModel(rep)) .property("serverLog", new MapProperty()); }
throw new NullPointerException(); DelegatingResourceHandler<? extends T> handler = getResourceHandler(delegate); SimpleObject simple = convertDelegateToRepresentation(delegate, repDescription); maybeDecorateWithType(simple, delegate); decorateWithResourceVersion(simple, representation); Method meth = findAnnotatedMethodForRepresentation(handler.getClass(), representation); if (meth != null) { try { simple = (SimpleObject) meth.invoke(handler, delegate, representation); maybeDecorateWithType(simple, delegate); decorateWithResourceVersion(simple, representation); repDescription = getCustomRepresentationDescription((CustomRepresentation) representation); if (repDescription != null) { SimpleObject simple = convertDelegateToRepresentation(delegate, repDescription);
Method method = findSubclassHandlerMethod(type, methodName, argumentTypes); if (method == null) return null; try { DelegatingSubclassHandler<T, ? extends T> handler = getSubclassHandler(type); return method.invoke(handler, arguments);
@Override public Model getUPDATEModel(Representation rep) { ModelImpl model = (ModelImpl) getCREATEModel(rep); for (String property : getPropertiesToExposeAsSubResources()) { model.getProperties().remove(property); } return model; }
/** * Gets a description of resource's properties which can be edited. * <p/> * By default delegates to {@link #getCreatableProperties()} and removes sub-resources returned * by {@link #getPropertiesToExposeAsSubResources()}. * * @return the description * @throws ResponseException */ @Override public DelegatingResourceDescription getUpdatableProperties() throws ResourceDoesNotSupportOperationException { DelegatingResourceDescription description = getCreatableProperties(); for (String property : getPropertiesToExposeAsSubResources()) { description.getProperties().remove(property); } return description; }
/** * Creates {@link Representation#REF}. * <p> * Calls {@link BaseDelegatingResource#asRepresentation(Object, Representation)} on the resource * with the given object. * * @return the representation * @throws Exception */ public SimpleObject newRefRepresentation() throws Exception { return getResource().asRepresentation(getObject(), Representation.REF); }
/** * Creates {@link Representation#DEFAULT}. * <p> * Calls {@link BaseDelegatingResource#asRepresentation(Object, Representation)} on the resource * with the given object. * * @return the representation * @throws Exception */ public SimpleObject newDefaultRepresentation() throws Exception { return getResource().asRepresentation(getObject(), Representation.DEFAULT); }
@Override public Model getGETModel(Representation rep) { return ((ModelImpl) super.getGETModel(rep)) .property("modules", new ArrayProperty(new RefProperty("#/definitions/ModuleGetRef"))) .property("action", new EnumProperty(ModuleAction.Action.class)); }
/** * Creates {@link Representation#FULL}. * <p> * Calls {@link BaseDelegatingResource#asRepresentation(Object, Representation)} on the resource * with the given object. * * @return the representation * @throws Exception */ public SimpleObject getFullRepresentation() throws Exception { return getResource().asRepresentation(getObject(), Representation.FULL); }
@Override public Model getGETModel(Representation rep) { ModelImpl model = (ModelImpl) super.getGETModel(rep); if (rep instanceof DefaultRepresentation || rep instanceof FullRepresentation) { model .property("display", new StringProperty()); } if (rep instanceof DefaultRepresentation) { model .property("concept", new RefProperty("#/definitions/ConceptGetRef")) .property("conceptName", new RefProperty("#/definitions/ConceptNameGetRef")); } else if (rep instanceof FullRepresentation) { model .property("concept", new RefProperty("#/definitions/ConceptGet")) .property("conceptName", new RefProperty("#/definitions/ConceptNameGetRef")) .property("word", new StringProperty()) .property("transientWeight", new StringProperty()); } return model; }