Back to project page js-android-sdk.
The source code is released under:
GNU Lesser General Public License
If you think the Android project js-android-sdk listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.jaspersoft.android.sdk.client.oxm.report; /*from w w w . j a va 2 s . com*/ import org.simpleframework.xml.Element; import org.simpleframework.xml.Root; import org.simpleframework.xml.Serializer; import org.simpleframework.xml.core.Persister; import org.springframework.web.client.HttpStatusCodeException; import java.io.StringWriter; /** * @author Tom Koptel * @since 1.9 */ @Root(strict = false) public class ErrorDescriptor { @Element private String errorCode; @Element(required = false) private String message; public static ErrorDescriptor valueOf(HttpStatusCodeException exception) { String response = exception.getResponseBodyAsString(); Serializer serializer = new Persister(); StringWriter stringWriter = new StringWriter(); stringWriter.append(response); try { return serializer.read(ErrorDescriptor.class, response); } catch (Exception e) { throw new RuntimeException(e); } } public String getErrorCode() { return errorCode; } public void setErrorCode(String errorCode) { this.errorCode = errorCode; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } }