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);
}
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);
}
}
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);
}
}
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);
}
}
}
}
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());
}
}
Aggregations