public static class ComponentBuildingDefinition.Builder extends Object
ComponentBuildingDefinition
TODO MULE-9693 Improve builder so the copy is not required to reuse the namespace value.| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
ComponentBuildingDefinition.Builder |
asNamed()
Used to declare that the object to be created has a name attribute
|
ComponentBuildingDefinition.Builder |
asPrototype() |
ComponentBuildingDefinition.Builder |
asScope()
Used to declare that the object to be created is an scope.
|
ComponentBuildingDefinition |
build()
Builds a
ComponentBuildingDefinition with the parameters set in the builder. |
ComponentBuildingDefinition.Builder |
copy()
Makes a deep copy of the builder so it's current configuration can be reused.
|
ComponentBuildingDefinition.Builder |
withConstructorParameterDefinition(AttributeDefinition attributeDefinition)
Adds a new constructor parameter to be used during the object instantiation.
|
ComponentBuildingDefinition.Builder |
withIdentifier(String identifier)
Sets the identifier of the configuration element that this building definition is for.
|
ComponentBuildingDefinition.Builder |
withIgnoredConfigurationParameter(String parameterName)
Mark configuration parameters to be ignored when building the component.
|
ComponentBuildingDefinition.Builder |
withKeyTypeConverter(TypeConverter typeConverter)
This method allows to convert a map entry key to another type using a converter.
|
ComponentBuildingDefinition.Builder |
withNamespace(String namespace)
Sets the namespace of the configuration element that this building definition is for.
|
ComponentBuildingDefinition.Builder |
withObjectFactoryType(Class<?> objectFactoryType)
Defines a factory class to be used for creating the object.
|
ComponentBuildingDefinition.Builder |
withSetterParameterDefinition(String fieldName,
AttributeDefinition attributeDefinition)
Adds a new parameter to be added to the object by using a setter method.
|
ComponentBuildingDefinition.Builder |
withTypeConverter(TypeConverter typeConverter)
This method allows to convert a simple type to another type using a converter.
|
ComponentBuildingDefinition.Builder |
withTypeDefinition(TypeDefinition typeDefinition)
Sets the
TypeDefinition to discover the object type. |
public ComponentBuildingDefinition.Builder withConstructorParameterDefinition(AttributeDefinition attributeDefinition)
attributeDefinition - the constructor argument definition.this builderpublic ComponentBuildingDefinition.Builder withSetterParameterDefinition(String fieldName, AttributeDefinition attributeDefinition)
fieldName - the name of the field in which the value must be injectedattributeDefinition - the setter parameter definitionthis builderpublic ComponentBuildingDefinition.Builder withIdentifier(String identifier)
identifier - configuration element identifierthis builderpublic ComponentBuildingDefinition.Builder withNamespace(String namespace)
namespace - configuration element namespacethis builderpublic ComponentBuildingDefinition.Builder withTypeDefinition(TypeDefinition typeDefinition)
TypeDefinition to discover the object type. It may be created from TypeDefinition.fromType(Class)
which means the type is predefined. Or it may be created from TypeDefinition.fromConfigurationAttribute(String)
which means that the object type is declared within the configuration using a config attribute.typeDefinition - the type definition to discover the objecvt typethis builderpublic ComponentBuildingDefinition.Builder withTypeConverter(TypeConverter typeConverter)
TypeConverter are only allowed when the produce type by the component is any of java primitive types, its wrapper
or string.typeConverter - converter from the configuration value to a custom type.this builderpublic ComponentBuildingDefinition.Builder withKeyTypeConverter(TypeConverter typeConverter)
TypeConverter are only allowed when the produce type by the component is any of java primitive types, its wrapper
or string.typeConverter - converter from the configuration value to a custom type.this builderpublic ComponentBuildingDefinition.Builder asScope()
this builderpublic ComponentBuildingDefinition.Builder asNamed()
this builderpublic ComponentBuildingDefinition.Builder withObjectFactoryType(Class<?> objectFactoryType)
objectFactoryType - Class for the factory to use to create the objectthis builderpublic ComponentBuildingDefinition.Builder withIgnoredConfigurationParameter(String parameterName)
AttributeDefinition.Builder.fromUndefinedSimpleAttributes() there are certain configuration parameters that we
don't want to included them in the process of building the object.parameterName - the configuration parameter name.this builder.public ComponentBuildingDefinition.Builder copy()
Builder copy.public ComponentBuildingDefinition build()
ComponentBuildingDefinition with the parameters set in the builder.
At least the identifier, namespace and type definition must be configured or this method will fail.ComponentBuildingDefinitionpublic ComponentBuildingDefinition.Builder asPrototype()
Copyright © 2003–2017 MuleSoft, Inc.. All rights reserved.