Class MetadataTypeModelAdapter

java.lang.Object
org.mule.runtime.ast.internal.builder.adapter.MetadataTypeModelAdapter
All Implemented Interfaces:
org.mule.runtime.api.meta.DescribedObject, org.mule.runtime.api.meta.model.parameter.ParameterizedModel, org.mule.runtime.api.meta.NamedObject, MetadataTypeAdapter

public class MetadataTypeModelAdapter extends Object implements org.mule.runtime.api.meta.model.parameter.ParameterizedModel, MetadataTypeAdapter
  • Method Details

    • createMetadataTypeModelAdapterWithStereotype

      public static Optional<MetadataTypeModelAdapter> createMetadataTypeModelAdapterWithStereotype(org.mule.metadata.api.model.MetadataType type, ExtensionModelHelper extensionModelHelper)
      Adapts the provided type for treatment as both a ParameterizedModel and HasStereotypeModel.
      Parameters:
      type - the MetadataType to adapt.
      extensionModelHelper - used for actions relative to MetadataTypes.
      Returns:
      the newly created adapter if the provided is stereotyped, Optional.empty() if not.
      Since:
      1.0
    • createSimpleWrapperTypeModelAdapter

      public static MetadataTypeModelAdapter createSimpleWrapperTypeModelAdapter(org.mule.metadata.api.model.SimpleType simpleType, ExtensionModelHelper extensionModelHelper)
      Adapts the provided singleType for treatment as a ParameterizedModel.

      A new type is created around the provided simpleType to represent how it is represented in a DSL when it is nested in an array.

      Parameters:
      simpleType - the MetadataType to adapt.
      extensionModelHelper - used for actions relative to MetadataTypes.
      Returns:
      the newly created adapter.
      Since:
      1.0
    • createKeyValueWrapperTypeModelAdapter

      public static MetadataTypeModelAdapter createKeyValueWrapperTypeModelAdapter(String keyParamName, org.mule.metadata.api.model.MetadataType simpleKeyType, String valueParamName, org.mule.metadata.api.model.MetadataType simpleValueType, ExtensionModelHelper extensionModelHelper)
      Adapts the provided types representing the key/values of a map for treatment as a ParameterizedModel.

      A new type is created around the provided types with the given paramNames to represent how it is represented in a DSL when it is nested in a map.

      Parameters:
      keyParamName - the name of the attribute in the DSL containing the entry key.
      simpleKeyType - the MetadataType of the entry key
      valueParamName - the name of the attribute in the DSL containing the entry value.
      simpleValueType - the MetadataType of the entry value
      extensionModelHelper - used for actions relative to MetadataTypes.
      Returns:
      the newly created adapter.
      Since:
      1.0
    • createParameterizedTypeModelAdapter

      public static MetadataTypeModelAdapter createParameterizedTypeModelAdapter(org.mule.metadata.api.model.MetadataType type, ExtensionModelHelper extensionModelHelper)
      Adapts the provided type for treatment as a ParameterizedModel.
      Parameters:
      type - the MetadataType to adapt.
      extensionModelHelper - used for actions relative to MetadataTypes.
      Returns:
      the newly created adapter.
      Since:
      1.0
    • getName

      public String getName()
      Specified by:
      getName in interface org.mule.runtime.api.meta.NamedObject
    • getDescription

      public String getDescription()
      Specified by:
      getDescription in interface org.mule.runtime.api.meta.DescribedObject
    • getParameterGroupModels

      public List<org.mule.runtime.api.meta.model.parameter.ParameterGroupModel> getParameterGroupModels()
      Specified by:
      getParameterGroupModels in interface org.mule.runtime.api.meta.model.parameter.ParameterizedModel
    • getType

      public org.mule.metadata.api.model.MetadataType getType()
      Specified by:
      getType in interface MetadataTypeAdapter
      Returns:
      the adapted MetadataType.
    • isWrapperFor

      public boolean isWrapperFor(org.mule.metadata.api.model.MetadataType type)
      Specified by:
      isWrapperFor in interface MetadataTypeAdapter
      Parameters:
      type - the MetadataType to check
      Returns:
      true if this adapter's wrapped type is the given type
    • toString

      public String toString()
      Overrides:
      toString in class Object