Class XMLMessage

java.lang.Object
co.ecg.alpaca.core.model.XMLMessage
All Implemented Interfaces:
Serializable

public class XMLMessage extends Object implements Serializable
A model for an XML message. Comes with utility methods for parsing the XML content.
Version:
$Id: $Id
Author:
Matthew Keathley on 2/15/17.
See Also:
  • Field Details

    • content

      protected transient String content
    • xPath

      protected transient XPath xPath
  • Constructor Details

    • XMLMessage

      public XMLMessage()

      Constructor for XMLMessage.

    • XMLMessage

      public XMLMessage(String content)

      Constructor for XMLMessage.

      Parameters:
      content - a String object.
  • Method Details

    • getContent

      public String getContent()

      Getter for the field content.

      Returns:
      a String object.
    • setContent

      public void setContent(String content)

      Setter for the field content.

      Parameters:
      content - a String object.
    • 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 the OffsetTime given the XML Time.
      Parameters:
      xPathExpression - The expression to retrieve.
      Returns:
      The parsed OffsetTime.
    • getDate

      public LocalDate getDate(String xPathExpression)
      Returns the LocalDate given the XML Date.
      Parameters:
      xPathExpression - The expression to retrieve.
      Returns:
      The parsed MonthDay.
    • getDateTime

      public OffsetDateTime getDateTime(String xPathExpression)
      Returns the OffsetDateTime given the XML DateTime.
      Parameters:
      xPathExpression - The expression to retrieve.
      Returns:
      The parsed OffsetDateTime.
    • getFloat

      public Float getFloat(String xPathExpression)

      getFloat.

      Parameters:
      xPathExpression - a String object.
      Returns:
      a Float object.
    • getInteger

      public Integer getInteger(String xPathExpression)

      getInteger.

      Parameters:
      xPathExpression - a String object.
      Returns:
      a Integer object.
    • 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
    • getLong

      public Long getLong(String xPathExpression)

      getLong.

      Parameters:
      xPathExpression - a String object.
      Returns:
      a Long object.
    • 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
    • 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
    • getStringArray

      public String[] getStringArray(String xPathExpression)
      Get an array of String 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