Trait

org.dfasdl.utils

DataElementExtractors

Related Doc: package utils

Permalink

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

    Permalink

    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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. val binaryDataElements: List[String]

    Permalink
    Definition Classes
    ElementHelpers
  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @throws( ... )
  7. val dataElements: List[String]

    Permalink
    Definition Classes
    ElementHelpers
  8. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  10. val expressionElements: List[String]

    Permalink
    Definition Classes
    ElementHelpers
  11. final def extractBinaryData(d: String, e: Element): Array[Byte]

    Permalink

    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[DataElement]

    Permalink

    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]

    Permalink

    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]

    Permalink

    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]

    Permalink

    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]

    Permalink

    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]

    Permalink

    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]

    Permalink

    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]

    Permalink

    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]

    Permalink

    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]]

    Permalink

    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]]

    Permalink

    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]

    Permalink

    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[DataElement]

    Permalink

    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]

    Permalink

    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]

    Permalink

    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. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  28. def getDataElementType(tagName: String): DataElementType

    Permalink

    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
  29. def getElementType(tagName: String): ElementType

    Permalink

    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
  30. final def getParentChoice(n: Node): Option[Element]

    Permalink

    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()
  31. final def getParentSequence(n: Node): Option[Element]

    Permalink

    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()
  32. def getStructureElementType(tagName: String): StructureElementType

    Permalink

    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
  33. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  34. def isBinaryDataElement(tagName: String): Boolean

    Permalink
    Definition Classes
    ElementHelpers
  35. def isDataElement(tagName: String): Boolean

    Permalink
    Definition Classes
    ElementHelpers
  36. def isExpressionElement(tagName: String): Boolean

    Permalink
    Definition Classes
    ElementHelpers
  37. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  38. def isStringDataElement(tagName: String): Boolean

    Permalink
    Definition Classes
    ElementHelpers
  39. def isStructuralElement(tagName: String): Boolean

    Permalink
    Definition Classes
    ElementHelpers
  40. def isUniqueDataElement(e: Element): Boolean

    Permalink
    Definition Classes
    ElementHelpers
  41. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  42. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  43. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  44. val stringDataElements: List[String]

    Permalink
    Definition Classes
    ElementHelpers
  45. val structElements: List[String]

    Permalink
    Definition Classes
    ElementHelpers
  46. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  47. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  48. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  49. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  50. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @Deprecated @deprecated @throws( classOf[java.lang.Throwable] )
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from ElementHelpers

Inherited from AnyRef

Inherited from Any

Ungrouped