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 |
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 |
onRouter(HasOperationModels owner,
RouterModel model)
Invoked when a
RouterModel is found in the
traversed extensionModel. |
protected void |
onScope(HasOperationModels owner,
ScopeModel model)
Invoked when a
ScopeModel 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 extensionModelmodel - a ConfigurationModelprotected void onOperation(HasOperationModels owner, OperationModel model)
OperationModel is found in the
traversed extensionModel.
This method is also invoked when a ScopeModel or a
RouterModel are found, if and only if the
onScope(HasOperationModels, ScopeModel)
or onRouter(HasOperationModels, RouterModel)
methods were not overridden respectively.
owner - The component that owns the operationmodel - the OperationModelprotected void onScope(HasOperationModels owner, ScopeModel model)
ScopeModel is found in the
traversed extensionModel.
By default, this method simply delegates on onOperation(HasOperationModels, OperationModel)
owner - The component that owns the operationmodel - the OperationModelprotected void onRouter(HasOperationModels owner, RouterModel model)
RouterModel is found in the
traversed extensionModel.
By default, this method simply delegates on onOperation(HasOperationModels, OperationModel)
owner - The component that owns the operationmodel - the OperationModelprotected void onConnectionProvider(HasConnectionProviderModels owner, ConnectionProviderModel model)
ConnectionProviderModel is found in the
traversed extensionModelowner - The component that owns the providermodel - the ConnectionProviderModelprotected void onSource(HasSourceModels owner, SourceModel model)
SourceModel is found in the
traversed extensionModelowner - The component that owns the sourcemodel - the SourceModelprotected void onParameterGroup(ParameterizedModel owner, ParameterGroupModel model)
ParameterGroupModel is found in the
traversed extensionModelowner - The component that owns the sourcemodel - the ParameterGroupModelprotected void onParameter(ParameterizedModel owner, ParameterGroupModel groupModel, ParameterModel model)
ParameterModel is found in the
traversed extensionModelowner - The component that owns the parametergroupModel - the ParameterGroupModel in which the model is containedmodel - the ParameterModelCopyright © 2017 MuleSoft, Inc.. All rights reserved.