Search in sources :

Example 1 with Element

use of org.mule.runtime.module.extension.internal.capability.xml.schema.model.Element in project mule by mulesoft.

the class ConnectionProviderSchemaDelegate method registerConnectionProviderElement.

void registerConnectionProviderElement(ConnectionProviderModel providerModel, DslElementSyntax elementSyntax) {
    Element providerElement = new TopLevelElement();
    providerElement.setName(elementSyntax.getElementName());
    providerElement.setSubstitutionGroup(MULE_CONNECTION_PROVIDER_ELEMENT);
    LocalComplexType complexType = new LocalComplexType();
    providerElement.setComplexType(complexType);
    ExtensionType providerType = new ExtensionType();
    providerType.setBase(MULE_CONNECTION_PROVIDER_TYPE);
    ComplexContent complexContent = new ComplexContent();
    complexContent.setExtension(providerType);
    complexType.setComplexContent(complexContent);
    builder.getSchema().getSimpleTypeOrComplexTypeOrGroup().add(providerElement);
    final ExplicitGroup sequence = new ExplicitGroup();
    sequence.setMinOccurs(ZERO);
    sequence.setMaxOccurs(MAX_ONE);
    builder.addInfrastructureParameters(providerType, providerModel, sequence);
    providerModel.getParameterGroupModels().forEach(group -> {
        if (!group.isShowInDsl()) {
            builder.addParameterToSequence(builder.registerParameters(providerType, group.getParameterModels()), sequence);
        } else {
            builder.addInlineParameterGroup(group, sequence);
        }
    });
    providerType.setSequence(sequence);
}
Also used : TopLevelElement(org.mule.runtime.module.extension.internal.capability.xml.schema.model.TopLevelElement) TopLevelElement(org.mule.runtime.module.extension.internal.capability.xml.schema.model.TopLevelElement) Element(org.mule.runtime.module.extension.internal.capability.xml.schema.model.Element) ExtensionType(org.mule.runtime.module.extension.internal.capability.xml.schema.model.ExtensionType) LocalComplexType(org.mule.runtime.module.extension.internal.capability.xml.schema.model.LocalComplexType) ComplexContent(org.mule.runtime.module.extension.internal.capability.xml.schema.model.ComplexContent) ExplicitGroup(org.mule.runtime.module.extension.internal.capability.xml.schema.model.ExplicitGroup)

Example 2 with Element

use of org.mule.runtime.module.extension.internal.capability.xml.schema.model.Element in project mule by mulesoft.

the class OperationSchemaDelegate method registerProcessorElement.

void registerProcessorElement(ComponentModel componentModel, String typeName, DslElementSyntax dslSyntax) {
    Element element = new TopLevelElement();
    element.setName(dslSyntax.getElementName());
    element.setType(new QName(builder.getSchema().getTargetNamespace(), typeName));
    element.setAnnotation(builder.createDocAnnotation(componentModel.getDescription()));
    element.setSubstitutionGroup(getOperationSubstitutionGroup(componentModel));
    builder.getSchema().getSimpleTypeOrComplexTypeOrGroup().add(element);
}
Also used : TopLevelElement(org.mule.runtime.module.extension.internal.capability.xml.schema.model.TopLevelElement) QName(javax.xml.namespace.QName) TopLevelElement(org.mule.runtime.module.extension.internal.capability.xml.schema.model.TopLevelElement) Element(org.mule.runtime.module.extension.internal.capability.xml.schema.model.Element)

Example 3 with Element

use of org.mule.runtime.module.extension.internal.capability.xml.schema.model.Element in project mule by mulesoft.

the class ConfigurationSchemaDelegate method registerExtension.

private ExtensionType registerExtension(String name) {
    LocalComplexType complexType = new LocalComplexType();
    Element extension = new TopLevelElement();
    extension.setName(name);
    extension.setSubstitutionGroup(MULE_ABSTRACT_SHARED_EXTENSION);
    extension.setComplexType(complexType);
    ComplexContent complexContent = new ComplexContent();
    complexType.setComplexContent(complexContent);
    ExtensionType complexContentExtension = new ExtensionType();
    complexContentExtension.setBase(MULE_ABSTRACT_EXTENSION_TYPE);
    complexContent.setExtension(complexContentExtension);
    schema.getSimpleTypeOrComplexTypeOrGroup().add(extension);
    return complexContentExtension;
}
Also used : TopLevelElement(org.mule.runtime.module.extension.internal.capability.xml.schema.model.TopLevelElement) TopLevelElement(org.mule.runtime.module.extension.internal.capability.xml.schema.model.TopLevelElement) Element(org.mule.runtime.module.extension.internal.capability.xml.schema.model.Element) ExtensionType(org.mule.runtime.module.extension.internal.capability.xml.schema.model.ExtensionType) LocalComplexType(org.mule.runtime.module.extension.internal.capability.xml.schema.model.LocalComplexType) ComplexContent(org.mule.runtime.module.extension.internal.capability.xml.schema.model.ComplexContent)

Example 4 with Element

use of org.mule.runtime.module.extension.internal.capability.xml.schema.model.Element in project mule by mulesoft.

the class SourceSchemaDelegate method registerSourceElement.

private void registerSourceElement(SourceModel sourceModel, String typeName, DslElementSyntax dslSyntax) {
    Element element = new TopLevelElement();
    element.setName(dslSyntax.getElementName());
    element.setType(new QName(builder.getSchema().getTargetNamespace(), typeName));
    element.setAnnotation(builder.createDocAnnotation(sourceModel.getDescription()));
    element.setSubstitutionGroup(getSourceSubstitutionGroup(sourceModel));
    builder.getSchema().getSimpleTypeOrComplexTypeOrGroup().add(element);
}
Also used : TopLevelElement(org.mule.runtime.module.extension.internal.capability.xml.schema.model.TopLevelElement) QName(javax.xml.namespace.QName) TopLevelElement(org.mule.runtime.module.extension.internal.capability.xml.schema.model.TopLevelElement) Element(org.mule.runtime.module.extension.internal.capability.xml.schema.model.Element)

Aggregations

Element (org.mule.runtime.module.extension.internal.capability.xml.schema.model.Element)4 TopLevelElement (org.mule.runtime.module.extension.internal.capability.xml.schema.model.TopLevelElement)4 QName (javax.xml.namespace.QName)2 ComplexContent (org.mule.runtime.module.extension.internal.capability.xml.schema.model.ComplexContent)2 ExtensionType (org.mule.runtime.module.extension.internal.capability.xml.schema.model.ExtensionType)2 LocalComplexType (org.mule.runtime.module.extension.internal.capability.xml.schema.model.LocalComplexType)2 ExplicitGroup (org.mule.runtime.module.extension.internal.capability.xml.schema.model.ExplicitGroup)1