Class ConfigReferenceDependencyScanner
java.lang.Object
tech.guilhermekaua.spigotboot.config.reference.ConfigReferenceDependencyScanner
Scans config nodes for references and builds a dependency graph.
This scanner walks the tree of a config node and finds all ${...}
reference patterns, then adds them as edges in the dependency graph.
-
Constructor Summary
ConstructorsConstructorDescriptionConfigReferenceDependencyScanner(@NotNull ConfigReferenceParser parser) Creates a new scanner. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull ConfigReferenceDependencyScannercreate()Creates a scanner with the default parser.voidscanAndAddToGraph(@NotNull ReferenceKey sourceKey, @NotNull ConfigNode node, @NotNull DependencyGraph<ReferenceKey> graph) Scans a config node and adds edges to the graph.@NotNull Set<ReferenceKey>scanDependencies(@NotNull ConfigNode node) Scans a config node for references and returns the set of dependencies.
-
Constructor Details
-
ConfigReferenceDependencyScanner
Creates a new scanner.- Parameters:
parser- the reference parser
-
-
Method Details
-
create
Creates a scanner with the default parser.- Returns:
- a new scanner
-
scanDependencies
Scans a config node for references and returns the set of dependencies.- Parameters:
node- the node to scan- Returns:
- set of reference keys that this node depends on
-
scanAndAddToGraph
public void scanAndAddToGraph(@NotNull @NotNull ReferenceKey sourceKey, @NotNull @NotNull ConfigNode node, @NotNull @NotNull DependencyGraph<ReferenceKey> graph) Scans a config node and adds edges to the graph.- Parameters:
sourceKey- the key of the config being scannednode- the node to scangraph- the graph to add edges to
-