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