public class ExtensionModelHelper extends Object
ExtensionModels
Contains a cache for searches within the extension models so we avoid processing each extension model twice.
It's recommended that the application only has one instance of this class to avoid processing the extension models several
times.
since 4.0
| Modifier and Type | Class and Description |
|---|---|
static interface |
ExtensionModelHelper.ExtensionWalkerModelDelegate
This interface is used along with an ExtensionWalker.
|
| Constructor and Description |
|---|
ExtensionModelHelper(Set<org.mule.runtime.api.meta.model.ExtensionModel> extensionModels) |
ExtensionModelHelper(Set<org.mule.runtime.api.meta.model.ExtensionModel> extensionModels,
org.mule.runtime.api.dsl.DslResolvingContext dslResolvingCtx) |
| Modifier and Type | Method and Description |
|---|---|
Optional<? extends org.mule.runtime.api.meta.model.ComponentModel> |
findComponentModel(org.mule.runtime.api.component.ComponentIdentifier componentId)
Finds a
ComponentModel within the provided set of ExtensionModels by a
ComponentIdentifier. |
org.mule.runtime.api.component.TypedComponentIdentifier.ComponentType |
findComponentType(org.mule.runtime.api.component.ComponentIdentifier componentIdentifier)
Find a
DslElementModel for a given ComponentModel |
org.mule.runtime.api.component.TypedComponentIdentifier.ComponentType |
findComponentType(org.mule.runtime.api.meta.model.ComponentModel extensionComponentModel) |
Optional<? extends org.mule.runtime.api.meta.model.config.ConfigurationModel> |
findConfigurationModel(org.mule.runtime.api.component.ComponentIdentifier componentId)
Finds a
org.mule.runtime.api.meta.model.ConfigurationModel within the provided set of ExtensionModels by a
ComponentIdentifier. |
Optional<? extends org.mule.runtime.api.meta.model.connection.ConnectionProviderModel> |
findConnectionProviderModel(org.mule.runtime.api.component.ComponentIdentifier componentId)
Finds a
org.mule.runtime.api.meta.model.ConnectionProviderModel within the provided set of ExtensionModels by
a ComponentIdentifier. |
Optional<? extends org.mule.metadata.api.model.MetadataType> |
findMetadataType(Class<?> type) |
Optional<org.mule.runtime.api.meta.model.parameter.ParameterModel> |
findParameterModel(org.mule.runtime.api.component.ComponentIdentifier nestedComponentId,
org.mule.runtime.api.meta.model.parameter.ParameterizedModel model) |
Collection<org.mule.metadata.api.model.ObjectType> |
getAllSubTypes() |
Set<org.mule.runtime.api.meta.model.ExtensionModel> |
getExtensionsModels() |
Collection<org.mule.metadata.api.model.ObjectType> |
getSubTypes(org.mule.metadata.api.model.ObjectType objectType) |
Optional<org.mule.runtime.extension.api.dsl.syntax.DslElementSyntax> |
resolveDslElementModel(org.mule.metadata.api.model.MetadataType metadataType,
org.mule.runtime.api.meta.model.ExtensionModel extensionModel) |
org.mule.runtime.extension.api.dsl.syntax.DslElementSyntax |
resolveDslElementModel(org.mule.runtime.api.meta.NamedObject component,
org.mule.runtime.api.component.ComponentIdentifier componentIdentifier) |
org.mule.runtime.extension.api.dsl.syntax.DslElementSyntax |
resolveDslElementModel(org.mule.runtime.api.meta.model.parameter.ParameterModel parameterModel,
org.mule.runtime.api.component.ComponentIdentifier componentIdentifier) |
Map<org.mule.metadata.api.model.ObjectType,Optional<org.mule.runtime.extension.api.dsl.syntax.DslElementSyntax>> |
resolveSubTypes(org.mule.metadata.api.model.ObjectType type) |
void |
walkToComponent(org.mule.runtime.api.component.ComponentIdentifier componentIdentifier,
ExtensionModelHelper.ExtensionWalkerModelDelegate delegate)
Navigates the extension model for the provided
componentIdentifier and calls the corresponding method on the provided
delegate when found. |
public ExtensionModelHelper(Set<org.mule.runtime.api.meta.model.ExtensionModel> extensionModels)
extensionModels - the set of ExtensionModels to work with. Usually this is the set of models configured within a
mule artifact.public ExtensionModelHelper(Set<org.mule.runtime.api.meta.model.ExtensionModel> extensionModels, org.mule.runtime.api.dsl.DslResolvingContext dslResolvingCtx)
public org.mule.runtime.api.component.TypedComponentIdentifier.ComponentType findComponentType(org.mule.runtime.api.component.ComponentIdentifier componentIdentifier)
DslElementModel for a given ComponentModelcomponentIdentifier - the identifier to use for the search.DslElementModel associated with the configuration or an Optional.empty() if there isn't one.public org.mule.runtime.api.component.TypedComponentIdentifier.ComponentType findComponentType(org.mule.runtime.api.meta.model.ComponentModel extensionComponentModel)
public Optional<? extends org.mule.runtime.api.meta.model.ComponentModel> findComponentModel(org.mule.runtime.api.component.ComponentIdentifier componentId)
ComponentModel within the provided set of ExtensionModels by a
ComponentIdentifier.componentIdentifier - the identifier to use for the search.ComponentModel or Optional.empty() if it couldn't be found.public Optional<? extends org.mule.runtime.api.meta.model.connection.ConnectionProviderModel> findConnectionProviderModel(org.mule.runtime.api.component.ComponentIdentifier componentId)
org.mule.runtime.api.meta.model.ConnectionProviderModel within the provided set of ExtensionModels by
a ComponentIdentifier.componentIdentifier - the identifier to use for the search.org.mule.runtime.api.meta.model.ConnectionProviderModel or Optional.empty() if it couldn't
be found.public Optional<? extends org.mule.runtime.api.meta.model.config.ConfigurationModel> findConfigurationModel(org.mule.runtime.api.component.ComponentIdentifier componentId)
org.mule.runtime.api.meta.model.ConfigurationModel within the provided set of ExtensionModels by a
ComponentIdentifier.componentIdentifier - the identifier to use for the search.org.mule.runtime.api.meta.model.ConfigurationModel or Optional.empty() if it couldn't be
found.public Optional<org.mule.runtime.api.meta.model.parameter.ParameterModel> findParameterModel(org.mule.runtime.api.component.ComponentIdentifier nestedComponentId, org.mule.runtime.api.meta.model.parameter.ParameterizedModel model)
public void walkToComponent(org.mule.runtime.api.component.ComponentIdentifier componentIdentifier,
ExtensionModelHelper.ExtensionWalkerModelDelegate delegate)
componentIdentifier and calls the corresponding method on the provided
delegate when found.componentIdentifier - the identifier to use for the search.delegate - the callback to execute on the found model.public Optional<? extends org.mule.metadata.api.model.MetadataType> findMetadataType(Class<?> type)
public org.mule.runtime.extension.api.dsl.syntax.DslElementSyntax resolveDslElementModel(org.mule.runtime.api.meta.NamedObject component,
org.mule.runtime.api.component.ComponentIdentifier componentIdentifier)
public Optional<org.mule.runtime.extension.api.dsl.syntax.DslElementSyntax> resolveDslElementModel(org.mule.metadata.api.model.MetadataType metadataType, org.mule.runtime.api.meta.model.ExtensionModel extensionModel)
public org.mule.runtime.extension.api.dsl.syntax.DslElementSyntax resolveDslElementModel(org.mule.runtime.api.meta.model.parameter.ParameterModel parameterModel,
org.mule.runtime.api.component.ComponentIdentifier componentIdentifier)
public Map<org.mule.metadata.api.model.ObjectType,Optional<org.mule.runtime.extension.api.dsl.syntax.DslElementSyntax>> resolveSubTypes(org.mule.metadata.api.model.ObjectType type)
public Collection<org.mule.metadata.api.model.ObjectType> getAllSubTypes()
public Collection<org.mule.metadata.api.model.ObjectType> getSubTypes(org.mule.metadata.api.model.ObjectType objectType)
public Set<org.mule.runtime.api.meta.model.ExtensionModel> getExtensionsModels()
Copyright © 2003–2020 MuleSoft, Inc.. All rights reserved.