use of org.mule.runtime.api.meta.model.declaration.fluent.ConstructDeclaration in project mule by mulesoft.
the class ErrorsDeclarationEnricher method collectErrorOperations.
private List<Pair<ComponentDeclaration, MethodElement>> collectErrorOperations(ExtensionDeclaration declaration) {
List<Pair<ComponentDeclaration, MethodElement>> operations = new LinkedList<>();
new IdempotentDeclarationWalker() {
@Override
public void onOperation(WithOperationsDeclaration owner, OperationDeclaration declaration) {
addComponent(declaration);
}
@Override
protected void onConstruct(ConstructDeclaration declaration) {
addComponent(declaration);
}
private void addComponent(ComponentDeclaration<?> declaration) {
declaration.getModelProperty(ExtensionOperationDescriptorModelProperty.class).ifPresent(implementingMethodModelProperty -> operations.add(new Pair<>(declaration, implementingMethodModelProperty.getOperationMethod())));
}
}.walk(declaration);
return operations;
}
Aggregations