PathMatch

grackle.Mapping.MappingPredicate.PathMatch
case class PathMatch(path: Path) extends MappingPredicate

A predicate that matches the given Path as the suffix of the context path.

Note that a Path corresponds to an initial type, followed by a sequence of field selectors. The type found by following the field selectors from the initial type determines the final type to which the predicate applies.

This predicate is thus a slightly more restrictive variant of PrefixedTypeMatch which will match in any context with the given path and final type, irrespective of the initial type.

In practice PathMatch is more convenient to use in most circumstances and should be preferred to PrefixedTypeMatch unless the semantics of the latter are absolutely required.

Attributes

Source
mapping.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

Does this predicate apply to the given context?

Does this predicate apply to the given context?

Yields the priority of the corresponding TypeMapping if the predicate applies, or None otherwise.

Attributes

Source
mapping.scala

Given a Context, yield a strictly extended Context which would be matched by this predicate, if any, None otherwise.

Given a Context, yield a strictly extended Context which would be matched by this predicate, if any, None otherwise.

For a PathMatch predicate, the contination context is the given context extended by the prefix path, navigating through interfaces and unions as necessary, but only if the path root type matches the given context type.

Attributes

Source
mapping.scala

Inherited methods

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product

Concrete fields

lazy val tpe: NamedType

The type to which this predicate applies

The type to which this predicate applies

Attributes

Source
mapping.scala