Search in sources :

Example 96 with Element

use of org.hl7.elm.r1.Element in project mule-migration-assistant by mulesoft.

the class IpFilterProcessorChainTagMigrationStep method migrateContent.

@Override
protected void migrateContent(Element errorHandlerElement, final List<Content> cloneContentList) {
    Element onErrorContinueElement = new IpFilterOnErrorContinueElementWriter().create(errorHandlerElement, false);
    onErrorContinueElement.addContent(0, cloneContentList);
    com.mulesoft.tools.migration.library.mule.steps.http.HttpConnectorListener.httpListenerLib(getApplicationModel());
    addNamespaceDeclaration(getRootElement(onErrorContinueElement), HTTP_TRANSFORM_NAMESPACE, HTTP_TRANSFORM_XSI_SCHEMA_LOCATION_URI_MULE4);
}
Also used : Element(org.jdom2.Element) IpFilterOnErrorContinueElementWriter(com.mulesoft.tools.migration.library.gateway.steps.policy.utils.IpFilterOnErrorContinueElementWriter)

Example 97 with Element

use of org.hl7.elm.r1.Element in project mule-migration-assistant by mulesoft.

the class IpFilterTagMigrationStep method moveElement.

private void moveElement(Element element) {
    final List<Content> content = detachContent(element.getContent());
    Element root = getRootElement(element);
    Parent parent = element.getParent();
    if (root != null && parent != null) {
        parent.addContent(0, content);
        parent.removeContent(element);
        root.addContent(element);
    }
}
Also used : Parent(org.jdom2.Parent) Content(org.jdom2.Content) Element(org.jdom2.Element)

Example 98 with Element

use of org.hl7.elm.r1.Element in project mule-migration-assistant by mulesoft.

the class AbstractThreatProtectionMigrationStep method replaceNamespace.

protected void replaceNamespace(Element element, Namespace mule4Namespace, String mule4SchemaLocationUri, String mule4SchemaLocationUriXsd) {
    Element root = getRootElement(element);
    if (root != null) {
        root.addNamespaceDeclaration(mule4Namespace);
        root.removeNamespaceDeclaration(THREAT_PROTECTION_GW_NAMESPACE);
        replaceSchemaLocationNamespace(root, THREAT_PROTECTION_XSI_SCHEMA_LOCATION_URI_MULE3_XSD, mule4SchemaLocationUriXsd, THREAT_PROTECTION_XSI_SCHEMA_LOCATION_URI_MULE3, mule4SchemaLocationUri);
    }
}
Also used : Element(org.jdom2.Element)

Example 99 with Element

use of org.hl7.elm.r1.Element in project mule-migration-assistant by mulesoft.

the class AbstractBasicStructureMigrationStep method replaceNamespace.

protected void replaceNamespace(final List<Content> cloneContentList) {
    for (final Content content : cloneContentList) {
        if (content instanceof Element) {
            Element e = (Element) content;
            final String namespacePrefix = e.getNamespacePrefix();
            if (namespacePrefix.isEmpty() || namespacePrefix.equals(MULE_4_TAG_NAME)) {
                e.setNamespace(MULE_4_CORE_NAMESPACE_NO_PREFIX);
            }
        }
    }
}
Also used : Content(org.jdom2.Content) Element(org.jdom2.Element)

Example 100 with Element

use of org.hl7.elm.r1.Element in project mule-migration-assistant by mulesoft.

the class AfterExceptionTagMigrationStep method completeTryElement.

private void completeTryElement(Element source, List<Content> elementCloneContentList) {
    Element tryElement = source.getChild(PolicyMigrationStep.TRY_TAG_NAME, MULE_4_CORE_NAMESPACE_NO_PREFIX);
    if (tryElement.getChild(PolicyMigrationStep.ERROR_HANDLER_TAG_NAME, MULE_4_POLICY_NAMESPACE) == null) {
        tryElement.addContent(getErrorHandlerElement(elementCloneContentList));
    } else {
        Element errorHandlerElement = tryElement.getChild(PolicyMigrationStep.ERROR_HANDLER_TAG_NAME, MULE_4_POLICY_NAMESPACE);
        errorHandlerElement.addContent(elementCloneContentList);
        replaceNamespace(errorHandlerElement.getContent());
    }
}
Also used : Element(org.jdom2.Element)

Aggregations

Element (org.jdom2.Element)3601 Complex (org.hl7.fhir.r4.utils.formats.Turtle.Complex)659 ArrayList (java.util.ArrayList)616 Document (org.jdom2.Document)589 Complex (org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)488 Complex (org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)486 Test (org.junit.Test)474 IOException (java.io.IOException)414 JDOMException (org.jdom2.JDOMException)230 Attribute (org.jdom2.Attribute)217 List (java.util.List)189 SAXBuilder (org.jdom2.input.SAXBuilder)169 File (java.io.File)162 FHIRException (org.hl7.fhir.exceptions.FHIRException)162 HashMap (java.util.HashMap)159 Namespace (org.jdom2.Namespace)157 Test (org.junit.jupiter.api.Test)154 Element (org.osate.aadl2.Element)143 XMLOutputter (org.jdom2.output.XMLOutputter)136 XConfiguration (org.apache.oozie.util.XConfiguration)98