@GET
@Produces({"text/html;qs=2", MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
public Object get() {
List<Dom> entities = getEntity();
if (entities == null) {
return new GetResultList(new ArrayList(), "", new String[][]{}, new OptionsResult(Util.getResourceName(uriInfo)));//empty dom list
}
RestActionReporter ar = new RestActionReporter();
ar.setActionExitCode(ActionReport.ExitCode.SUCCESS);
ar.setActionDescription("property");
List properties = new ArrayList();
for (Dom child : entities) {
Map<String, String> entry = new HashMap<String, String>();
entry.put("name", child.attribute("name"));
entry.put("value", child.attribute("value"));
String description = child.attribute("description");
if (description != null) {
entry.put("description", description);
}
properties.add(entry);
}
Properties extraProperties = new Properties();
extraProperties.put("properties", properties);
ar.setExtraProperties(extraProperties);
return new ActionReportResult("properties", ar, new OptionsResult(Util.getResourceName(uriInfo)));
}