Interface IGenerationState<WRITER>

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 Type
    Method
    Description
    void
    Flush any buffered content to the underlying writer.
    dev.metaschema.core.model.IModule
    Get 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.
    boolean
    isInline(dev.metaschema.core.model.IDefinition definition)
    Determine if the provided definition should be inlined in the generated schema.
    Convert a text string to camel case by splitting on punctuation and capitalizing each segment.
  • Method Details

    • getModule

      @NonNull dev.metaschema.core.model.IModule getModule()
      Get the Metaschema module being processed for schema generation.
      Returns:
      the module
    • getWriter

      @NonNull WRITER 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

      boolean isInline(@NonNull dev.metaschema.core.model.IDefinition definition)
      Determine if the provided definition should be inlined in the generated schema.
      Parameters:
      definition - the definition to check
      Returns:
      true if the definition should be inlined, false otherwise
    • flushWriter

      void flushWriter() throws IOException
      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 for
      suffix - an optional suffix to append to the type name, or null if no suffix is needed
      Returns:
      the generated type name
    • toCamelCase

      @NonNull static CharSequence toCamelCase(String text)
      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