public abstract class ExtensionWalker extends Object
ExtensionModel
and invokes methods when important
model components are found.
This is useful to centralize the logic of how to iterate through a
model's structure without coupling to it. For example, the
onOperation(HasOperationModels, OperationModel)
method allows
handling operations without requiring to know that they can exist
at global or configuration level. Something similar can be said
about the onParameter(ParameterizedModel, ParameterGroupModel, ParameterModel)
,
etc.
Constructor and Description |
---|
ExtensionWalker() |
Modifier and Type | Method and Description |
---|---|
protected void |
onConfiguration(ConfigurationModel model)
Invoked when a
ConfigurationModel is found in the
traversed extensionModel |
protected void |
onConnectionProvider(HasConnectionProviderModels owner,
ConnectionProviderModel model)
Invoked when an
ConnectionProviderModel is found in the
traversed extensionModel |
protected void |
onConstruct(HasConstructModels owner,
ConstructModel model)
Invoked when an
ConstructModel is found in the
traversed extensionModel |
protected void |
onFunction(HasFunctionModels owner,
FunctionModel model)
Invoked when an
FunctionModel is found in the
traversed extensionModel . |
protected void |
onOperation(HasOperationModels owner,
OperationModel model)
Invoked when an
OperationModel is found in the
traversed extensionModel . |
protected void |
onParameter(ParameterizedModel owner,
ParameterGroupModel groupModel,
ParameterModel model)
Invoked when an
ParameterModel is found in the
traversed extensionModel |
protected void |
onParameterGroup(ParameterizedModel owner,
ParameterGroupModel model)
Invoked when an
ParameterGroupModel is found in the
traversed extensionModel |
protected void |
onSource(HasSourceModels owner,
SourceModel model)
Invoked when an
SourceModel is found in the
traversed extensionModel |
protected void |
stop()
When invoked, the traversal of the
ExtensionModel will
stop once the current visit is completed. |
void |
walk(ExtensionModel extensionModel)
Navigates the given
extensionModel and invokes the
other public method's in this class as the navigation
progresses |
public final void walk(ExtensionModel extensionModel)
extensionModel
and invokes the
other public method's in this class as the navigation
progressesextensionModel
- the model to navigateprotected final void stop()
ExtensionModel
will
stop once the current visit is completed.
This will not break the execution within the invoking method,
but instead avoid further traversal of the model from that point on.protected void onConfiguration(ConfigurationModel model)
ConfigurationModel
is found in the
traversed extensionModel
model
- a ConfigurationModel
protected void onOperation(HasOperationModels owner, OperationModel model)
OperationModel
is found in the
traversed extensionModel
.
owner
- The component that owns the operationmodel
- the OperationModel
protected void onFunction(HasFunctionModels owner, FunctionModel model)
FunctionModel
is found in the
traversed extensionModel
.
owner
- The component that owns the functionmodel
- the FunctionModel
protected void onConstruct(HasConstructModels owner, ConstructModel model)
ConstructModel
is found in the
traversed extensionModel
owner
- The component that owns the sourcemodel
- the ConstructModel
protected void onConnectionProvider(HasConnectionProviderModels owner, ConnectionProviderModel model)
ConnectionProviderModel
is found in the
traversed extensionModel
owner
- The component that owns the providermodel
- the ConnectionProviderModel
protected void onSource(HasSourceModels owner, SourceModel model)
SourceModel
is found in the
traversed extensionModel
owner
- The component that owns the sourcemodel
- the SourceModel
protected void onParameterGroup(ParameterizedModel owner, ParameterGroupModel model)
ParameterGroupModel
is found in the
traversed extensionModel
owner
- The component that owns the sourcemodel
- the ParameterGroupModel
protected void onParameter(ParameterizedModel owner, ParameterGroupModel groupModel, ParameterModel model)
ParameterModel
is found in the
traversed extensionModel
owner
- The component that owns the parametergroupModel
- the ParameterGroupModel
in which the model
is containedmodel
- the ParameterModel
Copyright © 2018. All rights reserved.