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.
|
| Modifier and Type | Field and Description |
|---|---|
static org.mule.runtime.api.component.ComponentIdentifier |
ON_ERROR_CONTINUE_IDENTIFIER |
static org.mule.runtime.api.component.ComponentIdentifier |
ON_ERROR_PROPAGATE_IDENTIFIER |
| 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<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
TypedComponentIdentifier.ComponentType for a given ComponentModel |
org.mule.runtime.api.component.TypedComponentIdentifier.ComponentType |
findComponentType(org.mule.runtime.api.meta.model.ComponentModel extensionComponentModel) |
Optional<org.mule.runtime.api.meta.model.config.ConfigurationModel> |
findConfigurationModel(org.mule.runtime.api.component.ComponentIdentifier componentId)
Finds a
ConfigurationModel within the provided set of ExtensionModels by a ComponentIdentifier. |
Optional<org.mule.runtime.api.meta.model.connection.ConnectionProviderModel> |
findConnectionProviderModel(org.mule.runtime.api.component.ComponentIdentifier componentId)
Finds a
ConnectionProviderModel within the provided set of ExtensionModels by a ComponentIdentifier. |
Optional<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) |
Set<org.mule.runtime.api.meta.model.ExtensionModel> |
getExtensionsModels() |
org.mule.runtime.api.meta.type.TypeCatalog |
getTypeCatalog() |
Optional<org.mule.runtime.api.meta.model.ExtensionModel> |
lookupExtensionModelFor(org.mule.runtime.api.component.ComponentIdentifier componentIdentifier) |
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) |
Optional<org.mule.runtime.extension.api.dsl.syntax.DslElementSyntax> |
resolveDslElementModel(org.mule.metadata.api.model.MetadataType type,
String namespacePrefix) |
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)
Note: Only instantiable subtypes will be returned by this method!
|
void |
walkToComponent(org.mule.runtime.api.component.ComponentIdentifier componentIdentifier,
Optional<org.mule.runtime.api.component.ComponentIdentifier> parentIdentifier,
ExtensionModelHelper.ExtensionWalkerModelDelegate delegate,
org.mule.runtime.api.meta.model.ExtensionModel currentExtension)
Navigates the extension model for the provided
componentIdentifier and calls the corresponding method on the provided
delegate when found. |
public static final org.mule.runtime.api.component.ComponentIdentifier ON_ERROR_CONTINUE_IDENTIFIER
public static final org.mule.runtime.api.component.ComponentIdentifier ON_ERROR_PROPAGATE_IDENTIFIER
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)
TypedComponentIdentifier.ComponentType for a given ComponentModelcomponentIdentifier - the identifier to use for the search.TypedComponentIdentifier.ComponentType 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<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.componentId - the identifier to use for the search.ComponentModel or Optional.empty() if it couldn't be found.public Optional<org.mule.runtime.api.meta.model.connection.ConnectionProviderModel> findConnectionProviderModel(org.mule.runtime.api.component.ComponentIdentifier componentId)
ConnectionProviderModel within the provided set of ExtensionModels by a ComponentIdentifier.componentId - the identifier to use for the search.ConnectionProviderModel or Optional.empty() if it couldn'tbe found.public Optional<org.mule.runtime.api.meta.model.config.ConfigurationModel> findConfigurationModel(org.mule.runtime.api.component.ComponentIdentifier componentId)
ConfigurationModel within the provided set of ExtensionModels by a ComponentIdentifier.componentId - the identifier to use for the search.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,
Optional<org.mule.runtime.api.component.ComponentIdentifier> parentIdentifier,
ExtensionModelHelper.ExtensionWalkerModelDelegate delegate,
org.mule.runtime.api.meta.model.ExtensionModel currentExtension)
componentIdentifier and calls the corresponding method on the provided
delegate when found.componentIdentifier - the identifier to use for the search.parentIdentifier - the identifier of the element's parent. It's an empty optional if top-level.delegate - the callback to execute on the found model.currentExtension - the extension that declares the component with the given componentIdentifier.public Optional<org.mule.metadata.api.model.MetadataType> findMetadataType(Class<?> type)
public Optional<org.mule.runtime.api.meta.model.ExtensionModel> lookupExtensionModelFor(org.mule.runtime.api.component.ComponentIdentifier componentIdentifier)
public Optional<org.mule.runtime.extension.api.dsl.syntax.DslElementSyntax> resolveDslElementModel(org.mule.metadata.api.model.MetadataType type, String namespacePrefix)
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)
type - the type to resolve subtypes forDslElementSyntax, if available.public org.mule.runtime.api.meta.type.TypeCatalog getTypeCatalog()
public Set<org.mule.runtime.api.meta.model.ExtensionModel> getExtensionsModels()
Copyright © 2022 MuleSoft, Inc.. All rights reserved.