trait IsNavigableApi extends AnyElemApi
This trait offers Path-based navigation support.
This trait typically does not show up in application code using yaidom, yet its (uniform) API does. Hence, it makes sense to read the documentation of this trait, knowing that the API is offered by multiple element implementations.
This trait is purely abstract. The most common implementation of this trait is eu.cdevreeze.yaidom.queryapi.IsNavigable.
IsNavigableApi more formally
Some properties are expected to hold for "navigable elements":
getElemOrSelfByPath(Path.Empty) == self
findElemOrSelfByPath(path1).flatMap(e => e.findElemOrSelfByPath(path2)) == findElemOrSelfByPath(path1.append(path2))
- Alphabetic
- By Inheritance
- IsNavigableApi
- AnyElemApi
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
abstract
type
ThisElem <: IsNavigableApi
The element type itself.
The element type itself. It must be restricted to a sub-type of the query API trait in question.
Concrete element classes will restrict this type to that element class itself.
- Definition Classes
- IsNavigableApi → AnyElemApi
Abstract Value Members
-
abstract
def
findAllChildElemsWithPathEntries: IndexedSeq[(ThisElem, Entry)]
Returns all child elements paired with their path entries.
-
abstract
def
findChildElemByPathEntry(entry: Entry): Option[ThisElem]
Finds the child element with the given
Path.Entry
(where this element is the root), if any, wrapped in anOption
.Finds the child element with the given
Path.Entry
(where this element is the root), if any, wrapped in anOption
.Typically this method must be very efficient, in order for methods like findElemOrSelfByPath to be efficient.
-
abstract
def
findElemOrSelfByPath(path: Path): Option[ThisElem]
Finds the element with the given
Path
(where this element is the root), if any, wrapped in anOption
.Finds the element with the given
Path
(where this element is the root), if any, wrapped in anOption
.That is, returns:
findReverseAncestryOrSelfByPath(path).map(_.last)
Note that for each non-empty Path, we have:
findElemOrSelfByPath(path) == findChildElemByPathEntry(path.firstEntry). flatMap(_.findElemOrSelfByPath(path.withoutFirstEntry))
-
abstract
def
findReverseAncestryOrSelfByPath(path: Path): Option[IndexedSeq[ThisElem]]
Finds the reversed ancestry-or-self of the element with the given
Path
(where this element is the root), wrapped in an Option.Finds the reversed ancestry-or-self of the element with the given
Path
(where this element is the root), wrapped in an Option. None is returned if no element can be found at the given Path.Hence, the resulting element collection, if any, starts with this element and ends with the element at the given Path, relative to this element.
This method comes in handy for (efficiently) computing base URIs, where the (reverse) ancestry-or-self is needed as input.
-
abstract
def
getChildElemByPathEntry(entry: Entry): ThisElem
Returns (the equivalent of)
findChildElemByPathEntry(entry).get
-
abstract
def
getElemOrSelfByPath(path: Path): ThisElem
Returns (the equivalent of)
findElemOrSelfByPath(path).get
-
abstract
def
getReverseAncestryOrSelfByPath(path: Path): IndexedSeq[ThisElem]
Returns (the equivalent of)
findReverseAncestryOrSelfByPath(path).get
-
abstract
def
thisElem: ThisElem
This element itself.
This element itself.
- Definition Classes
- AnyElemApi
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()