java.lang.Object
dev.metaschema.core.model.ModelWalker<DATA>
- Type Parameters:
DATA- state information that is carried through the walk
- Direct Known Subclasses:
DefinitionCollectingModelWalker
Walks a Metaschema model. The "visit" methods can be implemented by child
classes to perform processing on a visited node.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract DATAGenerate default state information.protected booleanvisit(IAssemblyDefinition def, DATA data) Called when the provided definition is walked.protected booleanvisit(IAssemblyInstance instance, DATA data) Called when the provided instance is walked.protected booleanvisit(IChoiceGroupInstance instance, DATA data) Called when the provided instance is walked.protected booleanvisit(IChoiceInstance instance, DATA data) Called when the provided instance is walked.protected booleanvisit(IFieldDefinition def, DATA data) Called when the provided definition is walked.protected booleanvisit(IFieldInstance instance, DATA data) Called when the provided instance is walked.protected abstract voidvisit(IFlagDefinition def, DATA data) Called when the provided definition is walked.protected booleanvisit(IFlagInstance instance, DATA data) Called when the provided instance is walked.protected voidvisitDefinition(IDefinition definition, DATA data) Will visit the provided model definition.voidwalk(IAssemblyDefinition assembly) Will visit the provided Metaschema module assembly definition, and then walk the associated flag and model instances.voidwalk(IAssemblyDefinition assembly, DATA data) Will visit the provided Metaschema module assembly definition, and then walk the associated flag and model instances.voidwalk(IAssemblyInstance instance, DATA data) Will visit the provided Metaschema module assembly instance, and then walk the associated assembly definition.voidwalk(IChoiceGroupInstance instance, DATA data) Will visit the provided Metaschema module choice group instance, and then walk the choice's child model instances.voidwalk(IChoiceInstance instance, DATA data) Will visit the provided Metaschema module choice instance, and then walk the choice's child model instances.voidwalk(IFieldDefinition field) Will visit the provided Metaschema module field definition, and then walk the associated flag instances.voidwalk(IFieldDefinition field, DATA data) Will visit the provided Metaschema module field definition, and then walk the associated flag instances.voidwalk(IFieldInstance instance, DATA data) Will visit the provided Metaschema module field instance, and then walk the associated field definition.voidwalk(IFlagDefinition flag) Will visit the provided Metaschema module flag definition.voidwalk(IFlagDefinition flag, DATA data) Will visit the provided Metaschema module flag definition.voidwalk(IFlagInstance instance, DATA data) Will visit the provided Metaschema module flag instance, and then walk the associated flag definition.voidwalkDefinition(IDefinition definition) Will walk the provided model definition.voidwalkDefinition(IDefinition definition, DATA data) Will walk the provided model definition.protected voidwalkFlagInstances(Collection<? extends IFlagInstance> instances, DATA data) Will walk each of the provided flag instances.protected voidwalkModelInstance(IModelInstance instance, DATA data) Will walk the provided model instance.protected voidwalkModelInstances(Collection<? extends IModelInstance> instances, DATA data) Will walk each of the provided model instances.
-
Constructor Details
-
ModelWalker
public ModelWalker()
-
-
Method Details
-
getDefaultData
Generate default state information.- Returns:
- the state information
-
walk
Will visit the provided Metaschema module flag definition.- Parameters:
flag- the Metaschema module flag definition to walk
-
walk
Will visit the provided Metaschema module flag definition.- Parameters:
flag- the Metaschema module flag definition to walkdata- additional state information to operate on
-
walk
Will visit the provided Metaschema module field definition, and then walk the associated flag instances.- Parameters:
field- the Metaschema module field definition to walk
-
walk
Will visit the provided Metaschema module field definition, and then walk the associated flag instances.- Parameters:
field- the Metaschema module field definition to walkdata- additional state information to operate on
-
walk
Will visit the provided Metaschema module assembly definition, and then walk the associated flag and model instances.- Parameters:
assembly- the Metaschema module assembly definition to walk
-
walk
Will visit the provided Metaschema module assembly definition, and then walk the associated flag and model instances.- Parameters:
assembly- the Metaschema module assembly definition to walkdata- additional state information to operate on
-
walk
Will visit the provided Metaschema module flag instance, and then walk the associated flag definition.- Parameters:
instance- the Metaschema module flag instance to walkdata- additional state information to operate on
-
walk
Will visit the provided Metaschema module field instance, and then walk the associated field definition.- Parameters:
instance- the Metaschema module field instance to walkdata- additional state information to operate on
-
walk
Will visit the provided Metaschema module assembly instance, and then walk the associated assembly definition.- Parameters:
instance- the Metaschema module assembly instance to walkdata- additional state information to operate on
-
walk
Will visit the provided Metaschema module choice instance, and then walk the choice's child model instances.- Parameters:
instance- the Metaschema module choice instance to walkdata- additional state information to operate on
-
walk
Will visit the provided Metaschema module choice group instance, and then walk the choice's child model instances.- Parameters:
instance- the Metaschema module choice instance to walkdata- additional state information to operate on
-
walkDefinition
Will walk the provided model definition.- Parameters:
definition- the definition to walk
-
walkDefinition
Will walk the provided model definition.- Parameters:
definition- the definition to walkdata- additional state information to operate on
-
walkFlagInstances
Will walk each of the provided flag instances.- Parameters:
instances- a collection of flag instances to visitdata- additional state information to operate on
-
walkModelInstances
protected void walkModelInstances(@NonNull Collection<? extends IModelInstance> instances, DATA data) Will walk each of the provided model instances.- Parameters:
instances- a collection of model instances to visitdata- additional state information to operate on
-
walkModelInstance
Will walk the provided model instance.- Parameters:
instance- the instance to walkdata- additional state information to operate on
-
visitDefinition
Will visit the provided model definition.- Parameters:
definition- the definition to visitdata- additional state information to operate on
-
visit
Called when the provided definition is walked. This can be overridden by child classes to enable processing of the visited definition.- Parameters:
def- the definition that is visiteddata- additional state information to operate on
-
visit
Called when the provided definition is walked. This can be overridden by child classes to enable processing of the visited definition.- Parameters:
def- the definition that is visiteddata- additional state information to operate on- Returns:
trueif child instances are to be walked, orfalseotherwise
-
visit
Called when the provided definition is walked. This can be overridden by child classes to enable processing of the visited definition.- Parameters:
def- the definition that is visiteddata- additional state information to operate on- Returns:
trueif child instances are to be walked, orfalseotherwise
-
visit
Called when the provided instance is walked. This can be overridden by child classes to enable processing of the visited instance.- Parameters:
instance- the instance that is visiteddata- additional state information to operate on- Returns:
trueif the associated definition is to be walked, orfalseotherwise
-
visit
Called when the provided instance is walked. This can be overridden by child classes to enable processing of the visited instance.- Parameters:
instance- the instance that is visiteddata- additional state information to operate on- Returns:
trueif the associated definition is to be walked, orfalseotherwise
-
visit
Called when the provided instance is walked. This can be overridden by child classes to enable processing of the visited instance.- Parameters:
instance- the instance that is visiteddata- additional state information to operate on- Returns:
trueif the associated definition is to be walked, orfalseotherwise
-
visit
Called when the provided instance is walked. This can be overridden by child classes to enable processing of the visited instance.- Parameters:
instance- the instance that is visiteddata- additional state information to operate on- Returns:
trueif the child instances are to be walked, orfalseotherwise
-
visit
Called when the provided instance is walked. This can be overridden by child classes to enable processing of the visited instance.- Parameters:
instance- the instance that is visiteddata- additional state information to operate on- Returns:
trueif the child instances are to be walked, orfalseotherwise
-