Class UsedDefinitionModelWalker


public class UsedDefinitionModelWalker extends DefinitionCollectingModelWalker
This model walker can be used to gather metaschema definitions that are defined globally.
  • Constructor Details

    • UsedDefinitionModelWalker

      protected UsedDefinitionModelWalker()
      Construct a new walker.
  • Method Details

    • collectUsedDefinitions

      @NonNull public static Collection<? extends IDefinition> collectUsedDefinitions(Collection<? extends IAssemblyDefinition> definitions)
      Get the collection of all definitions used directly and transitively by the provided definitions.
      Parameters:
      definitions - a collection of definitions to generate used definitions from
      Returns:
      the collection of used definitions
    • collectUsedDefinitionsFromModule

      @NonNull public static Collection<? extends IDefinition> collectUsedDefinitionsFromModule(@NonNull Collection<? extends IModule> modules)
      Collect the globally defined Metaschema definitions from the provided Metaschema modules, and any Metaschema modules imported directly or indirectly by these modules.
      Parameters:
      modules - the Metaschema modules to analyze
      Returns:
      a collection of matching definitions
    • collectUsedDefinitionsFromModule

      @NonNull public static Collection<? extends IDefinition> collectUsedDefinitionsFromModule(@NonNull IModule module)
      Collect the globally defined Metaschema definitions from the provided Metaschema module, and any Metaschema modules imported directly or indirectly by this module.
      Parameters:
      module - the metaschema module to analyze
      Returns:
      a collection of matching definitions