Class/Object

eu.cdevreeze.tqa.base.dom

TaxonomyElem

Related Docs: object TaxonomyElem | package dom

Permalink

sealed abstract class TaxonomyElem extends CanBeTaxonomyDocumentChild with AnyTaxonomyElem with Elem with ScopedElemLike with SubtypeAwareElemLike

Any element in a taxonomy schema or linkbase document. The classes in this class hierarchy offer the yaidom query API, in particular the ScopedElemApi and SubtypeAwareElemApi query API.

Usage

Suppose we have an eu.cdevreeze.tqa.base.dom.XsdSchema called schema. Then we can find all global element declarations in this schema as follows:

import scala.reflect.classTag
import eu.cdevreeze.tqa.ENames
import eu.cdevreeze.tqa.base.dom.GlobalElementDeclaration

// Low level yaidom query, returning the result XML elements as TaxonomyElem elements
val globalElemDecls1 = schema.filterChildElems(_.resolvedName == ENames.XsElementEName)

// Higher level yaidom query, querying for the type GlobalElementDeclaration
// Prefer this to the lower level yaidom query above
val globalElemDecls2 = schema.findAllChildElemsOfType(classTag[GlobalElementDeclaration])

// The following query would have given the same result, because all global element declarations
// are child elements of the schema root. Instead of child elements, we now query for all
// descendant-or-self elements that are global element declarations
val globalElemDecls3 = schema.findAllElemsOrSelfOfType(classTag[GlobalElementDeclaration])

// We can query the schema for global element declarations directly, so let's do that
val globalElemDecls4 = schema.findAllGlobalElementDeclarations

Leniency

The classes in this type hierarchy have been designed to be very lenient when instantiating them, even for schema-invalid content. The few builder methods that may throw exceptions have been clearly documented to potentially do so. For schema-invalid taxonomy content, the resulting object may be something like OtherXsdElem, OtherLinkElem or OtherNonXLinkElem. For example, an element named xs:element with both a name and ref attribute cannot be both an element declaration and element reference, and will be instantiated as an OtherXsdElem. A non-standard XLink arc, whether a known generic arc or some unknown and potentially erroneous arc, becomes a NonStandardArc, etc.

Some instance methods may fail, however, if taxonomy content is invalid, and if it is schema-invalid in particular. All instance methods must not fail on schema-valid content, unless mentioned otherwise.

Typical instance methods that may fail on schema-invalid content are:

It is important to keep this in mind. Schema-invalid taxonomies will be instantiated successfully, but after instantiation the API user should fall back to (defensive) yaidom level query methods when needed. This is indeed the responsibility of the API user.

Other remarks

The type hierarchy for taxonomy elements is not a strict hierarchy. There are mixin traits for XLink content, "root elements", elements in the xs and link namespaces, etc. Some element types mix in more than one of these traits.

See http://www.datypic.com/sc/xsd/s-xmlschema.xsd.html for schema content in general (as opposed to taxonomy schema content in particular).

It is perfectly fine to embed linkbase content in schema content, and such an element tree will be instantiated correctly.

The underlying backing elements can be any backing element implementation, including BackingNodes.Elem wrappers around Saxon tiny trees! Hence, this taxonomy DOM API is flexible in that it is not bound to one specific backing element implementation.

Linear Supertypes
SubtypeAwareElemLike, SubtypeAwareElemApi, ScopedElemLike, ClarkElemLike, HasText, HasEName, IsNavigable, ElemLike, Elem, ScopedElemApi, HasScopeApi, HasQNameApi, Elem, HasChildNodesApi, AnyElemNodeApi, ClarkElemApi, HasTextApi, HasENameApi, IsNavigableApi, ElemApi, AnyElemApi, Elem, AnyTaxonomyElem, CanBeTaxonomyDocumentChild, CanBeDocumentChild, CanBeDocumentChild, CanBeDocumentChild, TaxonomyNode, Node, Node, Node, AnyRef, Any
Known Subclasses
AllModelGroup, Annotation, AnonymousComplexTypeDefinition, AnonymousSimpleTypeDefinition, AnonymousTypeDefinition, Appinfo, ArcroleRef, ArcroleType, AttributeDeclaration, AttributeDeclarationOrReference, AttributeGroupDefinition, AttributeGroupDefinitionOrReference, AttributeGroupReference, AttributeReference, CalculationArc, CalculationLink, CanBeAbstract, ChildXLink, ChoiceModelGroup, ComplexContent, ComplexTypeDefinition, ConceptLabelResource, ConceptReferenceResource, Content, Definition, DefinitionArc, DefinitionLink, ElementDeclaration, ElementDeclarationOrReference, ElementReference, ExtendedLink, Extension, GlobalAttributeDeclaration, GlobalElementDeclaration, Import, Include, LabelArc, LabelLink, LabeledXLink, LinkElem, Linkbase, LinkbaseRef, LocalAttributeDeclaration, LocalElementDeclaration, ModelGroup, ModelGroupDefinition, ModelGroupDefinitionOrReference, ModelGroupReference, NamedComplexTypeDefinition, NamedDeclOrDef, NamedSimpleTypeDefinition, NamedTypeDefinition, NonStandardArc, NonStandardExtendedLink, NonStandardLocator, NonStandardResource, NonStandardSimpleLink, OtherLinkElem, OtherNonXLinkElem, OtherXsdElem, Particle, PresentationArc, PresentationLink, Reference, ReferenceArc, ReferenceLink, Restriction, RestrictionOrExtension, RoleRef, RoleType, SchemaRef, SequenceModelGroup, SimpleContent, SimpleLink, SimpleTypeDefinition, StandardArc, StandardExtendedLink, StandardLoc, StandardResource, TaxonomyRootElem, TypeDefinition, UsedOn, XLinkArc, XLinkElem, XLinkLink, XLinkLocator, XLinkResource, XsdElem, XsdSchema
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TaxonomyElem
  2. SubtypeAwareElemLike
  3. SubtypeAwareElemApi
  4. ScopedElemLike
  5. ClarkElemLike
  6. HasText
  7. HasEName
  8. IsNavigable
  9. ElemLike
  10. Elem
  11. ScopedElemApi
  12. HasScopeApi
  13. HasQNameApi
  14. Elem
  15. HasChildNodesApi
  16. AnyElemNodeApi
  17. ClarkElemApi
  18. HasTextApi
  19. HasENameApi
  20. IsNavigableApi
  21. ElemApi
  22. AnyElemApi
  23. Elem
  24. AnyTaxonomyElem
  25. CanBeTaxonomyDocumentChild
  26. CanBeDocumentChild
  27. CanBeDocumentChild
  28. CanBeDocumentChild
  29. TaxonomyNode
  30. Node
  31. Node
  32. Node
  33. AnyRef
  34. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. type ThisElem = TaxonomyElem

    Permalink
    Definition Classes
    TaxonomyElem → SubtypeAwareElemLike → SubtypeAwareElemApi → ScopedElemLike → ClarkElemLike → IsNavigable → ElemLike → Elem → ScopedElemApi → Elem → HasChildNodesApi → ClarkElemApi → IsNavigableApi → ElemApi → AnyElemApi
  2. type ThisNode = TaxonomyNode

    Permalink
    Definition Classes
    TaxonomyElem → Elem → Elem → AnyElemNodeApi

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 \(p: (ThisElem) ⇒ Boolean): IndexedSeq[ThisElem]

    Permalink
    Definition Classes
    ElemLike → ElemApi
  5. final def \@(expandedName: EName): Option[String]

    Permalink
    Definition Classes
    HasEName → HasENameApi
  6. final def \\(p: (ThisElem) ⇒ Boolean): IndexedSeq[ThisElem]

    Permalink
    Definition Classes
    ElemLike → ElemApi
  7. final def \\!(p: (ThisElem) ⇒ Boolean): IndexedSeq[ThisElem]

    Permalink
    Definition Classes
    ElemLike → ElemApi
  8. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  9. final def attribute(expandedName: EName): String

    Permalink
    Definition Classes
    HasEName → HasENameApi
  10. final def attributeAsQName(expandedName: EName): QName

    Permalink
    Definition Classes
    ScopedElemLike → ScopedElemApi
  11. final def attributeAsQNameOption(expandedName: EName): Option[QName]

    Permalink
    Definition Classes
    ScopedElemLike → ScopedElemApi
  12. final def attributeAsResolvedQName(expandedName: EName): EName

    Permalink
    Definition Classes
    ScopedElemLike → ScopedElemApi
  13. final def attributeAsResolvedQNameOption(expandedName: EName): Option[EName]

    Permalink
    Definition Classes
    ScopedElemLike → ScopedElemApi
  14. final def attributeOption(expandedName: EName): Option[String]

    Permalink
    Definition Classes
    HasEName → HasENameApi
  15. final def attributes: IndexedSeq[(QName, String)]

    Permalink
    Definition Classes
    TaxonomyElem → HasQNameApi
  16. val backingElem: Elem

    Permalink
  17. final def baseUri: URI

    Permalink
  18. final def baseUriOption: Option[URI]

    Permalink
  19. val childElems: IndexedSeq[TaxonomyElem]

    Permalink
  20. final def children: IndexedSeq[TaxonomyNode]

    Permalink
    Definition Classes
    TaxonomyElem → HasChildNodesApi
  21. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. final def docUri: URI

    Permalink
  23. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  24. final def equals(obj: Any): Boolean

    Permalink
    Definition Classes
    TaxonomyElem → AnyRef → Any
  25. final def filterChildElems(p: (ThisElem) ⇒ Boolean): IndexedSeq[ThisElem]

    Permalink
    Definition Classes
    ElemLike → ElemApi
  26. final def filterChildElemsOfType[B <: ThisElem](subType: ClassTag[B])(p: (B) ⇒ Boolean): IndexedSeq[B]

    Permalink
    Definition Classes
    SubtypeAwareElemLike → SubtypeAwareElemApi
  27. final def filterElems(p: (ThisElem) ⇒ Boolean): IndexedSeq[ThisElem]

    Permalink
    Definition Classes
    ElemLike → ElemApi
  28. final def filterElemsOfType[B <: ThisElem](subType: ClassTag[B])(p: (B) ⇒ Boolean): IndexedSeq[B]

    Permalink
    Definition Classes
    SubtypeAwareElemLike → SubtypeAwareElemApi
  29. final def filterElemsOrSelf(p: (ThisElem) ⇒ Boolean): IndexedSeq[ThisElem]

    Permalink
    Definition Classes
    ElemLike → ElemApi
  30. final def filterElemsOrSelfOfType[B <: ThisElem](subType: ClassTag[B])(p: (B) ⇒ Boolean): IndexedSeq[B]

    Permalink
    Definition Classes
    SubtypeAwareElemLike → SubtypeAwareElemApi
  31. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  32. final def findAllChildElems: IndexedSeq[TaxonomyElem]

    Permalink

    Returns all child elements, and returns them extremely fast.

    Returns all child elements, and returns them extremely fast. This is important for fast querying, at the expense of more expensive recursive creation.

    Definition Classes
    TaxonomyElem → ElemLike → ElemApi
  33. final def findAllChildElemsOfType[B <: ThisElem](subType: ClassTag[B]): IndexedSeq[B]

    Permalink
    Definition Classes
    SubtypeAwareElemLike → SubtypeAwareElemApi
  34. final def findAllChildElemsWithPathEntries: IndexedSeq[(ThisElem, Entry)]

    Permalink
    Definition Classes
    ClarkElemLike → IsNavigable → IsNavigableApi
  35. final def findAllElems: IndexedSeq[ThisElem]

    Permalink
    Definition Classes
    ElemLike → ElemApi
  36. final def findAllElemsOfType[B <: ThisElem](subType: ClassTag[B]): IndexedSeq[B]

    Permalink
    Definition Classes
    SubtypeAwareElemLike → SubtypeAwareElemApi
  37. final def findAllElemsOrSelf: IndexedSeq[ThisElem]

    Permalink
    Definition Classes
    ElemLike → ElemApi
  38. final def findAllElemsOrSelfOfType[B <: ThisElem](subType: ClassTag[B]): IndexedSeq[B]

    Permalink
    Definition Classes
    SubtypeAwareElemLike → SubtypeAwareElemApi
  39. final def findAttributeByLocalName(localName: String): Option[String]

    Permalink
    Definition Classes
    HasEName → HasENameApi
  40. final def findChildElem(p: (ThisElem) ⇒ Boolean): Option[ThisElem]

    Permalink
    Definition Classes
    ElemLike → ElemApi
  41. final def findChildElemByPathEntry(entry: Entry): Option[ThisElem]

    Permalink
    Definition Classes
    ClarkElemLike → IsNavigable → IsNavigableApi
  42. final def findChildElemOfType[B <: ThisElem](subType: ClassTag[B])(p: (B) ⇒ Boolean): Option[B]

    Permalink
    Definition Classes
    SubtypeAwareElemLike → SubtypeAwareElemApi
  43. final def findElem(p: (ThisElem) ⇒ Boolean): Option[ThisElem]

    Permalink
    Definition Classes
    ElemLike → ElemApi
  44. final def findElemOfType[B <: ThisElem](subType: ClassTag[B])(p: (B) ⇒ Boolean): Option[B]

    Permalink
    Definition Classes
    SubtypeAwareElemLike → SubtypeAwareElemApi
  45. final def findElemOrSelf(p: (ThisElem) ⇒ Boolean): Option[ThisElem]

    Permalink
    Definition Classes
    ElemLike → ElemApi
  46. final def findElemOrSelfByPath(path: Path): Option[ThisElem]

    Permalink
    Definition Classes
    IsNavigable → IsNavigableApi
  47. final def findElemOrSelfOfType[B <: ThisElem](subType: ClassTag[B])(p: (B) ⇒ Boolean): Option[B]

    Permalink
    Definition Classes
    SubtypeAwareElemLike → SubtypeAwareElemApi
  48. final def findReverseAncestryOrSelfByPath(path: Path): Option[IndexedSeq[ThisElem]]

    Permalink
    Definition Classes
    IsNavigable → IsNavigableApi
  49. final def findTopmostElems(p: (ThisElem) ⇒ Boolean): IndexedSeq[ThisElem]

    Permalink
    Definition Classes
    ElemLike → ElemApi
  50. final def findTopmostElemsOfType[B <: ThisElem](subType: ClassTag[B])(p: (B) ⇒ Boolean): IndexedSeq[B]

    Permalink
    Definition Classes
    SubtypeAwareElemLike → SubtypeAwareElemApi
  51. final def findTopmostElemsOrSelf(p: (ThisElem) ⇒ Boolean): IndexedSeq[ThisElem]

    Permalink
    Definition Classes
    ElemLike → ElemApi
  52. final def findTopmostElemsOrSelfOfType[B <: ThisElem](subType: ClassTag[B])(p: (B) ⇒ Boolean): IndexedSeq[B]

    Permalink
    Definition Classes
    SubtypeAwareElemLike → SubtypeAwareElemApi
  53. final def getChildElem(p: (ThisElem) ⇒ Boolean): ThisElem

    Permalink
    Definition Classes
    ElemLike → ElemApi
  54. final def getChildElemByPathEntry(entry: Entry): ThisElem

    Permalink
    Definition Classes
    IsNavigable → IsNavigableApi
  55. final def getChildElemOfType[B <: ThisElem](subType: ClassTag[B])(p: (B) ⇒ Boolean): B

    Permalink
    Definition Classes
    SubtypeAwareElemLike → SubtypeAwareElemApi
  56. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  57. final def getElemOrSelfByPath(path: Path): ThisElem

    Permalink
    Definition Classes
    IsNavigable → IsNavigableApi
  58. final def getReverseAncestryOrSelfByPath(path: Path): IndexedSeq[ThisElem]

    Permalink
    Definition Classes
    IsNavigable → IsNavigableApi
  59. final def hashCode(): Int

    Permalink
    Definition Classes
    TaxonomyElem → AnyRef → Any
  60. final def idOption: Option[String]

    Permalink
  61. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  62. final def key: XmlFragmentKey

    Permalink
    Definition Classes
    TaxonomyElemAnyTaxonomyElem
  63. final def localName: String

    Permalink
    Definition Classes
    HasEName → HasENameApi
  64. final def msg(s: String): String

    Permalink
    Attributes
    protected
  65. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  66. final def normalizedText: String

    Permalink
    Definition Classes
    HasText → HasTextApi
  67. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  68. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  69. final def qname: QName

    Permalink
    Definition Classes
    TaxonomyElem → HasQNameApi
  70. final def resolvedAttributes: IndexedSeq[(EName, String)]

    Permalink
    Definition Classes
    TaxonomyElem → HasENameApi
  71. final def resolvedName: EName

    Permalink
    Definition Classes
    TaxonomyElem → HasENameApi
  72. final def scope: Scope

    Permalink
    Definition Classes
    TaxonomyElem → HasScopeApi
  73. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  74. final def text: String

    Permalink
    Definition Classes
    TaxonomyElem → HasTextApi
  75. final def textAsQName: QName

    Permalink
    Definition Classes
    ScopedElemLike → ScopedElemApi
  76. final def textAsResolvedQName: EName

    Permalink
    Definition Classes
    ScopedElemLike → ScopedElemApi
  77. final def thisElem: ThisElem

    Permalink
    Definition Classes
    TaxonomyElem → AnyElemApi
  78. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  79. final def trimmedText: String

    Permalink
    Definition Classes
    HasText → HasTextApi
  80. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  81. final def wait(arg0: Long, arg1: Int): Unit

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

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

Inherited from SubtypeAwareElemLike

Inherited from SubtypeAwareElemApi

Inherited from ScopedElemLike

Inherited from ClarkElemLike

Inherited from HasText

Inherited from HasEName

Inherited from IsNavigable

Inherited from ElemLike

Inherited from Elem

Inherited from ScopedElemApi

Inherited from HasScopeApi

Inherited from HasQNameApi

Inherited from Elem

Inherited from HasChildNodesApi

Inherited from AnyElemNodeApi

Inherited from ClarkElemApi

Inherited from HasTextApi

Inherited from HasENameApi

Inherited from IsNavigableApi

Inherited from ElemApi

Inherited from AnyElemApi

Inherited from Elem

Inherited from AnyTaxonomyElem

Inherited from CanBeDocumentChild

Inherited from CanBeDocumentChild

Inherited from CanBeDocumentChild

Inherited from TaxonomyNode

Inherited from Node

Inherited from Node

Inherited from Node

Inherited from AnyRef

Inherited from Any

Ungrouped