Class DefaultExtensionModelHelper

java.lang.Object
org.mule.runtime.ast.internal.model.DefaultExtensionModelHelper
All Implemented Interfaces:
ExtensionModelHelper

public class DefaultExtensionModelHelper extends Object implements 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

    Constructors
    Constructor
    Description
    DefaultExtensionModelHelper(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 Type
    Method
    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 ComponentIdentifier
    org.mule.runtime.api.component.TypedComponentIdentifier.ComponentType
    findComponentType(org.mule.runtime.api.meta.model.ComponentModel extensionComponentModel)
    Find a TypedComponentIdentifier.ComponentType for a given ComponentModel
    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>
    find a MetadataType for a given Java Class.
    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.DslSyntaxResolver
    getDslSyntaxResolverFor(org.mule.runtime.api.meta.model.ExtensionModel extensionModel)
    find the DslSyntaxResolver for the given extensionModel.
    org.mule.runtime.api.meta.type.TypeCatalog
    Returns a TypeCatalog containing all the ObjectTypes available in the current resolving context.
    Optional<org.mule.runtime.api.meta.model.ExtensionModel>
    lookupExtensionModelFor(org.mule.runtime.api.component.ComponentIdentifier componentIdentifier)
    Find a ExtensionModel for a given ComponentIdentifier
    Optional<org.mule.runtime.extension.api.dsl.syntax.DslElementSyntax>
    resolveDslElementModel(org.mule.metadata.api.model.MetadataType type, String namespacePrefix)
    Find a DslElementSyntax for a given MetadataType within the ExtensionModel for 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 a DslElementSyntax for a given MetadataType within the provided ExtensionModel.
    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)
    Find a DslElementSyntax for a given ParameterModel with the provided ComponentIdentifier.
    org.mule.runtime.extension.api.dsl.syntax.DslElementSyntax
    resolveDslElementModel(org.mule.runtime.api.meta.NamedObject component, org.mule.runtime.api.component.ComponentIdentifier componentIdentifier)
    Find a DslElementSyntax for a given NamedObject with the provided 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<ComponentAstBuilder> parent, 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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DefaultExtensionModelHelper

      public DefaultExtensionModelHelper(Set<org.mule.runtime.api.meta.model.ExtensionModel> extensionModels)
      Parameters:
      extensionModels - the set of ExtensionModels 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: ExtensionModelHelper
      Find a TypedComponentIdentifier.ComponentType for a given ComponentIdentifier
      Specified by:
      findComponentType in interface ExtensionModelHelper
      Parameters:
      componentIdentifier - the identifier to use for the search.
      Returns:
      the TypedComponentIdentifier.ComponentType associated with the configuration or an Optional.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: ExtensionModelHelper
      Find a TypedComponentIdentifier.ComponentType for a given ComponentModel
      Specified by:
      findComponentType in interface ExtensionModelHelper
      Parameters:
      extensionComponentModel - the mode to use for the search.
      Returns:
      the TypedComponentIdentifier.ComponentType associated with the configuration or an Optional.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: ExtensionModelHelper
      Finds a ComponentModel within the provided set of ExtensionModels by a ComponentIdentifier.
      Specified by:
      findComponentModel in interface ExtensionModelHelper
      Parameters:
      componentId - the identifier to use for the search.
      Returns:
      the found ComponentModel or Optional.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 a ConnectionProviderModel within the provided set of ExtensionModels by a ComponentIdentifier.
      Parameters:
      componentId - the identifier to use for the search.
      Returns:
      the found ConnectionProviderModel or Optional.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: ExtensionModelHelper
      Finds a ConfigurationModel within the provided set of ExtensionModels by a ComponentIdentifier.
      Specified by:
      findConfigurationModel in interface ExtensionModelHelper
      Parameters:
      componentId - the identifier to use for the search.
      Returns:
      the found ConfigurationModel or Optional.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 provided componentIdentifier and calls the corresponding method on the provided delegate when found.
      Specified by:
      walkToComponent in interface ExtensionModelHelper
      Parameters:
      componentIdentifier - the identifier to use for the search.
      parent - an optional ComponentAstBuilder to disambiguate nested models.
      delegate - the callback to execute on the found model.
      currentExtension - the extension that declares the component with the given componentIdentifier.
    • findMetadataType

      public Optional<org.mule.metadata.api.model.MetadataType> findMetadataType(Class<?> type)
      Description copied from interface: ExtensionModelHelper
      find a MetadataType for a given Java Class.
      Specified by:
      findMetadataType in interface ExtensionModelHelper
      Parameters:
      type - the java class to search an associated MetadataType for.
      Returns:
      the MetadataType associated with the Java Class or an Optional.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: ExtensionModelHelper
      Find a ExtensionModel for a given ComponentIdentifier
      Specified by:
      lookupExtensionModelFor in interface ExtensionModelHelper
      Parameters:
      componentIdentifier - the identifier to use for the search.
      Returns:
      the ExtensionModel associated with the configuration or an Optional.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: ExtensionModelHelper
      Find a DslElementSyntax for a given MetadataType within the ExtensionModel for the provided namespace prefix.
      Specified by:
      resolveDslElementModel in interface ExtensionModelHelper
      Parameters:
      type - the type to search the syntax for.
      namespacePrefix - the namespace prefix of the extension to search in.
      Returns:
      the DslElementSyntax associated with the type or an Optional.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: ExtensionModelHelper
      Find a DslElementSyntax for a given NamedObject with the provided ComponentIdentifier.
      Specified by:
      resolveDslElementModel in interface ExtensionModelHelper
      Parameters:
      component - the component to search the syntax for.
      componentIdentifier - the identifier to use for the search.
      Returns:
      the DslElementSyntax associated 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: ExtensionModelHelper
      Find a DslElementSyntax for a given MetadataType within the provided ExtensionModel.
      Specified by:
      resolveDslElementModel in interface ExtensionModelHelper
      Parameters:
      metadataType - the type to search the syntax for.
      extensionModel - the extension to search in.
      Returns:
      the DslElementSyntax associated with the type or an Optional.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: ExtensionModelHelper
      Find a DslElementSyntax for a given ParameterModel with the provided ComponentIdentifier.
      Specified by:
      resolveDslElementModel in interface ExtensionModelHelper
      Parameters:
      parameterModel - the parameterModel to search the syntax for.
      componentIdentifier - the identifier to use for the search.
      Returns:
      the DslElementSyntax associated 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: ExtensionModelHelper
      Note: Only instantiable subtypes will be returned by this method!
      Specified by:
      resolveSubTypes in interface ExtensionModelHelper
      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: ExtensionModelHelper
      Returns a TypeCatalog containing all the ObjectTypes available in the current resolving context.

      Any ObjectType that can be found using the ExtensionModel.getTypes() method for any of the extensions in the context should available in the provided TypeCatalog

      Specified by:
      getTypeCatalog in interface ExtensionModelHelper
      Returns:
      a TypeCatalog containing all the ObjectTypes 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: ExtensionModelHelper
      find the DslSyntaxResolver for the given extensionModel.
      Specified by:
      getDslSyntaxResolverFor in interface ExtensionModelHelper
      Returns:
      the dsl syntax for the extensionModel if avialable, Optional.empty() if not.