trait DataElementExtractors extends ElementHelpers
Contains helper functions to extract the actual data from a data element and return it as a correct data type.
- Alphabetic
- By Inheritance
- DataElementExtractors
- ElementHelpers
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
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
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
val
binaryDataElements: List[String]
- Definition Classes
- ElementHelpers
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
val
dataElements: List[String]
- Definition Classes
- ElementHelpers
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
val
expressionElements: List[String]
- Definition Classes
- ElementHelpers
-
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
-
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.
-
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
-
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
-
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
-
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 theUTC
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
-
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
-
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
-
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
-
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
-
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
-
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
-
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
-
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
-
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
-
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
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
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
-
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
-
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()
-
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()
-
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
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
def
isBinaryDataElement(tagName: String): Boolean
- Definition Classes
- ElementHelpers
-
def
isDataElement(tagName: String): Boolean
- Definition Classes
- ElementHelpers
-
def
isExpressionElement(tagName: String): Boolean
- Definition Classes
- ElementHelpers
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isStringDataElement(tagName: String): Boolean
- Definition Classes
- ElementHelpers
-
def
isStructuralElement(tagName: String): Boolean
- Definition Classes
- ElementHelpers
-
def
isUniqueDataElement(e: Element): Boolean
- Definition Classes
- ElementHelpers
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
val
stringDataElements: List[String]
- Definition Classes
- ElementHelpers
-
val
structElements: List[String]
- Definition Classes
- ElementHelpers
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )