Module org.mule.runtime.dsl.api
Interface AttributeDefinitionVisitor
@NoImplement
public interface AttributeDefinitionVisitor
An {code AttributeDefinitionVisitor} allows to access an
AttributeDefinition configuration.
Depending on the AttributeDefinition configuration a method and only one method of this contract will be invoked.
- Since:
- 4.0
-
Method Summary
Modifier and TypeMethodDescriptionvoidCalled when the attribute is configured from an object with a certain type.voidonComplexChildCollection(Class<?> type, Optional<String> wrapperIdentifierOptional) Called when the attribute is configured from a list of object with a certain type.voidonComplexChildMap(Class<?> keyType, Class<?> valueType, String wrapperIdentifier) Called when the attribute is configured from a map of objects with a certain type.voidonConfigurationParameter(String parameterName, Object defaultValue, Optional<TypeConverter> typeConverter) Called when the attribute is configured from a simple configuration attribute.voidonFixedValue(Object value) To be called when the value to be set when building the object is fixed and provided by the definition of theComponentBuildingDefinition.voidonMultipleValues(KeyAttributeDefinitionPair[] definitions) Called when a multiple configuration parameters or children components objects need to be set in single object attribute or constructor parameter.voidonReferenceConfigurationParameter(String parameterName, Object defaultValue, Optional<TypeConverter> typeConverter) Called when the attribute is configured from a simple configuration attribute and could reference to a another object defined in the configuration.voidonReferenceFixedParameter(String reference) Called when the attribute must be configured from another fixed object, from which we have a referencevoidonReferenceObject(Class<?> objectType) Called when the attribute needs to be configured from an object provided by the Mule API.voidonReferenceSimpleParameter(String reference) Called when the attribute must be configured from another object defined in the configuration.voidonSoftReferenceSimpleParameter(String softReference) Called when the attribute must reference another object defined in the configuration, but the value injected in the attribute holder is the reference as String.voidCalled when the attribute holds all the complex configuration attributes not mapped to any other attribute.voidCalled when the attribute holds all the simple configuration attributes not mapped to any other attribute.voidCalled when the attribute is configured from theComponentModelinner configuration.
-
Method Details
-
onReferenceObject
Called when the attribute needs to be configured from an object provided by the Mule API.- Parameters:
objectType- the expected object type.
-
onReferenceSimpleParameter
Called when the attribute must be configured from another object defined in the configuration.- Parameters:
reference- the identifier of an object declared in the configuration.
-
onSoftReferenceSimpleParameter
Called when the attribute must reference another object defined in the configuration, but the value injected in the attribute holder is the reference as String.- Parameters:
softReference- the identifier of an object declared in the configuration.
-
onReferenceFixedParameter
Called when the attribute must be configured from another fixed object, from which we have a reference- Parameters:
reference- the identifier of an object.
-
onFixedValue
To be called when the value to be set when building the object is fixed and provided by the definition of theComponentBuildingDefinition.- Parameters:
value- the fixed value
-
onConfigurationParameter
void onConfigurationParameter(String parameterName, Object defaultValue, Optional<TypeConverter> typeConverter) Called when the attribute is configured from a simple configuration attribute.- Parameters:
parameterName- configuration parameter name.defaultValue- default value for the configuration parameter if it has not value.typeConverter- a value converter to convert from the value provided by the config to the value required of the attribute.
-
onReferenceConfigurationParameter
void onReferenceConfigurationParameter(String parameterName, Object defaultValue, Optional<TypeConverter> typeConverter) Called when the attribute is configured from a simple configuration attribute and could reference to a another object defined in the configuration.- Parameters:
parameterName- configuration parameter name.defaultValue- default value for the configuration parameter if it has not value.typeConverter- a value converter to convert from the value provided by the config to the value required of the attribute.
-
onUndefinedSimpleParameters
void onUndefinedSimpleParameters()Called when the attribute holds all the simple configuration attributes not mapped to any other attribute. -
onUndefinedComplexParameters
void onUndefinedComplexParameters()Called when the attribute holds all the complex configuration attributes not mapped to any other attribute. -
onComplexChildCollection
Called when the attribute is configured from a list of object with a certain type.- Parameters:
type- type of the list values to be set in the attribute.wrapperIdentifierOptional- the identifier of the wrapper element that holds the list of components
-
onComplexChildMap
Called when the attribute is configured from a map of objects with a certain type.- Parameters:
keyType- type of the map key to be set in the attribute.valueType- type of the map value to be set in the attribute.wrapperIdentifier- the identifier of the wrapper element that holds the list of components
-
onComplexChild
void onComplexChild(Class<?> type, Optional<String> wrapperIdentifier, Optional<String> childIdentifier) Called when the attribute is configured from an object with a certain type.- Parameters:
type- type of the attribute value.wrapperIdentifier- the identifier of the componentchildIdentifier-
-
onValueFromTextContent
void onValueFromTextContent()Called when the attribute is configured from theComponentModelinner configuration. -
onMultipleValues
Called when a multiple configuration parameters or children components objects need to be set in single object attribute or constructor parameter. The value to be set is a @{code Map} with theKeyAttributeDefinitionPair#getKey()as key and the value is the resolved parameter value or component object.- Parameters:
definitions- the set ofAttributeDefinitionto be used to create
-