trait DocumentHelpers extends ElementHelpers
Useful functions for handling DFASDL documents.
- Annotations
- @SuppressWarnings()
- Alphabetic
- By Inheritance
- DocumentHelpers
- 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
-
def
analyzeChoice(choice: Element): Map[Element, List[Element]]
Analyze the given choice and return it's branches and their data elements.
Analyze the given choice and return it's branches and their data elements. Only the first level(!) of the choice is used to determine the branches. If there is only one
celem
beneath the choice then it will only count as one branch!- choice
The choice to be analyzed.
- returns
A map containing the data elements mapped to their top branch element.
-
final
def
analyzeChoiceBranch(branch: Node): List[Element]
Return the list of child data elements if the given node is a choice element.
Return the list of child data elements if the given node is a choice element.
- branch
The node to be analyzed.
- returns
A list of child data elements.
-
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( ... )
-
def
createDocumentBuilder(useSchema: Boolean = true, schemaDefinition: String = "/org/dfasdl/dfasdl.xsd"): DocumentBuilder
Creates a DOM document builder specific for our DFASDL schema.
Creates a DOM document builder specific for our DFASDL schema.
- useSchema
Determines if we want to to create a document builder using the DFASDL schema.
- schemaDefinition
The schema definition, e.g. the XSD file to load.
- returns
A document builder using the DFASDL schema.
- Annotations
- @SuppressWarnings()
-
def
createNormalizedDocument(xml: String, useSchema: Boolean = true): Document
Create an xml document that is normalized and uses the DFASDL schema per default.
Create an xml document that is normalized and uses the DFASDL schema per default.
- xml
A string containing the xml.
- useSchema
Indicate if the DFASDL schema has to be used (defaults to
true
).- returns
A DOM xml document tree.
- Annotations
- @SuppressWarnings()
-
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
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
getChildDataElements(treeWalker: TreeWalker): List[Element]
Get the data elements that are child elements of the given treewalker.
Get the data elements that are child elements of the given treewalker.
- treeWalker
The starting point of the recursion.
- returns
A list of elements that are DataElements of the treewalker.
- Annotations
- @SuppressWarnings()
-
def
getChildDataElementsFromElement(e: Element): List[Element]
Get the data elements that are child elements of the given element.
Get the data elements that are child elements of the given element.
- e
The parent element of the data elements.
- returns
A list of data elements that are child elements.
-
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
getSortedIdList(doc: Document): Vector[String]
Traverse the given xml document and return the list of ids in the apropriate order.
Traverse the given xml document and return the list of ids in the apropriate order.
- doc
A xml document.
- returns
A list of ids that may be empty.
- Annotations
- @SuppressWarnings()
-
def
getSortedIdList(dfasdl: String): Vector[String]
Convert the given dfasdl into an xml document, traverse it and return the list of ids in the apropriate order.
Convert the given dfasdl into an xml document, traverse it and return the list of ids in the apropriate order.
- dfasdl
A string containing a dfasdl.
- returns
A list of ids that may be empty.
-
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
getUniqueDataElements(doc: Document): Set[Element]
Return all data elements from the given dfasdl document that have the
unique
attribute set totrue
.Return all data elements from the given dfasdl document that have the
unique
attribute set totrue
.- doc
A dfasdl xml document.
- returns
A set of elements.
-
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( ... )