case class DocumentCursor(target: Document, parent: TreeCursor, resolver: ReferenceResolver, config: Config, templatePath: Option[Path], position: TreePosition) extends Cursor with Product with Serializable
Cursor for a single document, its parent, siblings and root directories, its associated template and other context information that is required during a rewrite operation.
- target
the document this cursor points to
- parent
the parent document tree of the referred document
- resolver
the resolver for references in templates
- config
the configuration associated with the target document
- templatePath
the path of the template that has been applied to this document
- position
the position of the target document inside a tree hierarchy
- Self Type
- DocumentCursor
- Alphabetic
- By Inheritance
- DocumentCursor
- Serializable
- Serializable
- Product
- Equals
- Cursor
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
DocumentCursor(target: Document, parent: TreeCursor, resolver: ReferenceResolver, config: Config, templatePath: Option[Path], position: TreePosition)
- target
the document this cursor points to
- parent
the parent document tree of the referred document
- resolver
the resolver for references in templates
- config
the configuration associated with the target document
- templatePath
the path of the template that has been applied to this document
- position
the position of the target document inside a tree hierarchy
Type Members
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() @HotSpotIntrinsicCandidate()
-
val
config: Config
The configuration associated with this node.
The configuration associated with this node.
- Definition Classes
- DocumentCursor → Cursor
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
flattenedSiblings: Siblings
Provides navigation capabilities to the siblings of this document where the entire hierarchical tree view is flattened into a single book-like list of documents.
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
nextDocument: Option[DocumentCursor]
The next document in a hierarchical tree view or None if this cursor points to the last document in the current sub-tree.
The next document in a hierarchical tree view or None if this cursor points to the last document in the current sub-tree. Use
flattenedSiblings.nextDocument
for navigation beyond the current sub-tree in a book-like flattened view. -
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- val parent: TreeCursor
-
val
path: Path
The full, absolute path of the target of this cursor in the (virtual) document tree
The full, absolute path of the target of this cursor in the (virtual) document tree
- Definition Classes
- DocumentCursor → Cursor
-
val
position: TreePosition
The position of this node within the document tree.
The position of this node within the document tree.
- Definition Classes
- DocumentCursor → Cursor
-
def
previousDocument: Option[DocumentCursor]
The previous document in a hierarchical tree view or None if this cursor points to the first document in the current sub-tree.
The previous document in a hierarchical tree view or None if this cursor points to the first document in the current sub-tree. Use
flattenedSiblings.previousDocument
for navigation beyond the current sub-tree in a book-like flattened view. -
def
resolveReference(key: Key): ConfigResult[Option[ConfigValue]]
Resolves the context reference with the specified path relative to this document.
Resolves the context reference with the specified path relative to this document. A reference
config.value
for example will first look up the value in the configuration of this document and then, if not found, recursively look it up in parent trees until the root tree is reached. If the value is not foundNone
will be returned. - val resolver: ReferenceResolver
-
def
rewriteTarget(rules: RewriteRules): Document
Returns a new, rewritten document model based on the specified rewrite rules.
-
def
rewriteTarget(rules: RewriteRulesBuilder): Either[DocumentConfigErrors, Document]
Returns a new, rewritten document model based on the specified rewrite rules.
-
lazy val
root: RootCursor
The root cursor for this document tree.
The root cursor for this document tree.
- Definition Classes
- DocumentCursor → Cursor
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
val
target: Document
The target within the document tree this cursor points to (a markup document or a sub-tree).
The target within the document tree this cursor points to (a markup document or a sub-tree).
- Definition Classes
- DocumentCursor → Cursor
- val templatePath: Option[Path]
-
def
validate[L <: Link](link: L): Either[String, L]
Validates the specified link, verifying that the target exists and supports a matching set of target formats.
Validates the specified link, verifying that the target exists and supports a matching set of target formats. The returned link in case of successful validation might be a modified link with enhanced information for the renderer, which might translate internal links to external links for some output formats.
-
def
validate(target: InternalTarget): TargetValidation
Validates the specified link, verifying that the target exists and supports a matching set of target formats.
Validates the specified link, verifying that the target exists and supports a matching set of target formats. The returned ADT provides one of three possible outcomes, apart from a valid or invalid result, a target may also be a
RecoveredTarget
where the link target exists, but does not support all the output formats of the link source. In such a case some link types can switch to an external link, pointing to the location of the hosted html result of this document tree. -
def
validateAndRecover(link: Link, source: SourceFragment): Span
Validates the specified link, verifying that the target exists and supports a matching set of target formats.
Validates the specified link, verifying that the target exists and supports a matching set of target formats. Performs the same checks as the
validate
method, but instead of returning potential errors in an Either it replaces invalid links with instances ofInvalidSpan
. Those types of AST nodes require access to the original source that produced the element which is either obtained from a parser or from a directive combinator. -
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()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
withReferenceContext[T](refValue: T)(implicit arg0: ConfigEncoder[T]): DocumentCursor
Creates a copy of this cursor with a new root object for resolving references.
Creates a copy of this cursor with a new root object for resolving references. This is useful for custom template directives which need to provide a new scope for a nested part inside the directive tags.
Deprecated Value Members
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] ) @Deprecated
- Deprecated