HashMap<String,String> attributes = new HashMap<String,String>();\r
HashMap<String,List<Pazpar2ResponseData>> elements = new HashMap<String,List<Pazpar2ResponseData>>();\r
String textContent = "";\r
- String errorText = null;\r
+ CommandError error = null;\r
+ String xml = null;\r
\r
public void setType (String type) {\r
this.type = type;\r
}\r
}\r
\r
+ /**\r
+ * Returns the text content of the first element found with the given\r
+ * name\r
+ * @param name of the element \r
+ * @return text value, empty string if none found\r
+ */\r
public String getOneElementValue (String name) {\r
if (getOneElement(name)!=null && getOneElement(name).getValue().length()>0) {\r
return getOneElement(name).getValue();\r
}\r
}\r
\r
- public boolean isError () {\r
- return (getOneElement("error") != null); \r
+ public boolean hasApplicationError () {\r
+ return (getOneElement("applicationerror") != null); \r
}\r
\r
- public String getErrorMessage() {\r
- return getOneElementValue("error");\r
+ public CommandError getApplicationError() {\r
+ return (CommandError) getOneElement("applicationerror");\r
}\r
-\r
- \r
+ \r
+ public boolean hasPazpar2Error() {\r
+ return hasApplicationError() && getApplicationError().hasPazpar2Error();\r
+ }\r
+ \r
+ public void setXml(String xml) {\r
+ this.xml = xml; \r
+ }\r
+ \r
+ public String getXml() {\r
+ return xml;\r
+ }\r
+ \r
}\r