t

org.dfasdl.utils

DataElementExtractors

trait DataElementExtractors extends ElementHelpers

Contains helper functions to extract the actual data from a data element and return it as a correct data type.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. DataElementExtractors
  2. ElementHelpers
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. class DataElementFilter extends NodeFilter

    This is a simple implementation of a NodeFilter that can be used to traverse only data elements in a dfasdl xml tree.

    This is a simple implementation of a NodeFilter that can be used to traverse only data elements in a dfasdl xml tree.

    Definition Classes
    ElementHelpers

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. val binaryDataElements: List[String]
    Definition Classes
    ElementHelpers
  6. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. val dataElements: List[String]
    Definition Classes
    ElementHelpers
  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  10. val expressionElements: List[String]
    Definition Classes
    ElementHelpers
  11. final def extractBinaryData(d: String, e: Element): Try[Array[Byte]]

    Extract the binary data represented by the given string.

    Extract the binary data represented by the given string.

    d

    A string holding a representation of the binary data.

    e

    The element that describes the data.

    returns

    Either an error or the extracted binary data.

    Attributes
    protected
  12. def extractData(d: String, e: Element): Try[Any]

    Use the given data element description to convert the given data string into a useful data type.

    Use the given data element description to convert the given data string into a useful data type.

    d

    The actual data.

    e

    The element that describes the data.

    returns

    Either an error or the extracted data type.

  13. final def extractDate(d: String): Try[LocalDate]

    Extract a java.time.LocalDate from the given data string using the default ISO format.

    Extract a java.time.LocalDate from the given data string using the default ISO format.

    d

    A string containing a parseable date.

    returns

    Either an error or a date.

    Attributes
    protected
  14. final def extractDate(f: DateTimeFormatter)(d: String): Try[LocalDate]

    Extract a java.time.LocalDate from the given data string using the provided format.

    Extract a java.time.LocalDate from the given data string using the provided format.

    f

    The format of the date string.

    d

    A string containing a parseable date.

    returns

    Either an error or a date.

    Attributes
    protected
  15. final def extractDateTime(d: String): Try[OffsetDateTime]

    Extract a java.time.OffsetDateTime from the given data string using the default ISO format.

    Extract a java.time.OffsetDateTime from the given data string using the default ISO format.

    d

    A string containing a parseable datetime.

    returns

    Either an error or a datetime with an offset.

    Attributes
    protected
  16. final def extractDateTime(f: DateTimeFormatter)(d: String): Try[OffsetDateTime]

    Extract a java.time.OffsetDateTime from the given data string using the provided format.

    Extract a java.time.OffsetDateTime from the given data string using the provided format.

    If the offset datetime could not be parsed directly the java.time.LocalDateTime parser is tried and upon success converted into an offset datetime using the UTC timezone.

    f

    The format of the datetime string.

    d

    A string containing a parseable datetime.

    returns

    Either an error or a datetime with an offset.

    Attributes
    protected
  17. final def extractDecimal(d: String, e: Element): Try[BigDecimal]

    Extract a decimal number from the given string data.

    Extract a decimal number from the given string data. The string should contain a valid integer number which will be parsed according to the precision attribute of the dfasdl element.

    d

    The string holding the data.

    e

    The element that describes the data.

    returns

    Either an error or a decimal number.

    Attributes
    protected
  18. final def extractFormattedNumber(d: String): Try[BigDecimal]

    Extract a java.math.BigDecimal from the given data string.

    Extract a java.math.BigDecimal from the given data string.

    d

    A string containing a parseable decimal number.

    returns

    Either an error or a decimal number.

    Attributes
    protected
  19. final def extractFormattedNumber(dec: Option[String])(d: String): Try[BigDecimal]

    Extract a java.math.BigDecimal from the given data string using the provided decimal separator.

    Extract a java.math.BigDecimal from the given data string using the provided decimal separator.

    dec

    The character sequence that is used as a decimal separator.

    d

    A string containing a parseable decimal number.

    returns

    Either an error or a decimal number.

    Attributes
    protected
  20. final def extractFormattedNumber(del: Option[String], dec: Option[String])(d: String): Try[BigDecimal]

    Extract a java.math.BigDecimal from the given data string using the provided thousands delimiter and decimal separator.

    Extract a java.math.BigDecimal from the given data string using the provided thousands delimiter and decimal separator.

    del

    The character sequence that is used as a thousands delimiter.

    dec

    The character sequence that is used as a decimal separator.

    d

    A string containing a parseable decimal number.

    returns

    Either an error or a decimal number.

    Attributes
    protected
  21. final def extractFormattedTime(d: String, e: Element): Try[Either[Either[LocalTime, LocalDate], OffsetDateTime]]

    Parse the given input string using the format provided by the element and try to return a matching temporal type.

    Parse the given input string using the format provided by the element and try to return a matching temporal type. The following priority regarding possibly matching temporals is used:

    • java.time.OffsetDateTime
    • java.time.LocalDate
    • java.time.LocalTime
    d

    A string containing a parseable input.

    e

    The element that describes the data.

    returns

    Either an error or a matching temporal type in respect to the described ordering.

    Attributes
    protected
  22. final def extractFormattedTime(f: DateTimeFormatter)(d: String): Try[Either[Either[LocalTime, LocalDate], OffsetDateTime]]

    Parse the given input string using the provided format and try to return a matching temporal type.

    Parse the given input string using the provided format and try to return a matching temporal type. The following priority regarding possibly matching temporals is used:

    • java.time.OffsetDateTime
    • java.time.LocalDate
    • java.time.LocalTime
    f

    The format of the input string.

    d

    A string containing a parseable input.

    returns

    Either an error or a matching temporal type in respect to the described ordering.

    Attributes
    protected
  23. final def extractInteger(d: String, e: Element): Try[Long]

    Extract an integer number from the given string data.

    Extract an integer number from the given string data.

    d

    The string holding the data.

    e

    The element that describes the data.

    returns

    Either an error or an integer number.

    Attributes
    protected
  24. final def extractStringData(d: String, e: Element): Try[Any]

    Extract the data from a string element.

    Extract the data from a string element.

    d

    The string holding the data.

    e

    The element that describes the data.

    returns

    Either an error or the extracted data.

    Attributes
    protected
  25. final def extractTime(d: String): Try[LocalTime]

    Extract a java.time.LocalTime from the given data string using the default ISO format.

    Extract a java.time.LocalTime from the given data string using the default ISO format.

    d

    A string containing a parseable time.

    returns

    Either an error or a date.

    Attributes
    protected
  26. final def extractTime(f: DateTimeFormatter)(d: String): Try[LocalTime]

    Extract a java.time.LocalTime from the given data string using the provided format.

    Extract a java.time.LocalTime from the given data string using the provided format.

    f

    The format of the time string.

    d

    A string containing a parseable time.

    returns

    Either an error or a date.

    Attributes
    protected
  27. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  28. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  29. def getDataElementType(tagName: String): DataElementType

    Analyze the given DataElement and return the type.

    Analyze the given DataElement and return the type. If the type is not known an UnknownElement type is returned.

    tagName

    The tag name of the element.

    returns

    The data element type or UnknownElement

    Definition Classes
    ElementHelpers
  30. def getElementType(tagName: String): ElementType

    Analyze the given tag name and return the DFASDL element type.

    Analyze the given tag name and return the DFASDL element type. If the type is not known an UnknownElement type is returned.

    tagName

    The tag name of the element.

    returns

    The element type or UnknownElement.

    Definition Classes
    ElementHelpers
  31. final def getParentChoice(n: Node): Option[Element]

    Walk up the tree until we find the parent choice of the given node.

    Walk up the tree until we find the parent choice of the given node.

    n

    The start node.

    returns

    An option to the parent choice element if it exists.

    Definition Classes
    ElementHelpers
    Annotations
    @SuppressWarnings() @tailrec()
  32. final def getParentSequence(n: Node): Option[Element]

    Walk up the tree until we find the parent sequence of the given node.

    Walk up the tree until we find the parent sequence of the given node.

    n

    The start node.

    returns

    An option to the parent sequence element if it exists.

    Definition Classes
    ElementHelpers
    Annotations
    @SuppressWarnings() @tailrec()
  33. def getStructureElementType(tagName: String): StructureElementType

    Analyze the given structural element name and return it's type.

    Analyze the given structural element name and return it's type. If the type is not known an Unknownelement type is returned.

    tagName

    The tag name of the element.

    returns

    The structural element type or UnknownElement.

    Definition Classes
    ElementHelpers
  34. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  35. def isBinaryDataElement(tagName: String): Boolean
    Definition Classes
    ElementHelpers
  36. def isDataElement(tagName: String): Boolean
    Definition Classes
    ElementHelpers
  37. def isExpressionElement(tagName: String): Boolean
    Definition Classes
    ElementHelpers
  38. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  39. def isStringDataElement(tagName: String): Boolean
    Definition Classes
    ElementHelpers
  40. def isStructuralElement(tagName: String): Boolean
    Definition Classes
    ElementHelpers
  41. def isUniqueDataElement(e: Element): Boolean
    Definition Classes
    ElementHelpers
  42. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  43. final def notify(): Unit
    Definition Classes
    AnyRef
  44. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  45. val stringDataElements: List[String]
    Definition Classes
    ElementHelpers
  46. val structElements: List[String]
    Definition Classes
    ElementHelpers
  47. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  48. def toString(): String
    Definition Classes
    AnyRef → Any
  49. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  50. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  51. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from ElementHelpers

Inherited from AnyRef

Inherited from Any

Ungrouped