- Type Parameters:
WRITER- the type of writer used for schema output
- All Known Implementing Classes:
AbstractGenerationState
public interface IGenerationState<WRITER>
Represents the state information used during schema generation.
-
Method Summary
Modifier and TypeMethodDescriptionvoidFlush any buffered content to the underlying writer.dev.metaschema.core.model.IModuleGet the Metaschema module being processed for schema generation.default Collection<? extends dev.metaschema.core.model.IAssemblyDefinition>Get the collection of root assembly definitions exported by the module.getTypeNameForDefinition(dev.metaschema.core.model.IDefinition definition, String suffix) Generate a type name for the provided definition with an optional suffix.Get the writer used for schema output.booleanisInline(dev.metaschema.core.model.IDefinition definition) Determine if the provided definition should be inlined in the generated schema.static CharSequencetoCamelCase(String text) Convert a text string to camel case by splitting on punctuation and capitalizing each segment.
-
Method Details
-
getModule
Get the Metaschema module being processed for schema generation.- Returns:
- the module
-
getWriter
Get the writer used for schema output.The caller does not own this writer and must not close it.
- Returns:
- the writer instance
-
getRootDefinitions
@NonNull default Collection<? extends dev.metaschema.core.model.IAssemblyDefinition> getRootDefinitions()Get the collection of root assembly definitions exported by the module.- Returns:
- the root assembly definitions
-
isInline
Determine if the provided definition should be inlined in the generated schema.- Parameters:
definition- the definition to check- Returns:
trueif the definition should be inlined,falseotherwise
-
flushWriter
Flush any buffered content to the underlying writer.- Throws:
IOException- if an I/O error occurs while flushing
-
getTypeNameForDefinition
@NonNull String getTypeNameForDefinition(@NonNull dev.metaschema.core.model.IDefinition definition, @Nullable String suffix) Generate a type name for the provided definition with an optional suffix.- Parameters:
definition- the definition to generate a type name forsuffix- an optional suffix to append to the type name, ornullif no suffix is needed- Returns:
- the generated type name
-
toCamelCase
Convert a text string to camel case by splitting on punctuation and capitalizing each segment.- Parameters:
text- the text to convert- Returns:
- the camel case representation of the text
-