public abstract class ComponentModel extends Object
ComponentModel represents the user configuration of a component (flow, config, message processor, etc) defined in an
artifact configuration file.
Every ComponentModel represents the configuration of a core configuration or an extension configuration. Which
configuration element this object represents is identified by a ComponentIdentifier that can be retrieved using
#getName.
It may have simple configuration parameters which are retrieve by using #getParameterGroups or complex parameters which
are retrieved using #getInnerComponents.
There's a set of configuration attributes or custom attributes that may not be mapped directly to the object that runs on
runtime but may be hold by a ComponentModel. Those attributes are retrieved by using #getCustomAttributes.| Modifier and Type | Class and Description |
|---|---|
static class |
ComponentModel.Builder
Builder to create instances of
ComponentModel. |
| Modifier and Type | Field and Description |
|---|---|
static String |
COMPONENT_MODEL_KEY |
| Constructor and Description |
|---|
ComponentModel() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
void |
executedOnEveryInnerComponent(Consumer<ComponentModel> task)
Executes the task on every inner component associated to this componentModel.
|
org.mule.runtime.dsl.api.component.config.DefaultComponentLocation |
getComponentLocation() |
Optional<org.mule.runtime.api.component.TypedComponentIdentifier.ComponentType> |
getComponentType() |
Optional<String> |
getConfigFileName() |
org.mule.runtime.dsl.api.component.config.ComponentConfiguration |
getConfiguration() |
Map<String,Object> |
getCustomAttributes() |
org.mule.runtime.api.component.ComponentIdentifier |
getIdentifier() |
List<ComponentModel> |
getInnerComponents() |
Optional<Integer> |
getLineNumber() |
String |
getNameAttribute() |
Object |
getObjectInstance() |
Map<String,String> |
getParameters() |
ComponentModel |
getParent() |
String |
getSourceCode() |
Optional<Integer> |
getStartColumn() |
String |
getTextContent() |
Class<?> |
getType() |
int |
hashCode() |
boolean |
isEnabled() |
boolean |
isParameterValueProvidedBySchema(String parameterName) |
boolean |
isRoot() |
boolean |
isScope() |
void |
setComponentLocation(org.mule.runtime.dsl.api.component.config.DefaultComponentLocation componentLocation) |
void |
setComponentType(org.mule.runtime.api.component.TypedComponentIdentifier.ComponentType componentType) |
void |
setEnabled(boolean enabled)
Sets the component as enabled, meaning that it should be created and the beanDefinition associated with created too.
|
void |
setObjectInstance(Object objectInstance)
Setter used for components that should be created eagerly without going through spring.
|
void |
setParameter(String parameterName,
String value) |
void |
setParent(ComponentModel parent) |
void |
setRoot(boolean root)
Marked as true if it's a top level configuration.
|
void |
setType(Class<?> type) |
public static String COMPONENT_MODEL_KEY
public Optional<Integer> getLineNumber()
public Optional<Integer> getStartColumn()
public Optional<String> getConfigFileName()
public org.mule.runtime.api.component.ComponentIdentifier getIdentifier()
public Map<String,String> getParameters()
java.util.Map with the simple parameters of the configuration.public List<ComponentModel> getInnerComponents()
java.util.List of all the child ComponentModelspublic Map<String,Object> getCustomAttributes()
java.util.Map with all the custom attributes.public boolean isRoot()
ComponentModel is a top level configuration element, false otherwise.public void setRoot(boolean root)
public void setParameter(String parameterName, String value)
parameterName - name of the configuration parameter.value - value contained by the configuration parameter.public Class<?> getType()
ComponentModel.public void setType(Class<?> type)
type - the type of the object to be created when processing this ComponentModel.public Optional<org.mule.runtime.api.component.TypedComponentIdentifier.ComponentType> getComponentType()
TypedComponentIdentifier.ComponentType of the object to be created when
processing this ComponentModel.public void setComponentType(org.mule.runtime.api.component.TypedComponentIdentifier.ComponentType componentType)
componentType - the TypedComponentIdentifier.ComponentType of the object to be
created when processing this ComponentModel.public String getNameAttribute()
public boolean isScope()
ComponentModel represents a org.mule.runtime.core.api.processor.MessageProcessor scope.public void setParent(ComponentModel parent)
public ComponentModel getParent()
public String getTextContent()
public void setComponentLocation(org.mule.runtime.dsl.api.component.config.DefaultComponentLocation componentLocation)
componentLocation - the location of the component in the configuration.public org.mule.runtime.dsl.api.component.config.DefaultComponentLocation getComponentLocation()
public Object getObjectInstance()
public void setObjectInstance(Object objectInstance)
ObjectProvider interface that require to be created before the
application components so they can be referenced.objectInstance - the object instance created from this model.public boolean isParameterValueProvidedBySchema(String parameterName)
parameterName - configuration parameter namepublic org.mule.runtime.dsl.api.component.config.ComponentConfiguration getConfiguration()
public void setEnabled(boolean enabled)
enabled - if this component is enabled and has to be created.public void executedOnEveryInnerComponent(Consumer<ComponentModel> task)
task - to be executed on inner components.public boolean isEnabled()
true if this component is enabled and has to be created.public String getSourceCode()
Copyright © 2003–2019 MuleSoft, Inc.. All rights reserved.