Class XMLMessage
- java.lang.Object
-
- co.ecg.alpaca.toolkit.messaging.response.XMLMessage
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
Response
public class XMLMessage extends Object implements Serializable
A model for an XML message. Comes with utility methods for parsing the XML content.- Author:
- Matthew Keathley on 2/15/17.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description XMLMessage()
XMLMessage(String content)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Boolean
getBoolean(String xPathExpression)
Get a Boolean element by XPath ExpressionString
getContent()
LocalDate
getDate(String xPathExpression)
Returns theLocalDate
given the XML Date.OffsetDateTime
getDateTime(String xPathExpression)
Returns theOffsetDateTime
given the XML DateTime.Float
getFloat(String xPathExpression)
Integer
getInteger(String xPathExpression)
Integer[]
getIntegerArray(String xPathExpression)
Get an array of Integer elements by XPath ExpressionLong
getLong(String xPathExpression)
Node
getNode(String xPathExpression)
Get a Node element by XPath ExpressionNode[]
getNodeArray(String xPathExpression)
Get an array of Node elements by XPath ExpressionNode[]
getNodeArray(String xPathExpression, Node node)
Get an array of Node elements by XPath ExpressionDouble
getNumber(String xPathExpression)
Get a Double element by XPath ExpressionString
getString(String xPathExpression)
Get a String element by XPath ExpressionString[]
getStringArray(String xPathExpression)
Get an array of String elements by XPath ExpressionOffsetTime
getTime(String xPathExpression)
Returns theOffsetTime
given the XML Time.void
setContent(String content)
-
-
-
Constructor Detail
-
XMLMessage
public XMLMessage()
-
XMLMessage
public XMLMessage(String content)
-
-
Method Detail
-
getContent
public String getContent()
-
setContent
public void setContent(String content)
-
getBoolean
public Boolean getBoolean(String xPathExpression)
Get a Boolean element by XPath Expression- Parameters:
xPathExpression
- The expression to retrieve.- Returns:
- The Boolean determined by the XPath expression or NULL if not found.
-
getTime
public OffsetTime getTime(String xPathExpression)
Returns theOffsetTime
given the XML Time.- Parameters:
xPathExpression
- The expression to retrieve.- Returns:
- The parsed OffsetTime.
-
getDate
public LocalDate getDate(String xPathExpression)
Returns theLocalDate
given the XML Date.- Parameters:
xPathExpression
- The expression to retrieve.- Returns:
- The parsed MonthDay.
-
getDateTime
public OffsetDateTime getDateTime(String xPathExpression)
Returns theOffsetDateTime
given the XML DateTime.- Parameters:
xPathExpression
- The expression to retrieve.- Returns:
- The parsed OffsetDateTime.
-
getIntegerArray
public Integer[] getIntegerArray(String xPathExpression)
Get an array of Integer elements by XPath Expression- Parameters:
xPathExpression
- The expression to retrieve.- Returns:
- The array of Integer determined by the XPath expression or NULL if not found
-
getNode
public Node getNode(String xPathExpression)
Get a Node element by XPath Expression- Parameters:
xPathExpression
- The expression to retrieve.- Returns:
- The Node determined by the XPath expression of NULL if not found
-
getNodeArray
public Node[] getNodeArray(String xPathExpression)
Get an array of Node elements by XPath Expression- Parameters:
xPathExpression
- The expression to retrieve.- Returns:
- The array of Strings determined by the XPath expression or NULL if not found
-
getNodeArray
public Node[] getNodeArray(String xPathExpression, Node node)
Get an array of Node elements by XPath Expression- Parameters:
xPathExpression
- The expression to retrieve.- Returns:
- The array of Strings determined by the XPath expression or NULL if not found
-
getNumber
public Double getNumber(String xPathExpression)
Get a Double element by XPath Expression- Parameters:
xPathExpression
- The expression to retrieve.- Returns:
- The Double value of the XPath String
-
getString
public String getString(String xPathExpression)
Get a String element by XPath Expression- Parameters:
xPathExpression
- The expression to retrieve.- Returns:
- The String determined by the XPath expression or NULL if not found
-
-