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 DefaultIndexedBridgeElem extends AnyVal with IndexedBridgeElem

    Extensible bridge element taking an indexed.Elem.

  2. final class DefaultSimpleBridgeElem extends AnyVal with SimpleBridgeElem

    Extensible simple bridge element taking a simple.Elem.

  3. trait IndexedBridgeElem extends SimpleBridgeElem

    Bridge element that extends SimpleBridgeElem with "indexing".

  4. final class IndexedWrapperElem extends IndexedBridgeElem with ScopedElemLike[IndexedWrapperElem]

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

  5. trait SimpleBridgeElem extends Any

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

  6. final class SimpleWrapperElem extends SimpleBridgeElem with ScopedElemLike[SimpleWrapperElem]

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

Inherited from AnyRef

Inherited from Any

Ungrouped