public class ApplicationModel extends Object implements org.mule.runtime.ast.api.ArtifactAst
ApplicationModel holds a representation of all the artifact configuration using an abstract model to represent any
configuration option.
This model is represented by a set of ComponentModel. Each ComponentModel holds a piece of configuration and
may have children ComponentModels as defined in the artifact configuration.
Once the set of ComponentModel gets created from the application ConfigFiles the ApplicationModel
executes a set of common validations dictated by the configuration semantics.| Modifier and Type | Field and Description |
|---|---|
static org.mule.runtime.api.component.ComponentIdentifier |
ANNOTATIONS_ELEMENT_IDENTIFIER |
static String |
BATCH_NAMESPACE |
static String |
CLASS_ATTRIBUTE |
static String |
CUSTOM_TRANSFORMER |
static org.mule.runtime.api.component.ComponentIdentifier |
CUSTOM_TRANSFORMER_IDENTIFIER |
static String |
DESCRIPTION_ELEMENT |
static org.mule.runtime.api.component.ComponentIdentifier |
DESCRIPTION_IDENTIFIER |
static org.mule.runtime.api.component.ComponentIdentifier |
DOC_DESCRIPTION_IDENTIFIER |
static String |
DOC_NAMESPACE |
static String |
ERROR_MAPPING |
static org.mule.runtime.api.component.ComponentIdentifier |
ERROR_MAPPING_IDENTIFIER |
static String |
EXCEPTION_STRATEGY_REFERENCE_ELEMENT |
static org.mule.runtime.api.component.ComponentIdentifier |
EXCEPTION_STRATEGY_REFERENCE_IDENTIFIER |
static String |
GLOBAL_PROPERTY |
static org.mule.runtime.api.component.ComponentIdentifier |
GLOBAL_PROPERTY_IDENTIFIER |
static String |
HTTP_POLICY |
static org.mule.runtime.api.component.ComponentIdentifier |
HTTP_PROXY_OPERATION_IDENTIFIER |
static org.mule.runtime.api.component.ComponentIdentifier |
HTTP_PROXY_POLICY_IDENTIFIER |
static org.mule.runtime.api.component.ComponentIdentifier |
HTTP_PROXY_SOURCE_POLICY_IDENTIFIER |
static String |
MAX_REDELIVERY_ATTEMPTS_ROLLBACK_ES_ATTRIBUTE |
static org.mule.runtime.api.component.ComponentIdentifier |
MODULE_OPERATION_CHAIN |
static org.mule.runtime.api.component.ComponentIdentifier |
MULE_PROPERTIES_IDENTIFIER |
static org.mule.runtime.api.component.ComponentIdentifier |
MULE_PROPERTY_IDENTIFIER |
static String |
MULE_SECURITY_NAMESPACE |
static String |
MULE_XML_NAMESPACE |
static org.mule.runtime.api.component.ComponentIdentifier |
MUNIT_AFTER_SUITE_IDENTIFIER |
static org.mule.runtime.api.component.ComponentIdentifier |
MUNIT_AFTER_TEST_IDENTIFIER |
static org.mule.runtime.api.component.ComponentIdentifier |
MUNIT_BEFORE_SUITE_IDENTIFIER |
static org.mule.runtime.api.component.ComponentIdentifier |
MUNIT_BEFORE_TEST_IDENTIFIER |
static String |
MUNIT_PREFIX |
static org.mule.runtime.api.component.ComponentIdentifier |
MUNIT_TEST_IDENTIFIER |
static String |
NAME_ATTRIBUTE |
static String |
OBJECT_ELEMENT |
static org.mule.runtime.api.component.ComponentIdentifier |
OBJECT_IDENTIFIER |
static String |
ON_ERROR |
static org.mule.runtime.api.component.ComponentIdentifier |
ON_ERROR_IDENTIFIER |
static String |
PARSER_TEST_NAMESPACE |
static String |
PGP_NAMESPACE |
static String |
POLICY_ROOT_ELEMENT |
static String |
PROPERTIES_ELEMENT |
static String |
PROPERTY_ELEMENT |
static String |
REDELIVERY_POLICY_ELEMENT |
static org.mule.runtime.api.component.ComponentIdentifier |
REDELIVERY_POLICY_IDENTIFIER |
static String |
REFERENCE_ATTRIBUTE |
static String |
SECURITY_MANAGER |
static org.mule.runtime.api.component.ComponentIdentifier |
SECURITY_MANAGER_IDENTIFIER |
static String |
SPRING_SECURITY_NAMESPACE |
static String |
TEST_NAMESPACE |
static org.mule.runtime.api.component.ComponentIdentifier |
TRANSFORMER_IDENTIFIER |
static String |
TRANSFORMER_REFERENCE_ELEMENT |
static String |
TYPE_ES_ATTRIBUTE |
static String |
VALUE_ATTRIBUTE |
static String |
WHEN_CHOICE_ES_ATTRIBUTE |
static String |
XSL_NAMESPACE |
| Constructor and Description |
|---|
ApplicationModel(ArtifactConfig artifactConfig,
org.mule.runtime.app.declaration.api.ArtifactDeclaration artifactDeclaration,
ResourceProvider externalResourceProvider)
Creates an {code ApplicationModel} from a
ArtifactConfig. |
ApplicationModel(ArtifactConfig artifactConfig,
org.mule.runtime.app.declaration.api.ArtifactDeclaration artifactDeclaration,
Set<org.mule.runtime.api.meta.model.ExtensionModel> extensionModels,
Map<String,String> deploymentProperties,
Optional<org.mule.runtime.api.component.ConfigurationProperties> parentConfigurationProperties,
Optional<ComponentBuildingDefinitionRegistry> componentBuildingDefinitionRegistry,
ResourceProvider externalResourceProvider)
Creates an {code ApplicationModel} from a
ArtifactConfig. |
ApplicationModel(ArtifactConfig artifactConfig,
org.mule.runtime.app.declaration.api.ArtifactDeclaration artifactDeclaration,
Set<org.mule.runtime.api.meta.model.ExtensionModel> extensionModels,
Map<String,String> deploymentProperties,
Optional<org.mule.runtime.api.component.ConfigurationProperties> parentConfigurationProperties,
Optional<ComponentBuildingDefinitionRegistry> componentBuildingDefinitionRegistry,
ResourceProvider externalResourceProvider,
boolean runtimeMode) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
executeOnEveryComponentTree(Consumer<ComponentModel> task) |
void |
executeOnEveryFlow(Consumer<ComponentModel> task) |
void |
executeOnEveryMuleComponentTree(Consumer<ComponentModel> task) |
void |
executeOnEveryRootElement(Consumer<ComponentModel> task) |
void |
executeOnlyOnMuleRoot(Consumer<ComponentModel> task) |
Optional<ComponentModel> |
findComponentDefinitionModel(org.mule.runtime.api.component.ComponentIdentifier componentIdentifier) |
Optional<ComponentModel> |
findNamedElement(String name)
Find a named component.
|
Optional<ComponentModel> |
findTopLevelNamedComponent(String name)
Find a named component configuration.
|
org.mule.runtime.api.component.ConfigurationProperties |
getConfigurationProperties() |
ComponentModel |
getRootComponentModel()
TODO MULE-9688: When the model it's made immutable we will also provide the parent component for navigation and this will not
be needed anymore.
|
void |
macroExpandXmlSdkComponents(Set<org.mule.runtime.api.meta.model.ExtensionModel> extensionModels) |
Spliterator<org.mule.runtime.ast.api.ComponentAst> |
recursiveSpliterator() |
Stream<org.mule.runtime.ast.api.ComponentAst> |
recursiveStream() |
Stream<org.mule.runtime.api.util.Pair<org.mule.runtime.ast.api.ComponentAst,List<org.mule.runtime.ast.api.ComponentAst>>> |
recursiveStreamWithHierarchy() |
void |
resolveComponentTypes()
Resolves the types of each component model when possible.
|
Spliterator<org.mule.runtime.ast.api.ComponentAst> |
topLevelComponentsSpliterator() |
Stream<org.mule.runtime.ast.api.ComponentAst> |
topLevelComponentsStream() |
public static final String POLICY_ROOT_ELEMENT
public static final String ERROR_MAPPING
public static final String ON_ERROR
public static final String MAX_REDELIVERY_ATTEMPTS_ROLLBACK_ES_ATTRIBUTE
public static final String WHEN_CHOICE_ES_ATTRIBUTE
public static final String TYPE_ES_ATTRIBUTE
public static final String EXCEPTION_STRATEGY_REFERENCE_ELEMENT
public static final String PROPERTY_ELEMENT
public static final String NAME_ATTRIBUTE
public static final String REFERENCE_ATTRIBUTE
public static final String VALUE_ATTRIBUTE
public static final String TRANSFORMER_REFERENCE_ELEMENT
public static final String CUSTOM_TRANSFORMER
public static final String DESCRIPTION_ELEMENT
public static final String PROPERTIES_ELEMENT
public static final String REDELIVERY_POLICY_ELEMENT
public static final String TEST_NAMESPACE
public static final String DOC_NAMESPACE
public static final String SPRING_SECURITY_NAMESPACE
public static final String MULE_SECURITY_NAMESPACE
public static final String MULE_XML_NAMESPACE
public static final String PGP_NAMESPACE
public static final String XSL_NAMESPACE
public static final String BATCH_NAMESPACE
public static final String PARSER_TEST_NAMESPACE
public static final String GLOBAL_PROPERTY
public static final String SECURITY_MANAGER
public static final String OBJECT_ELEMENT
public static final org.mule.runtime.api.component.ComponentIdentifier EXCEPTION_STRATEGY_REFERENCE_IDENTIFIER
public static final org.mule.runtime.api.component.ComponentIdentifier ERROR_MAPPING_IDENTIFIER
public static final org.mule.runtime.api.component.ComponentIdentifier ON_ERROR_IDENTIFIER
public static final org.mule.runtime.api.component.ComponentIdentifier MULE_PROPERTY_IDENTIFIER
public static final org.mule.runtime.api.component.ComponentIdentifier MULE_PROPERTIES_IDENTIFIER
public static final org.mule.runtime.api.component.ComponentIdentifier ANNOTATIONS_ELEMENT_IDENTIFIER
public static final org.mule.runtime.api.component.ComponentIdentifier TRANSFORMER_IDENTIFIER
public static final org.mule.runtime.api.component.ComponentIdentifier CUSTOM_TRANSFORMER_IDENTIFIER
public static final org.mule.runtime.api.component.ComponentIdentifier DOC_DESCRIPTION_IDENTIFIER
public static final org.mule.runtime.api.component.ComponentIdentifier DESCRIPTION_IDENTIFIER
public static final org.mule.runtime.api.component.ComponentIdentifier OBJECT_IDENTIFIER
public static final org.mule.runtime.api.component.ComponentIdentifier REDELIVERY_POLICY_IDENTIFIER
public static final org.mule.runtime.api.component.ComponentIdentifier GLOBAL_PROPERTY_IDENTIFIER
public static final org.mule.runtime.api.component.ComponentIdentifier SECURITY_MANAGER_IDENTIFIER
public static final org.mule.runtime.api.component.ComponentIdentifier MODULE_OPERATION_CHAIN
public static final String MUNIT_PREFIX
public static final org.mule.runtime.api.component.ComponentIdentifier MUNIT_TEST_IDENTIFIER
public static final org.mule.runtime.api.component.ComponentIdentifier MUNIT_BEFORE_TEST_IDENTIFIER
public static final org.mule.runtime.api.component.ComponentIdentifier MUNIT_BEFORE_SUITE_IDENTIFIER
public static final org.mule.runtime.api.component.ComponentIdentifier MUNIT_AFTER_TEST_IDENTIFIER
public static final org.mule.runtime.api.component.ComponentIdentifier MUNIT_AFTER_SUITE_IDENTIFIER
public static final String HTTP_POLICY
public static final org.mule.runtime.api.component.ComponentIdentifier HTTP_PROXY_SOURCE_POLICY_IDENTIFIER
public static final org.mule.runtime.api.component.ComponentIdentifier HTTP_PROXY_OPERATION_IDENTIFIER
public static final org.mule.runtime.api.component.ComponentIdentifier HTTP_PROXY_POLICY_IDENTIFIER
public static final String CLASS_ATTRIBUTE
public ApplicationModel(ArtifactConfig artifactConfig, org.mule.runtime.app.declaration.api.ArtifactDeclaration artifactDeclaration, ResourceProvider externalResourceProvider) throws Exception
ArtifactConfig.
A set of validations are applied that may make creation fail.artifactConfig - the mule artifact configuration content.artifactDeclaration - an ArtifactDeclarationException - when the application configuration has semantic errors.public ApplicationModel(ArtifactConfig artifactConfig, org.mule.runtime.app.declaration.api.ArtifactDeclaration artifactDeclaration, Set<org.mule.runtime.api.meta.model.ExtensionModel> extensionModels, Map<String,String> deploymentProperties, Optional<org.mule.runtime.api.component.ConfigurationProperties> parentConfigurationProperties, Optional<ComponentBuildingDefinitionRegistry> componentBuildingDefinitionRegistry, ResourceProvider externalResourceProvider) throws Exception
ArtifactConfig.
A set of validations are applied that may make creation fail.artifactConfig - the mule artifact configuration content.artifactDeclaration - an ArtifactDeclarationextensionModels - Set of extensionModels that will be used to type componentModelsparentConfigurationProperties - the ConfigurationProperties of the parent artifact. For instance, application
will receive the domain resolver.componentBuildingDefinitionRegistry - an optional ComponentBuildingDefinitionRegistry used to correlate items in
this model to their definitions expanded) false implies the mule is being created from a tooling perspective.externalResourceProvider - the provider for configuration properties files and ${file::name.txt} placeholdersException - when the application configuration has semantic errors.public ApplicationModel(ArtifactConfig artifactConfig, org.mule.runtime.app.declaration.api.ArtifactDeclaration artifactDeclaration, Set<org.mule.runtime.api.meta.model.ExtensionModel> extensionModels, Map<String,String> deploymentProperties, Optional<org.mule.runtime.api.component.ConfigurationProperties> parentConfigurationProperties, Optional<ComponentBuildingDefinitionRegistry> componentBuildingDefinitionRegistry, ResourceProvider externalResourceProvider, boolean runtimeMode) throws Exception
Exceptionpublic void macroExpandXmlSdkComponents(Set<org.mule.runtime.api.meta.model.ExtensionModel> extensionModels)
public void close()
public void resolveComponentTypes()
public Optional<ComponentModel> findComponentDefinitionModel(org.mule.runtime.api.component.ComponentIdentifier componentIdentifier)
public void executeOnEveryComponentTree(Consumer<ComponentModel> task)
public void executeOnEveryMuleComponentTree(Consumer<ComponentModel> task)
public void executeOnlyOnMuleRoot(Consumer<ComponentModel> task)
public void executeOnEveryRootElement(Consumer<ComponentModel> task)
public void executeOnEveryFlow(Consumer<ComponentModel> task)
public ComponentModel getRootComponentModel()
public Optional<ComponentModel> findTopLevelNamedComponent(String name)
name - the expected value for the name attribute configuration.Optionalpublic Optional<ComponentModel> findNamedElement(String name)
name - the expected value for the name attribute configuration.Optionalpublic org.mule.runtime.api.component.ConfigurationProperties getConfigurationProperties()
public Stream<org.mule.runtime.ast.api.ComponentAst> recursiveStream()
recursiveStream in interface org.mule.runtime.ast.api.ArtifactAstpublic Stream<org.mule.runtime.api.util.Pair<org.mule.runtime.ast.api.ComponentAst,List<org.mule.runtime.ast.api.ComponentAst>>> recursiveStreamWithHierarchy()
public Spliterator<org.mule.runtime.ast.api.ComponentAst> recursiveSpliterator()
recursiveSpliterator in interface org.mule.runtime.ast.api.ArtifactAstpublic Stream<org.mule.runtime.ast.api.ComponentAst> topLevelComponentsStream()
topLevelComponentsStream in interface org.mule.runtime.ast.api.ArtifactAstpublic Spliterator<org.mule.runtime.ast.api.ComponentAst> topLevelComponentsSpliterator()
topLevelComponentsSpliterator in interface org.mule.runtime.ast.api.ArtifactAstCopyright © 2003–2020 MuleSoft, Inc.. All rights reserved.