Class TextSource

Namespace: redb.Route.Core
Assembly: redb.Route.dll

Where a piece of configuration text comes from — a Scriban template, a JSONata specification, a
schema: a file (relative to a base directory), an embedded resource, or inline text. Shared by the
packages that consume such text so they follow one rule: a plain string in the DSL is always
a locator ("Templates/order.json.sbn" or "assembly:Acme.Orders/Templates/order.json.sbn");
inline text must be marked with . A string never has to be guessed as
"path or text" — the rule the route expression language follows too.

public abstract class TextSource

Inheritance

Object→TextSource

Properties

CacheKey

Stable identity of the source as written: two sources with the same key name the same thing.

public abstract string CacheKey { get; }

FilePath

The file path this source was written with, or null when the text does not come from a

public virtual string? FilePath { get; }

Name

Human-readable name used in error messages (file path, resource locator, or <inline>).

public abstract string Name { get; }

Methods

Embedded(Assembly, string)

An embedded resource of assembly; resourcePath may use / or . separators and may omit the assembly-name prefix.

public static TextSource Embedded(Assembly assembly, string resourcePath)

File(string)

A file; a relative path is resolved against the base directory the consuming package is configured with.

public static TextSource File(string path)

FromLocator(string)

Parses a DSL / XML locator: assembly:Name/path → embedded resource, anything else → file path.

public static TextSource FromLocator(string locator)

Inline(string)

Inline text.

public static TextSource Inline(string text)

Read(string)

Reads the text. A relative file path is resolved against baseDirectory.

public abstract string Read(string baseDirectory)

ResolveCacheKey(string)

Identity for compile caches once the base directory is known. A file is keyed by its resolved

public virtual string ResolveCacheKey(string baseDirectory)

ToString()

Returns a string that represents the current object.

public override string ToString()