use of org.glassfish.config.support.Delete in project Payara by payara.
the class TemplateRestResource method getDeleteCommand.
protected String getDeleteCommand() {
if (entity == null) {
return null;
}
String result = ResourceUtil.getCommand(RestRedirect.OpType.DELETE, getEntity().model);
if ((result == null) && (entity.parent() != null)) {
// trying @Delete annotation that as a generic CRUD delete command, possibly...
Class<? extends ConfigBeanProxy> cbp = null;
try {
cbp = (Class<? extends ConfigBeanProxy>) entity.parent().model.classLoaderHolder.loadClass(entity.parent().model.targetTypeName);
} catch (MultiException e) {
//
return null;
}
Delete del = null;
for (Method m : cbp.getMethods()) {
ConfigModel.Property pp = entity.parent().model.toProperty(m);
if ((pp != null) && (pp.xmlName.equals(tagName)) && m.isAnnotationPresent(Delete.class)) {
del = m.getAnnotation(Delete.class);
break;
}
}
if (del != null) {
return del.value();
}
}
return result;
}
Aggregations