t

org.dfasdl.utils

DocumentHelpers

trait DocumentHelpers extends ElementHelpers

Useful functions for handling DFASDL documents.

Annotations
@SuppressWarnings()
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. DocumentHelpers
  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. 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.

  5. 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.

  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. val binaryDataElements: List[String]
    Definition Classes
    ElementHelpers
  8. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. 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()
  10. 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()
  11. val dataElements: List[String]
    Definition Classes
    ElementHelpers
  12. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  14. val expressionElements: List[String]
    Definition Classes
    ElementHelpers
  15. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. 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()
  17. 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.

  18. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  19. 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
  20. 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
  21. 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()
  22. 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()
  23. 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()
  24. 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.

  25. 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
  26. def getUniqueDataElements(doc: Document): Set[Element]

    Return all data elements from the given dfasdl document that have the unique attribute set to true.

    Return all data elements from the given dfasdl document that have the unique attribute set to true.

    doc

    A dfasdl xml document.

    returns

    A set of elements.

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

Inherited from ElementHelpers

Inherited from AnyRef

Inherited from Any

Ungrouped