java.lang.Object
dev.metaschema.core.model.ModelWalker<Void>
dev.metaschema.core.model.DefinitionCollectingModelWalker
- Direct Known Subclasses:
UsedDefinitionModelWalker
Supports walking a portion of a metaschema model collecting a set of
definitions that match the provided filter. For a definition to be collected,
the filter must return
true.-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstruct a new walker using the provided filter. -
Method Summary
Modifier and TypeMethodDescriptionprotected VoidGenerate default state information.Collection<? extends IDefinition>Return the collection of definitions matching the configured filter.protected Function<IDefinition,Boolean> Retrieves the filter used for matching.protected booleanvisit(IAssemblyDefinition def, Void data) Called when the provided definition is walked.protected booleanvisit(IFieldDefinition def, Void data) Called when the provided definition is walked.protected voidvisit(IFlagDefinition def, Void data) Called when the provided definition is walked.Methods inherited from class dev.metaschema.core.model.ModelWalker
visit, visit, visit, visit, visit, visitDefinition, walk, walk, walk, walk, walk, walk, walk, walk, walk, walk, walk, walkDefinition, walkDefinition, walkFlagInstances, walkModelInstance, walkModelInstances
-
Constructor Details
-
DefinitionCollectingModelWalker
Construct a new walker using the provided filter.- Parameters:
filter- the filter to match definitions against
-
-
Method Details
-
getDefaultData
Description copied from class:ModelWalkerGenerate default state information.- Specified by:
getDefaultDatain classModelWalker<Void>- Returns:
- the state information
-
getFilter
Retrieves the filter used for matching.- Returns:
- the filter
-
getDefinitions
Return the collection of definitions matching the configured filter.- Returns:
- the collection of definitions
-
visit
Description copied from class:ModelWalkerCalled when the provided definition is walked. This can be overridden by child classes to enable processing of the visited definition.- Specified by:
visitin classModelWalker<Void>- Parameters:
def- the definition that is visiteddata- additional state information to operate on
-
visit
Description copied from class:ModelWalkerCalled when the provided definition is walked. This can be overridden by child classes to enable processing of the visited definition.- Overrides:
visitin classModelWalker<Void>- Parameters:
def- the definition that is visiteddata- additional state information to operate on- Returns:
trueif child instances are to be walked, orfalseotherwise
-
visit
Description copied from class:ModelWalkerCalled when the provided definition is walked. This can be overridden by child classes to enable processing of the visited definition.- Overrides:
visitin classModelWalker<Void>- Parameters:
def- the definition that is visiteddata- additional state information to operate on- Returns:
trueif child instances are to be walked, orfalseotherwise
-