Package org.mule.runtime.ast.api.util
Class BaseComponentParameterAstDecorator
java.lang.Object
org.mule.runtime.ast.api.util.BaseComponentParameterAstDecorator
- All Implemented Interfaces:
ComponentParameterAst
This class provides a skeletal implementation of the
ComponentParameterAst interface, to minimize the effort required
to implement this interface when decorating instances of ComponentParameterAst.- Since:
- 1.0
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new decorator for the provided instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected ComponentParameterAstorg.mule.runtime.api.meta.model.parameter.ParameterGroupModelorg.mule.runtime.api.meta.model.parameter.ParameterModelgetModel()This method WILL NOT resolve any property placeholders to the actual values if present.This method WILL resolve any property placeholders to the actual values if present.<T> org.mule.runtime.api.functional.Either<String,T> getValue()Returns either the expression for this parameter or a fixed value, depending on what is set in the DSL.<T> org.mule.runtime.api.functional.Either<String,org.mule.runtime.api.functional.Either<ParameterResolutionException, T>> Returns either the expression for this parameter, aParameterResolutionExceptionoccurred while converting the value to its expected type, a fixed value, depending on what is set in the DSL.booleanReturnstrueif this is a default parameter; returnsfalseotherwise.
-
Constructor Details
-
BaseComponentParameterAstDecorator
Creates a new decorator for the provided instance.- Parameters:
decorated- theComponentParameterAstinstance to decorate.
-
-
Method Details
-
getDecorated
- Returns:
- the decorated
ComponentParameterAstinstance.
-
getModel
public org.mule.runtime.api.meta.model.parameter.ParameterModel getModel()- Specified by:
getModelin interfaceComponentParameterAst- Returns:
- the model that represents this parameter.
-
getGroupModel
public org.mule.runtime.api.meta.model.parameter.ParameterGroupModel getGroupModel()- Specified by:
getGroupModelin interfaceComponentParameterAst- Returns:
- the group model that contains the represented parameter or
null.
-
getValue
Description copied from interface:ComponentParameterAstReturns either the expression for this parameter or a fixed value, depending on what is set in the DSL.When using the
rightpart returned by this method for a parameter that is a complex object defined inline, the definition of the object will be returned (aComponentAst), not the object itself.- Specified by:
getValuein interfaceComponentParameterAst- Returns:
- the value of the parameter, or its default value if there is one defined and the parameter is not set in the DSL.
-
getValueOrResolutionError
public <T> org.mule.runtime.api.functional.Either<String,org.mule.runtime.api.functional.Either<ParameterResolutionException, getValueOrResolutionError()T>> Description copied from interface:ComponentParameterAstReturns either the expression for this parameter, aParameterResolutionExceptionoccurred while converting the value to its expected type, a fixed value, depending on what is set in the DSL.Refer to
ComponentParameterAst.getValue()for details on theleftand theright,rightreturned value.- Specified by:
getValueOrResolutionErrorin interfaceComponentParameterAst- Returns:
- the value of the parameter, or a ParameterResolutionException if an error occurred converting a fixed value to the type of the parameter declaration.
-
getRawValue
Description copied from interface:ComponentParameterAstThis method WILL NOT resolve any property placeholders to the actual values if present. UseComponentParameterAst.getResolvedRawValue()orComponentParameterAst.getValue()if properties resolution is needed.- Specified by:
getRawValuein interfaceComponentParameterAst- Returns:
- the value of the parameter as defined in the DSL.
-
getResolvedRawValue
Description copied from interface:ComponentParameterAstThis method WILL resolve any property placeholders to the actual values if present. UseComponentParameterAst.getRawValue()if properties resolution is not wanted.Property placeholders resolution is done with the object given to
ArtifactAst.updatePropertiesResolver(java.util.function.UnaryOperator).- Specified by:
getResolvedRawValuein interfaceComponentParameterAst- Returns:
- the value of the parameter as defined in the DSL and its property placeholders resolved.
-
getMetadata
- Specified by:
getMetadatain interfaceComponentParameterAst- Returns:
- the parser metadata for this parameter if it is defined as a nested component, or
Optional.empty()otherwise.
-
getGenerationInformation
- Specified by:
getGenerationInformationin interfaceComponentParameterAst- Returns:
- an object containing information about the generation of this parameter.
-
isDefaultValue
public boolean isDefaultValue()Description copied from interface:ComponentParameterAstReturnstrueif this is a default parameter; returnsfalseotherwise.- Specified by:
isDefaultValuein interfaceComponentParameterAst- Returns:
- true if and only if this is a default parameter
-