use of org.mule.runtime.module.extension.internal.capability.xml.schema.model.NamedGroup in project mule by mulesoft.
the class ExecutableTypeSchemaDelegate method generateNestedProcessorElement.
private void generateNestedProcessorElement(ExtensionType type, NestedChainModel chainModel) {
final ExplicitGroup choice = new ExplicitGroup();
choice.setMinOccurs(chainModel.isRequired() ? ONE : ZERO);
choice.setMaxOccurs(UNBOUNDED);
chainModel.getAllowedStereotypes().forEach(stereotype -> {
// We need this to support both message-processor and mixed-content-message-processor
if (stereotype.equals(PROCESSOR)) {
NamedGroup group = builder.createGroup(MULE_MESSAGE_PROCESSOR_TYPE, true);
choice.getParticle().add(objectFactory.createGroup(group));
} else {
TopLevelElement localAbstractElementRef = builder.createRefElement(getSubstitutionGroup(stereotype), true);
choice.getParticle().add(objectFactory.createElement(localAbstractElementRef));
}
});
type.getSequence().getParticle().add(objectFactory.createChoice(choice));
if (chainModel.isRequired()) {
type.getSequence().setMinOccurs(ONE);
}
}
use of org.mule.runtime.module.extension.internal.capability.xml.schema.model.NamedGroup in project mule by mulesoft.
the class SchemaBuilder method createGroup.
NamedGroup createGroup(QName elementRef, boolean isRequired) {
NamedGroup namedGroup = new NamedGroup();
namedGroup.setRef(elementRef);
namedGroup.setMinOccurs(isRequired ? ONE : ZERO);
return namedGroup;
}
Aggregations