Class/Object

eu.cdevreeze.tqa.base.dom

TaxonomyElem

Related Docs: object TaxonomyElem | package dom

Permalink

sealed abstract class TaxonomyElem extends 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 BackingElemApi 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, ScopedElemApi, HasScopeApi, HasQNameApi, ClarkElemApi, HasTextApi, HasENameApi, IsNavigableApi, ElemApi, AnyElemApi, Elem, CanBeDocumentChild, Node, AnyTaxonomyElem, 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. ScopedElemApi
  11. HasScopeApi
  12. HasQNameApi
  13. ClarkElemApi
  14. HasTextApi
  15. HasENameApi
  16. IsNavigableApi
  17. ElemApi
  18. AnyElemApi
  19. Elem
  20. CanBeDocumentChild
  21. Node
  22. AnyTaxonomyElem
  23. AnyRef
  24. 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 → ScopedElemApi → ClarkElemApi → IsNavigableApi → ElemApi → AnyElemApi

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: BackingElemApi

    Permalink
  17. final def baseUri: URI

    Permalink
  18. final def baseUriOption: Option[URI]

    Permalink
  19. val childElems: IndexedSeq[TaxonomyElem]

    Permalink
  20. def clone(): AnyRef

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

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

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

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

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

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

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

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

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

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  31. 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
  32. final def findAllChildElemsOfType[B <: ThisElem](subType: ClassTag[B]): IndexedSeq[B]

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Permalink
  60. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  61. final def key: XmlFragmentKey

    Permalink
    Definition Classes
    TaxonomyElemAnyTaxonomyElem
  62. final def localName: String

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

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

    Permalink
    Definition Classes
    AnyRef
  65. final def normalizedText: String

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

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

    Permalink
    Definition Classes
    AnyRef
  68. final def qname: QName

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
  73. final def text: String

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

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

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

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  81. 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 ScopedElemApi

Inherited from HasScopeApi

Inherited from HasQNameApi

Inherited from ClarkElemApi

Inherited from HasTextApi

Inherited from HasENameApi

Inherited from IsNavigableApi

Inherited from ElemApi

Inherited from AnyElemApi

Inherited from Elem

Inherited from CanBeDocumentChild

Inherited from Node

Inherited from AnyTaxonomyElem

Inherited from AnyRef

Inherited from Any

Ungrouped