java.lang.Object
dev.metaschema.schemagen.ModuleIndex
Indexes definitions from a Metaschema module for use in schema generation.
This class maintains an ordered index of all definitions that are reachable from root assembly definitions, tracking their reference counts, inline status, and other usage patterns relevant to schema generation.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents an entry in the module index for a single definition. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRetrieves all definition entries in this index.getEntry(IDefinition definition) Retrieves or creates the entry for the specified definition.booleanhasEntry(IDefinition definition) Checks if an entry exists in this index for the specified definition.static ModuleIndexindexDefinitions(IModule module, IInlineStrategy inlineStrategy) Creates an index of all definitions reachable from the module's root assembly definitions.
-
Constructor Details
-
ModuleIndex
public ModuleIndex()
-
-
Method Details
-
indexDefinitions
@NonNull public static ModuleIndex indexDefinitions(@NonNull IModule module, @NonNull IInlineStrategy inlineStrategy) Creates an index of all definitions reachable from the module's root assembly definitions.- Parameters:
module- the Metaschema module to indexinlineStrategy- the strategy for determining which definitions should be inlined- Returns:
- a new module index containing entries for all reachable definitions
-
hasEntry
Checks if an entry exists in this index for the specified definition.- Parameters:
definition- the definition to check- Returns:
trueif an entry exists for the definition,falseotherwise
-
getEntry
Retrieves or creates the entry for the specified definition.If no entry exists for the definition, a new entry is created and added to the index.
- Parameters:
definition- the definition to get an entry for- Returns:
- the existing or newly created entry for the definition
-
getDefinitions
Retrieves all definition entries in this index.- Returns:
- an unmodifiable collection of all definition entries, in insertion order
-