public abstract class Response extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
protected Request<?> |
request |
protected String |
responseContent |
protected XPath |
xPath |
Constructor and Description |
---|
Response() |
Modifier and Type | Method and Description |
---|---|
protected Boolean |
getBoolean(String xPathExpression)
Get a Boolean element by XPath Expression
|
protected LocalDate |
getDate(String xPathExpression)
Returns the
LocalDate given the XML Date. |
protected OffsetDateTime |
getDateTime(String xPathExpression)
Returns the
OffsetDateTime given the XML DateTime. |
String |
getDetailText()
Returns the Detail text element if available
|
protected Float |
getFloat(String xPathExpression) |
protected Integer |
getInteger(String xPathExpression) |
protected Integer[] |
getIntegerArray(String xPathExpression)
Get an array of Integer elements by XPath Expression
|
protected Long |
getLong(String xPathExpression) |
protected Node |
getNode(String xPathExpression)
Get a Node element by XPath Expression
|
protected Node[] |
getNodeArray(String xPathExpression)
Get an array of Node elements by XPath Expression
|
protected Double |
getNumber(String xPathExpression)
Get a Double element by XPath Expression
|
Request<?> |
getRequest() |
static <T extends Response> |
getResponse(Class<T> clazz,
String responseContent,
Request<?> request)
This creates an object that extends the Response class with the given
response content.
|
String |
getResponseContent() |
protected String |
getString(String xPathExpression)
Get a String element by XPath Expression
|
protected String[] |
getStringArray(String xPathExpression)
Get an array of String elements by XPath Expression
|
String |
getSummaryText()
Returns the Summary text element if available
|
protected OffsetTime |
getTime(String xPathExpression)
Returns the
OffsetTime given the XML Time. |
boolean |
isCommandType(String commandType)
Determine whether this response has a command (element) "xsi:type"
(attribute) value of "c:" + commandType or literally commandType.
|
boolean |
isErrorResponse()
Returns true if the "xsi:type" of this response is a "ErrorRersponse".
|
protected abstract void |
transform()
Transforms the Response from XML Content to a populated POJO
|
@GwtIncompatible protected transient Request<?> request
protected transient String responseContent
@GwtIncompatible protected transient XPath xPath
@GwtIncompatible public static <T extends Response> Response getResponse(Class<T> clazz, String responseContent, Request<?> request)
clazz
- The Response extension class to instantiateresponseContent
- The Response content to create the class withpublic String getResponseContent()
@GwtIncompatible protected abstract void transform()
@GwtIncompatible protected Boolean getBoolean(String xPathExpression)
xPathExpression
- The expression to retrieve.@GwtIncompatible protected OffsetTime getTime(String xPathExpression)
OffsetTime
given the XML Time.xPathExpression
- The expression to retrieve.@GwtIncompatible protected LocalDate getDate(String xPathExpression)
LocalDate
given the XML Date.xPathExpression
- The expression to retrieve.@GwtIncompatible protected OffsetDateTime getDateTime(String xPathExpression)
OffsetDateTime
given the XML DateTime.xPathExpression
- The expression to retrieve.@GwtIncompatible public String getDetailText()
@GwtIncompatible protected Integer[] getIntegerArray(String xPathExpression)
xPathExpression
- The expression to retrieve.@GwtIncompatible protected Node getNode(String xPathExpression)
xPathExpression
- The expression to retrieve.@GwtIncompatible protected Node[] getNodeArray(String xPathExpression)
xPathExpression
- The expression to retrieve.@GwtIncompatible protected Double getNumber(String xPathExpression)
xPathExpression
- The expression to retrieve.@GwtIncompatible public Request<?> getRequest()
@GwtIncompatible protected String getString(String xPathExpression)
xPathExpression
- The expression to retrieve.@GwtIncompatible protected String[] getStringArray(String xPathExpression)
xPathExpression
- The expression to retrieve.@GwtIncompatible public String getSummaryText()
@GwtIncompatible public boolean isCommandType(String commandType) throws RequestException
commandType
- The command type to checkRequestException
- if the command element is not found.@GwtIncompatible public boolean isErrorResponse()
RequestException
- if the command element is not found.Copyright © 2016 ECG. All rights reserved.