public static class AttributeDefinition.Builder extends Object
Modifier and Type | Method and Description |
---|---|
AttributeDefinition |
build() |
static AttributeDefinition.Builder |
fromChildCollectionConfiguration(Class<?> type)
Used when an attribute must be set with a collection of objects created from the user configuration.
|
static AttributeDefinition.Builder |
fromChildConfiguration(Class<?> childType)
Used when an attribute must be set with a complex object created from the user configuration.
|
static AttributeDefinition.Builder |
fromChildMapConfiguration(Class<?> keyType,
Class<?> valueType)
Used when an attribute must be set with a map of objects created from the user configuration.
|
static AttributeDefinition.Builder |
fromFixedReference(String reference)
Use when the reference is fixed (and not configurable), not the value.
|
static AttributeDefinition.Builder |
fromFixedValue(Object value) |
static AttributeDefinition.Builder |
fromMultipleDefinitions(KeyAttributeDefinitionPair... definitions)
Used when several attributes or child components needs to be mapped to a single attribute.
|
static AttributeDefinition.Builder |
fromReferenceObject(Class<?> referenceObjectType)
Used when attribute an attribute must be set with an object provided by the runtime.
|
static AttributeDefinition.Builder |
fromSimpleParameter(String configParameterName) |
static AttributeDefinition.Builder |
fromSimpleParameter(String configParameterName,
TypeConverter typeConverter) |
static AttributeDefinition.Builder |
fromSimpleReferenceParameter(String referenceSimpleParameter) |
static AttributeDefinition.Builder |
fromTextContent()
Used when an attribute must be created with the inner content of the configuration element.
|
static AttributeDefinition.Builder |
fromUndefinedComplexAttribute()
Calling this method declares that the attribute will be assigned with all declared complex configuration object that did
not were map by other
AttributeDefinition s. |
static AttributeDefinition.Builder |
fromUndefinedSimpleAttributes()
Calling this method declares that the attribute will be assigned with all declared simple configuration attribute and its
value.
|
AttributeDefinition.Builder |
withDefaultValue(Object defaultValue) |
AttributeDefinition.Builder |
withIdentifier(String childIdentifier) |
AttributeDefinition.Builder |
withWrapperIdentifier(String identifier)
Defines the parent identifier used to wrap a child element.
|
public static AttributeDefinition.Builder fromSimpleParameter(String configParameterName)
configParameterName
- name of the configuration parameter from which this attribute value will be extracted.public static AttributeDefinition.Builder fromSimpleParameter(String configParameterName, TypeConverter typeConverter)
configParameterName
- name of the configuration parameter from which this attribute value will be extracted.typeConverter
- converter from the configuration value to a custom type.public AttributeDefinition.Builder withDefaultValue(Object defaultValue)
defaultValue
- defines the default value to be used for the attribute if no other value is provided.public AttributeDefinition.Builder withWrapperIdentifier(String identifier)
The first-wrapper and second-wrapper elements are just used to univocally identify the object attribute in which the child-component object must be injected.
identifier
- component identifier in the configuration for the parent element wrapping the child componentpublic static AttributeDefinition.Builder fromFixedValue(Object value)
value
- a fixed value which will be assigned to the attribute.public static AttributeDefinition.Builder fromFixedReference(String reference)
reference
- a fixed reference object which will be assigned to the attribute.public static AttributeDefinition.Builder fromUndefinedSimpleAttributes()
java.util.Map
so the attribute type must also be a java.util.Map
.public static AttributeDefinition.Builder fromReferenceObject(Class<?> referenceObjectType)
org.mule.runtime.core.api.MuleContext
or a org.mule.runtime.core.time.TimeSupplier
.referenceObjectType
- type of the object expected to be injected.public static AttributeDefinition.Builder fromChildConfiguration(Class<?> childType)
childType
- type of the required complex object.public static AttributeDefinition.Builder fromUndefinedComplexAttribute()
AttributeDefinition
s. By complex attribute we consider those that are represented by complex
object types.
The complex attributes are store in a java.util.List
so the attribute type must also be a java.util.List
.public static AttributeDefinition.Builder fromSimpleReferenceParameter(String referenceSimpleParameter)
referenceSimpleParameter
- configuration attribute that holds a reference to another configuration object.public static AttributeDefinition.Builder fromChildCollectionConfiguration(Class<?> type)
type
- the collection object type.public static AttributeDefinition.Builder fromChildMapConfiguration(Class<?> keyType, Class<?> valueType)
keyType
- the map key type.valueType
- the map value type.public static AttributeDefinition.Builder fromTextContent()
public static AttributeDefinition.Builder fromMultipleDefinitions(KeyAttributeDefinitionPair... definitions)
definitions
- the set of attribute definitions along with its keyspublic AttributeDefinition.Builder withIdentifier(String childIdentifier)
public AttributeDefinition build()
AttributeDefinition
created based on the defined configuration.Copyright © 2018. All rights reserved.