Search in sources :

Example 1 with EE_PREFIX

use of org.mule.runtime.internal.dsl.DslConstants.EE_PREFIX in project mule by mulesoft.

the class DefaultXmlDslElementModelConverter method createTransformTextElement.

private Element createTransformTextElement(ComponentConfiguration config) {
    String namespaceURI = EE_NAMESPACE;
    String eeSchemaLocation = buildSchemaLocation(EE_PREFIX, EE_NAMESPACE);
    addNamespaceDeclarationIfNeeded(EE_PREFIX, namespaceURI, eeSchemaLocation);
    Element nested = doc.createElementNS(namespaceURI, EE_PREFIX + ":" + config.getIdentifier().getName());
    config.getParameters().forEach(nested::setAttribute);
    config.getNestedComponents().stream().filter(inner -> inner.getValue().isPresent()).forEach(inner -> nested.appendChild(doc.createCDATASection(inner.getValue().get())));
    return nested;
}
Also used : Optional.empty(java.util.Optional.empty) ParameterModel(org.mule.runtime.api.meta.model.parameter.ParameterModel) EE_NAMESPACE(org.mule.runtime.internal.dsl.DslConstants.EE_NAMESPACE) RECONNECT_FOREVER_ELEMENT_IDENTIFIER(org.mule.runtime.internal.dsl.DslConstants.RECONNECT_FOREVER_ELEMENT_IDENTIFIER) CORE_PREFIX(org.mule.runtime.internal.dsl.DslConstants.CORE_PREFIX) ComponentIdentifier.buildFromStringRepresentation(org.mule.runtime.api.component.ComponentIdentifier.buildFromStringRepresentation) CONFIG_ATTRIBUTE_NAME(org.mule.runtime.internal.dsl.DslConstants.CONFIG_ATTRIBUTE_NAME) POOLING_PROFILE_ELEMENT_IDENTIFIER(org.mule.runtime.internal.dsl.DslConstants.POOLING_PROFILE_ELEMENT_IDENTIFIER) ComponentModel(org.mule.runtime.api.meta.model.ComponentModel) TLS_PARAMETER_NAME(org.mule.runtime.extension.api.ExtensionConstants.TLS_PARAMETER_NAME) Preconditions.checkArgument(org.mule.runtime.api.util.Preconditions.checkArgument) CORE_NAMESPACE(org.mule.runtime.internal.dsl.DslConstants.CORE_NAMESPACE) XmlDslElementModelConverter(org.mule.runtime.config.api.dsl.model.XmlDslElementModelConverter) ComponentConfiguration(org.mule.runtime.dsl.api.component.config.ComponentConfiguration) Attr(org.w3c.dom.Attr) TRANSFORM_IDENTIFIER(org.mule.runtime.config.internal.dsl.declaration.DefaultXmlArtifactDeclarationLoader.TRANSFORM_IDENTIFIER) REDELIVERY_POLICY_ELEMENT_IDENTIFIER(org.mule.runtime.internal.dsl.DslConstants.REDELIVERY_POLICY_ELEMENT_IDENTIFIER) Arrays.asList(java.util.Arrays.asList) Document(org.w3c.dom.Document) TLS_PREFIX(org.mule.runtime.internal.dsl.DslConstants.TLS_PREFIX) TARGET_PARAMETER_NAME(org.mule.runtime.extension.api.ExtensionConstants.TARGET_PARAMETER_NAME) TLS_CONTEXT_ELEMENT_IDENTIFIER(org.mule.runtime.internal.dsl.DslConstants.TLS_CONTEXT_ELEMENT_IDENTIFIER) REDELIVERY_POLICY_PARAMETER_NAME(org.mule.runtime.extension.api.ExtensionConstants.REDELIVERY_POLICY_PARAMETER_NAME) DECLARED_PREFIX(org.mule.runtime.config.internal.dsl.processor.xml.XmlCustomAttributeHandler.DECLARED_PREFIX) RECONNECTION_ELEMENT_IDENTIFIER(org.mule.runtime.internal.dsl.DslConstants.RECONNECTION_ELEMENT_IDENTIFIER) Stream.of(java.util.stream.Stream.of) RECONNECTION_STRATEGY_PARAMETER_NAME(org.mule.runtime.extension.api.ExtensionConstants.RECONNECTION_STRATEGY_PARAMETER_NAME) ConfigurationModel(org.mule.runtime.api.meta.model.config.ConfigurationModel) POOLING_PROFILE_PARAMETER_NAME(org.mule.runtime.extension.api.ExtensionConstants.POOLING_PROFILE_PARAMETER_NAME) NAME_ATTRIBUTE_NAME(org.mule.runtime.internal.dsl.DslConstants.NAME_ATTRIBUTE_NAME) ExtensionModelUtils(org.mule.runtime.extension.api.util.ExtensionModelUtils) XmlModelUtils.buildSchemaLocation(org.mule.runtime.extension.api.util.XmlModelUtils.buildSchemaLocation) DslElementModel(org.mule.runtime.config.api.dsl.model.DslElementModel) List(java.util.List) Element(org.w3c.dom.Element) StringUtils.isBlank(org.apache.commons.lang3.StringUtils.isBlank) DslElementSyntax(org.mule.runtime.extension.api.dsl.syntax.DslElementSyntax) Reference(org.mule.runtime.api.util.Reference) IS_CDATA(org.mule.runtime.config.internal.dsl.processor.xml.XmlCustomAttributeHandler.IS_CDATA) MetadataType(org.mule.metadata.api.model.MetadataType) Optional(java.util.Optional) EE_PREFIX(org.mule.runtime.internal.dsl.DslConstants.EE_PREFIX) Element(org.w3c.dom.Element)

Aggregations

Arrays.asList (java.util.Arrays.asList)1 List (java.util.List)1 Optional (java.util.Optional)1 Optional.empty (java.util.Optional.empty)1 Stream.of (java.util.stream.Stream.of)1 StringUtils.isBlank (org.apache.commons.lang3.StringUtils.isBlank)1 MetadataType (org.mule.metadata.api.model.MetadataType)1 ComponentIdentifier.buildFromStringRepresentation (org.mule.runtime.api.component.ComponentIdentifier.buildFromStringRepresentation)1 ComponentModel (org.mule.runtime.api.meta.model.ComponentModel)1 ConfigurationModel (org.mule.runtime.api.meta.model.config.ConfigurationModel)1 ParameterModel (org.mule.runtime.api.meta.model.parameter.ParameterModel)1 Preconditions.checkArgument (org.mule.runtime.api.util.Preconditions.checkArgument)1 Reference (org.mule.runtime.api.util.Reference)1 DslElementModel (org.mule.runtime.config.api.dsl.model.DslElementModel)1 XmlDslElementModelConverter (org.mule.runtime.config.api.dsl.model.XmlDslElementModelConverter)1 TRANSFORM_IDENTIFIER (org.mule.runtime.config.internal.dsl.declaration.DefaultXmlArtifactDeclarationLoader.TRANSFORM_IDENTIFIER)1 DECLARED_PREFIX (org.mule.runtime.config.internal.dsl.processor.xml.XmlCustomAttributeHandler.DECLARED_PREFIX)1 IS_CDATA (org.mule.runtime.config.internal.dsl.processor.xml.XmlCustomAttributeHandler.IS_CDATA)1 ComponentConfiguration (org.mule.runtime.dsl.api.component.config.ComponentConfiguration)1 POOLING_PROFILE_PARAMETER_NAME (org.mule.runtime.extension.api.ExtensionConstants.POOLING_PROFILE_PARAMETER_NAME)1