Class DefaultExtensionModelHelper
java.lang.Object
org.mule.runtime.ast.internal.model.DefaultExtensionModelHelper
- All Implemented Interfaces:
ExtensionModelHelper
Default implementation of
ExtensionModelHelper.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.mule.runtime.ast.api.model.ExtensionModelHelper
ExtensionModelHelper.ExtensionWalkerModelDelegate -
Constructor Summary
ConstructorsConstructorDescriptionDefaultExtensionModelHelper(Set<org.mule.runtime.api.meta.model.ExtensionModel> extensionModels) DefaultExtensionModelHelper(Set<org.mule.runtime.api.meta.model.ExtensionModel> extensionModels, org.mule.runtime.api.dsl.DslResolvingContext dslResolvingCtx) -
Method Summary
Modifier and TypeMethodDescriptionOptional<org.mule.runtime.api.meta.model.ComponentModel>findComponentModel(org.mule.runtime.api.component.ComponentIdentifier componentId) Finds aComponentModelwithin the provided set ofExtensionModels by aComponentIdentifier.org.mule.runtime.api.component.TypedComponentIdentifier.ComponentTypefindComponentType(org.mule.runtime.api.component.ComponentIdentifier componentIdentifier) Find aTypedComponentIdentifier.ComponentTypefor a givenComponentIdentifierorg.mule.runtime.api.component.TypedComponentIdentifier.ComponentTypefindComponentType(org.mule.runtime.api.meta.model.ComponentModel extensionComponentModel) Find aTypedComponentIdentifier.ComponentTypefor a givenComponentModelOptional<org.mule.runtime.api.meta.model.config.ConfigurationModel>findConfigurationModel(org.mule.runtime.api.component.ComponentIdentifier componentId) Finds aConfigurationModelwithin the provided set ofExtensionModels by aComponentIdentifier.Optional<org.mule.runtime.api.meta.model.connection.ConnectionProviderModel>findConnectionProviderModel(org.mule.runtime.api.component.ComponentIdentifier componentId) Finds aConnectionProviderModelwithin the provided set ofExtensionModels by aComponentIdentifier.Optional<org.mule.metadata.api.model.MetadataType>findMetadataType(Class<?> type) find aMetadataTypefor a given JavaClass.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) org.mule.runtime.extension.api.dsl.syntax.resolver.DslSyntaxResolvergetDslSyntaxResolverFor(org.mule.runtime.api.meta.model.ExtensionModel extensionModel) find the DslSyntaxResolver for the givenextensionModel.org.mule.runtime.api.meta.type.TypeCatalogReturns aTypeCatalogcontaining all theObjectTypes available in the current resolving context.Optional<org.mule.runtime.api.meta.model.ExtensionModel>lookupExtensionModelFor(org.mule.runtime.api.component.ComponentIdentifier componentIdentifier) Find aExtensionModelfor a givenComponentIdentifierOptional<org.mule.runtime.extension.api.dsl.syntax.DslElementSyntax>resolveDslElementModel(org.mule.metadata.api.model.MetadataType type, String namespacePrefix) Find aDslElementSyntaxfor a givenMetadataTypewithin theExtensionModelfor the provided namespace prefix.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) Find aDslElementSyntaxfor a givenMetadataTypewithin the providedExtensionModel.org.mule.runtime.extension.api.dsl.syntax.DslElementSyntaxresolveDslElementModel(org.mule.runtime.api.meta.model.parameter.ParameterModel parameterModel, org.mule.runtime.api.component.ComponentIdentifier componentIdentifier) Find aDslElementSyntaxfor a givenParameterModelwith the providedComponentIdentifier.org.mule.runtime.extension.api.dsl.syntax.DslElementSyntaxresolveDslElementModel(org.mule.runtime.api.meta.NamedObject component, org.mule.runtime.api.component.ComponentIdentifier componentIdentifier) Find aDslElementSyntaxfor a givenNamedObjectwith the providedComponentIdentifier.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!voidwalkToComponent(org.mule.runtime.api.component.ComponentIdentifier componentIdentifier, Optional<ComponentAstBuilder> parent, ExtensionModelHelper.ExtensionWalkerModelDelegate delegate, org.mule.runtime.api.meta.model.ExtensionModel currentExtension) Navigates the extension model for the providedcomponentIdentifierand calls the corresponding method on the provideddelegatewhen found.
-
Constructor Details
-
DefaultExtensionModelHelper
public DefaultExtensionModelHelper(Set<org.mule.runtime.api.meta.model.ExtensionModel> extensionModels) - Parameters:
extensionModels- the set ofExtensionModels to work with. Usually this is the set of models configured within a mule artifact.
-
DefaultExtensionModelHelper
public DefaultExtensionModelHelper(Set<org.mule.runtime.api.meta.model.ExtensionModel> extensionModels, org.mule.runtime.api.dsl.DslResolvingContext dslResolvingCtx)
-
-
Method Details
-
findComponentType
public org.mule.runtime.api.component.TypedComponentIdentifier.ComponentType findComponentType(org.mule.runtime.api.component.ComponentIdentifier componentIdentifier) Description copied from interface:ExtensionModelHelperFind aTypedComponentIdentifier.ComponentTypefor a givenComponentIdentifier- Specified by:
findComponentTypein interfaceExtensionModelHelper- Parameters:
componentIdentifier- the identifier to use for the search.- Returns:
- the
TypedComponentIdentifier.ComponentTypeassociated with the configuration or anOptional.empty()if there isn't one.
-
findComponentType
public org.mule.runtime.api.component.TypedComponentIdentifier.ComponentType findComponentType(org.mule.runtime.api.meta.model.ComponentModel extensionComponentModel) Description copied from interface:ExtensionModelHelperFind aTypedComponentIdentifier.ComponentTypefor a givenComponentModel- Specified by:
findComponentTypein interfaceExtensionModelHelper- Parameters:
extensionComponentModel- the mode to use for the search.- Returns:
- the
TypedComponentIdentifier.ComponentTypeassociated with the configuration or anOptional.empty()if there isn't one.
-
findComponentModel
public Optional<org.mule.runtime.api.meta.model.ComponentModel> findComponentModel(org.mule.runtime.api.component.ComponentIdentifier componentId) Description copied from interface:ExtensionModelHelperFinds aComponentModelwithin the provided set ofExtensionModels by aComponentIdentifier.- Specified by:
findComponentModelin interfaceExtensionModelHelper- Parameters:
componentId- the identifier to use for the search.- Returns:
- the found
ComponentModelorOptional.empty()if it couldn't be found.
-
findConnectionProviderModel
public Optional<org.mule.runtime.api.meta.model.connection.ConnectionProviderModel> findConnectionProviderModel(org.mule.runtime.api.component.ComponentIdentifier componentId) Finds aConnectionProviderModelwithin the provided set ofExtensionModels by aComponentIdentifier.- Parameters:
componentId- the identifier to use for the search.- Returns:
- the found
ConnectionProviderModelorOptional.empty()if it couldn'tbe found.
-
findConfigurationModel
public Optional<org.mule.runtime.api.meta.model.config.ConfigurationModel> findConfigurationModel(org.mule.runtime.api.component.ComponentIdentifier componentId) Description copied from interface:ExtensionModelHelperFinds aConfigurationModelwithin the provided set ofExtensionModels by aComponentIdentifier.- Specified by:
findConfigurationModelin interfaceExtensionModelHelper- Parameters:
componentId- the identifier to use for the search.- Returns:
- the found
ConfigurationModelorOptional.empty()if it couldn't be found.
-
findParameterModel
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) -
walkToComponent
public void walkToComponent(org.mule.runtime.api.component.ComponentIdentifier componentIdentifier, Optional<ComponentAstBuilder> parent, ExtensionModelHelper.ExtensionWalkerModelDelegate delegate, org.mule.runtime.api.meta.model.ExtensionModel currentExtension) Navigates the extension model for the providedcomponentIdentifierand calls the corresponding method on the provideddelegatewhen found.- Specified by:
walkToComponentin interfaceExtensionModelHelper- Parameters:
componentIdentifier- the identifier to use for the search.parent- an optionalComponentAstBuilderto disambiguate nested models.delegate- the callback to execute on the found model.currentExtension- the extension that declares the component with the givencomponentIdentifier.
-
findMetadataType
Description copied from interface:ExtensionModelHelperfind aMetadataTypefor a given JavaClass.- Specified by:
findMetadataTypein interfaceExtensionModelHelper- Parameters:
type- the java class to search an associatedMetadataTypefor.- Returns:
- the
MetadataTypeassociated with the JavaClassor anOptional.empty()if there isn't one.
-
lookupExtensionModelFor
public Optional<org.mule.runtime.api.meta.model.ExtensionModel> lookupExtensionModelFor(org.mule.runtime.api.component.ComponentIdentifier componentIdentifier) Description copied from interface:ExtensionModelHelperFind aExtensionModelfor a givenComponentIdentifier- Specified by:
lookupExtensionModelForin interfaceExtensionModelHelper- Parameters:
componentIdentifier- the identifier to use for the search.- Returns:
- the
ExtensionModelassociated with the configuration or anOptional.empty()if there isn't one.
-
resolveDslElementModel
public Optional<org.mule.runtime.extension.api.dsl.syntax.DslElementSyntax> resolveDslElementModel(org.mule.metadata.api.model.MetadataType type, String namespacePrefix) Description copied from interface:ExtensionModelHelperFind aDslElementSyntaxfor a givenMetadataTypewithin theExtensionModelfor the provided namespace prefix.- Specified by:
resolveDslElementModelin interfaceExtensionModelHelper- Parameters:
type- the type to search the syntax for.namespacePrefix- the namespace prefix of the extension to search in.- Returns:
- the
DslElementSyntaxassociated with the type or anOptional.empty()if there isn't one.
-
resolveDslElementModel
public org.mule.runtime.extension.api.dsl.syntax.DslElementSyntax resolveDslElementModel(org.mule.runtime.api.meta.NamedObject component, org.mule.runtime.api.component.ComponentIdentifier componentIdentifier) Description copied from interface:ExtensionModelHelperFind aDslElementSyntaxfor a givenNamedObjectwith the providedComponentIdentifier.- Specified by:
resolveDslElementModelin interfaceExtensionModelHelper- Parameters:
component- the component to search the syntax for.componentIdentifier- the identifier to use for the search.- Returns:
- the
DslElementSyntaxassociated with the component.
-
resolveDslElementModel
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) Description copied from interface:ExtensionModelHelperFind aDslElementSyntaxfor a givenMetadataTypewithin the providedExtensionModel.- Specified by:
resolveDslElementModelin interfaceExtensionModelHelper- Parameters:
metadataType- the type to search the syntax for.extensionModel- the extension to search in.- Returns:
- the
DslElementSyntaxassociated with the type or anOptional.empty()if there isn't one.
-
resolveDslElementModel
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) Description copied from interface:ExtensionModelHelperFind aDslElementSyntaxfor a givenParameterModelwith the providedComponentIdentifier.- Specified by:
resolveDslElementModelin interfaceExtensionModelHelper- Parameters:
parameterModel- the parameterModel to search the syntax for.componentIdentifier- the identifier to use for the search.- Returns:
- the
DslElementSyntaxassociated with the parameterModel.
-
resolveSubTypes
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) Description copied from interface:ExtensionModelHelperNote: Only instantiable subtypes will be returned by this method!- Specified by:
resolveSubTypesin interfaceExtensionModelHelper- Parameters:
type- the type to resolve subtypes for- Returns:
- the subtypes along with their
DslElementSyntax, if available.
-
getTypeCatalog
public org.mule.runtime.api.meta.type.TypeCatalog getTypeCatalog()Description copied from interface:ExtensionModelHelperReturns aTypeCatalogcontaining all theObjectTypes available in the current resolving context.Any
ObjectTypethat can be found using theExtensionModel.getTypes()method for any of theextensionsin the context should available in the providedTypeCatalog- Specified by:
getTypeCatalogin interfaceExtensionModelHelper- Returns:
- a
TypeCatalogcontaining all theObjectTypes available in the current resolving context.
-
getDslSyntaxResolverFor
public org.mule.runtime.extension.api.dsl.syntax.resolver.DslSyntaxResolver getDslSyntaxResolverFor(org.mule.runtime.api.meta.model.ExtensionModel extensionModel) Description copied from interface:ExtensionModelHelperfind the DslSyntaxResolver for the givenextensionModel.- Specified by:
getDslSyntaxResolverForin interfaceExtensionModelHelper- Returns:
- the dsl syntax for the
extensionModelif avialable,Optional.empty()if not.
-