eu.cdevreeze.yaidom

bridge

package bridge

This package contains abstract APIs and concrete implementations of so-called "bridge elements".

These bridge elements can play a role in supporting yaidom SubtypeAwareElemApi-backed XML dialects that can use multiple "DOM backends". These bridges abstract over those "backends".

Other projects can use as little or as much of these traits as desired. It would be quite natural to use only one purely abstract bridge element API of this package, provide an own implementation, and extend the API and implementation according to the needs of that project.

Currently these common bridge element APIs and implementations live in the XLink project, but maybe in the future they belong to the core yaidom project (so that no longer a dependency on this project is needed if XLink support itself is not needed).

Design notes

Why do we need all this wrapping? After all, a simple element is wrapped in a more general DefaultSimpleBridgeElem (possibly without any object creation costs), which is wrapped in another element such as a SimpleWrapperElem that offers the appropriate query API.

The "XML dialect API" offers the appropriate query API traits, and they are backed by pluggable DOM-like (yaidom) element implementations (which themselves may wrap elements from other libraries). The pluggable yaidom "backends" are essentially combinations of query API traits. The type parameter (assuming only one such parameter for now) of the element type itself must be introduced somewhere, however. Existential types (like ScopedElemApi[_]) are no option. One option is to have the enclosing context introduce the type parameter, but that would mean the use of the cake pattern, which comes with some inconveniences. Another option is to make the "XML dialect API" inheritance tree generic. That is inconvenient too. That leaves us with a bridge between generic "backends" and non-generic XML dialect support. Again, indirection saves the day.

As an aside, yaidom uses generics instead of abstract types to model F-bounded polymorphism, because generics turned out to be a better fit to implement the query API.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. bridge
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. final class DefaultDocawareBridgeElem extends AnyVal with DocawareBridgeElem

    Extensible bridge element taking an docaware.Elem.

    Extensible bridge element taking an docaware.Elem. This is a value class instance, to prevent object creation.

  2. final class DefaultIndexedBridgeElem extends AnyVal with IndexedBridgeElem

    Extensible bridge element taking an indexed.Elem.

    Extensible bridge element taking an indexed.Elem. This is a value class instance, to prevent object creation.

  3. final class DefaultSimpleBridgeElem extends AnyVal with SimpleBridgeElem

    Extensible simple bridge element taking a simple.Elem.

    Extensible simple bridge element taking a simple.Elem. This is a value class instance, to prevent object creation.

  4. trait DocawareBridgeElem extends IndexedBridgeElem

    Bridge element that extends IndexedBridgeElem with "document-awareness".

    Bridge element that extends IndexedBridgeElem with "document-awareness".

    It offers pluggable DOM-like element implementations, without any "type gymnastics" and without paying any "cake pattern tax".

    This is a purely abstract universal trait, allowing for allocation-free value objects.

  5. final class DocawareWrapperElem extends DocawareBridgeElem with ScopedElemLike[DocawareWrapperElem] with IsNavigable[DocawareWrapperElem]

    This object is like a DocawareBridgeElem, but offering the ScopedElemLike and IsNavigable query API.

    This object is like a DocawareBridgeElem, but offering the ScopedElemLike and IsNavigable query API. It is itself also a DocawareBridgeElem, and wraps a DocawareBridgeElem.

    Use this object when you want a DocawareBridgeElem, but at the same time want to use the yaidom query API.

  6. trait IndexedBridgeElem extends SimpleBridgeElem

    Bridge element that extends SimpleBridgeElem with "indexing".

    Bridge element that extends SimpleBridgeElem with "indexing".

    It offers pluggable DOM-like element implementations, without any "type gymnastics" and without paying any "cake pattern tax".

    This is a purely abstract universal trait, allowing for allocation-free value objects.

  7. final class IndexedWrapperElem extends IndexedBridgeElem with ScopedElemLike[IndexedWrapperElem] with IsNavigable[IndexedWrapperElem]

    This object is like a IndexedBridgeElem, but offering the ScopedElemLike and IsNavigable query API.

    This object is like a IndexedBridgeElem, but offering the ScopedElemLike and IsNavigable query API. It is itself also a IndexedBridgeElem, and wraps a IndexedBridgeElem.

    Use this object when you want a IndexedBridgeElem, but at the same time want to use the yaidom query API.

  8. trait SimpleBridgeElem extends Any

    Bridge element that enables the ScopedElemLike with IsNavigableLike API (and more) on the classes delegating to this bridge element.

    Bridge element that enables the ScopedElemLike with IsNavigableLike API (and more) on the classes delegating to this bridge element.

    It offers pluggable DOM-like element implementations, without any "type gymnastics" and without paying any "cake pattern tax".

    This is a purely abstract universal trait, allowing for allocation-free value objects.

  9. final class SimpleWrapperElem extends SimpleBridgeElem with ScopedElemLike[SimpleWrapperElem] with IsNavigable[SimpleWrapperElem]

    This object is like a SimpleBridgeElem, but offering the ScopedElemLike and IsNavigable query API.

    This object is like a SimpleBridgeElem, but offering the ScopedElemLike and IsNavigable query API. It is itself also a SimpleBridgeElem, and wraps a SimpleBridgeElem.

    Use this object when you want a SimpleBridgeElem, but at the same time want to use the yaidom query API.

Inherited from AnyRef

Inherited from Any

Ungrouped