Class BaseComponentAstBuilder<B extends BaseComponentAstBuilder>
- All Implemented Interfaces:
Supplier<ComponentAst>,ComponentAstBuilder
- Direct Known Subclasses:
DefaultComponentAstBuilder,LightComponentAstBuilder
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBaseComponentAstBuilder(PropertiesResolver propertiesResolver, ParameterModelUtils parameterModelUtils) -
Method Summary
Modifier and TypeMethodDescriptionaddChildComponent(B childComponent) protected Map<ParameterKey,ComponentParameterAst> protected voiddoRemoveParamChild(org.mule.runtime.api.component.ComponentIdentifier componentIdentifier) org.mule.runtime.api.component.TypedComponentIdentifier.ComponentTypeorg.mule.runtime.api.meta.model.ExtensionModelorg.mule.runtime.ast.internal.DefaultComponentGenerationInformation.Builderorg.mule.runtime.api.component.ComponentIdentifierorg.mule.runtime.api.component.location.ComponentLocation<M> Optional<M>A component may be represented by different kinds of models, depending on the actual type of this component.protected PropertiesResolverorg.mule.metadata.api.model.MetadataTypegetType()voidprotected voidremoveParamChild(org.mule.runtime.api.meta.model.parameter.ParameterModel paramModel, org.mule.runtime.api.meta.model.parameter.ParameterGroupModel parameterGroupModel) resolveComponentId(Map<ParameterKey, ComponentParameterAst> parameterAsts) voidsetComponentId(Supplier<Optional<String>> componentId) protected voidwithAnnotation(String name, Object value) Adds an annotation as defined in the DSL to this component builder.withBodyParameter(String parameterRawValue) Adds a body parameter as defined in the DSL to this component builder.withComponentModel(org.mule.runtime.api.meta.model.ComponentModel componentModel) Sets the model declaration of the target component.withComponentType(org.mule.runtime.api.component.TypedComponentIdentifier.ComponentType componentType) withConfigurationModel(org.mule.runtime.api.meta.model.config.ConfigurationModel configurationModel) Sets the model declaration of the target component.withConnectionProviderModel(org.mule.runtime.api.meta.model.connection.ConnectionProviderModel connectionProviderModel) Sets the model declaration of the target component.withExtensionModel(org.mule.runtime.api.meta.model.ExtensionModel extensionModel) withIdentifier(org.mule.runtime.api.component.ComponentIdentifier identifier) withLocation(org.mule.runtime.api.component.location.ComponentLocation location) withMetadata(ComponentMetadataAst metadata) withNestableElementModel(org.mule.runtime.api.meta.model.nested.NestableElementModel nestableElementModel) Sets the model declaration of the target component.withParameter(org.mule.runtime.api.meta.model.parameter.ParameterModel paramModel, org.mule.runtime.api.meta.model.parameter.ParameterGroupModel parameterGroupModel, ComponentParameterAst paramValue, Iterable<org.mule.runtime.api.component.ComponentIdentifier> paramIdentifiers) withParameter(org.mule.runtime.api.meta.model.parameter.ParameterModel paramModel, org.mule.runtime.api.meta.model.parameter.ParameterGroupModel parameterGroupModel, ComponentParameterAst paramValue, Optional<org.mule.runtime.api.component.ComponentIdentifier> paramIdentifier) withParameterizedModel(org.mule.runtime.api.meta.model.parameter.ParameterizedModel parameterizedModel) Sets the model declaration of the target component.withRawParameter(String paramName, String paramRawValue) Adds a parameter as defined in the DSL to this component builder.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.mule.runtime.ast.api.builder.ComponentAstBuilder
addChildComponent, build
-
Field Details
-
BODY_RAW_PARAM_NAME
- See Also:
-
SOURCE_TYPE
- See Also:
-
TARGET_TYPE
- See Also:
-
componentId
-
-
Constructor Details
-
BaseComponentAstBuilder
public BaseComponentAstBuilder(PropertiesResolver propertiesResolver, ParameterModelUtils parameterModelUtils)
-
-
Method Details
-
addChildComponent
-
withRawParameter
Description copied from interface:ComponentAstBuilderAdds a parameter as defined in the DSL to this component builder.When the target component is actually being
built, these parameter names are matched to the parameters defined in the model provided byComponentAstBuilder.withParameterizedModel(ParameterizedModel)to create the actual parameters map of the component.- Specified by:
withRawParameterin interfaceComponentAstBuilder- Parameters:
paramName- the name of the parameter for which a raw value is provided.paramRawValue- the raw value of the parameter, as defined in the DSL.- Returns:
- this builder
-
withBodyParameter
Description copied from interface:ComponentAstBuilderAdds a body parameter as defined in the DSL to this component builder.When the target component is actually being
built, these body parameter is matched to the parameters defined in the model provided byComponentAstBuilder.withParameterizedModel(ParameterizedModel)to create the actual parameters map of the component.- Specified by:
withBodyParameterin interfaceComponentAstBuilder- Parameters:
parameterRawValue- the raw value of the body parameter.- Returns:
- this builder
-
withAnnotation
Description copied from interface:ComponentAstBuilderAdds an annotation as defined in the DSL to this component builder.- Specified by:
withAnnotationin interfaceComponentAstBuildervalue- the value of the annotation.- Returns:
- this builder
-
withParameter
public BaseComponentAstBuilder<B> withParameter(org.mule.runtime.api.meta.model.parameter.ParameterModel paramModel, org.mule.runtime.api.meta.model.parameter.ParameterGroupModel parameterGroupModel, ComponentParameterAst paramValue, Optional<org.mule.runtime.api.component.ComponentIdentifier> paramIdentifier) -
withParameter
public BaseComponentAstBuilder<B> withParameter(org.mule.runtime.api.meta.model.parameter.ParameterModel paramModel, org.mule.runtime.api.meta.model.parameter.ParameterGroupModel parameterGroupModel, ComponentParameterAst paramValue, Iterable<org.mule.runtime.api.component.ComponentIdentifier> paramIdentifiers) -
prepareForBuild
public void prepareForBuild() -
removeParamChild
protected void removeParamChild(org.mule.runtime.api.meta.model.parameter.ParameterModel paramModel, org.mule.runtime.api.meta.model.parameter.ParameterGroupModel parameterGroupModel) -
doRemoveParamChild
protected void doRemoveParamChild(org.mule.runtime.api.component.ComponentIdentifier componentIdentifier) -
getRawParameters
-
createParameterAsts
-
getAnnotations
-
withExtensionModel
public ComponentAstBuilder withExtensionModel(org.mule.runtime.api.meta.model.ExtensionModel extensionModel) - Parameters:
extensionModel- the extension that declares the model that represents this compoennt.- Returns:
- this builder
-
getExtensionModel
public org.mule.runtime.api.meta.model.ExtensionModel getExtensionModel()- Specified by:
getExtensionModelin interfaceComponentAstBuilder- Returns:
- the extension model that declares the model this component represents.
-
withComponentModel
public ComponentAstBuilder withComponentModel(org.mule.runtime.api.meta.model.ComponentModel componentModel) Sets the model declaration of the target component.This method is exclusive with
withNestableElementModel(NestableElementModel),withConfigurationModel(ConfigurationModel),withConnectionProviderModel(ConnectionProviderModel)andwithParameterizedModel(ParameterizedModel); only one of these may be called for a single builder.- Parameters:
componentModel- the model that represents this component.- Returns:
- this builder
-
withNestableElementModel
public ComponentAstBuilder withNestableElementModel(org.mule.runtime.api.meta.model.nested.NestableElementModel nestableElementModel) Sets the model declaration of the target component.This method is exclusive with
withComponentModel(ComponentModel),withConfigurationModel(ConfigurationModel),withConnectionProviderModel(ConnectionProviderModel)andwithParameterizedModel(ParameterizedModel); only one of these may be called for a single builder.- Parameters:
nestableElementModel- the model that represents this component.- Returns:
- this builder
-
withConfigurationModel
public ComponentAstBuilder withConfigurationModel(org.mule.runtime.api.meta.model.config.ConfigurationModel configurationModel) Sets the model declaration of the target component.This method is exclusive with
withComponentModel(ComponentModel),withNestableElementModel(NestableElementModel),withConnectionProviderModel(ConnectionProviderModel)andwithParameterizedModel(ParameterizedModel); only one of these may be called for a single builder.- Parameters:
configurationModel- the model that represents this component.- Returns:
- this builder
-
withConnectionProviderModel
public ComponentAstBuilder withConnectionProviderModel(org.mule.runtime.api.meta.model.connection.ConnectionProviderModel connectionProviderModel) Sets the model declaration of the target component.This method is exclusive with
withComponentModel(ComponentModel),withNestableElementModel(NestableElementModel),withConfigurationModel(ConfigurationModel)andwithParameterizedModel(ParameterizedModel); only one of these may be called for a single builder.- Parameters:
connectionProviderModel- the model that represents this component.- Returns:
- this builder
-
withParameterizedModel
public BaseComponentAstBuilder<B> withParameterizedModel(org.mule.runtime.api.meta.model.parameter.ParameterizedModel parameterizedModel) Sets the model declaration of the target component.This method is exclusive with
withComponentModel(ComponentModel),withNestableElementModel(NestableElementModel),withConfigurationModel(ConfigurationModel)andwithConnectionProviderModel(ConnectionProviderModel); only one of these may be called for a single builder.- Specified by:
withParameterizedModelin interfaceComponentAstBuilder- Parameters:
parameterizedModel- the model that represents this component.- Returns:
- this builder
-
validateSingleModelSet
protected void validateSingleModelSet() -
getModel
Description copied from interface:ComponentAstBuilderA component may be represented by different kinds of models, depending on the actual type of this component. Possible values may be, for instance, instances ofConfigurationModel,ComponentModelorConnectionProviderModel(but not necessarily limited to those).- Specified by:
getModelin interfaceComponentAstBuilder- Parameters:
modelClass- the class of the model this method should return.- Returns:
- the model that represents this component.
-
getType
public org.mule.metadata.api.model.MetadataType getType() -
withMetadata
- Specified by:
withMetadatain interfaceComponentAstBuilder- Parameters:
metadata- the parser metadata for this component.- Returns:
- this builder
-
getMetadata
-
withLocation
public ComponentAstBuilder withLocation(org.mule.runtime.api.component.location.ComponentLocation location) - Parameters:
location- the location of the component in the configuration.- Returns:
- this builder
-
withComponentType
public ComponentAstBuilder withComponentType(org.mule.runtime.api.component.TypedComponentIdentifier.ComponentType componentType) - Parameters:
componentType- a general typification of the role of this component.- Returns:
- this builder
-
getComponentType
public org.mule.runtime.api.component.TypedComponentIdentifier.ComponentType getComponentType() -
withIdentifier
public ComponentAstBuilder withIdentifier(org.mule.runtime.api.component.ComponentIdentifier identifier) - Specified by:
withIdentifierin interfaceComponentAstBuilder- Parameters:
identifier- the identifier for the configuration element this object represents.- Returns:
- this builder
-
getIdentifier
public org.mule.runtime.api.component.ComponentIdentifier getIdentifier()- Specified by:
getIdentifierin interfaceComponentAstBuilder- Returns:
- the identifier for the configuration element this object represents.
-
getLocation
public org.mule.runtime.api.component.location.ComponentLocation getLocation() -
getGenerationInformation
public org.mule.runtime.ast.internal.DefaultComponentGenerationInformation.Builder getGenerationInformation() -
childComponentsStream
-
getParamsChildren
-
resolveComponentId
protected Optional<String> resolveComponentId(Map<ParameterKey, ComponentParameterAst> parameterAsts) -
setComponentId
-
getComponentId
-
getPropertiesResolver
-
getParameterModelUtils
-