use of org.mule.runtime.api.meta.model.EnrichableModel in project mule by mulesoft.
the class AnnotationProcessorProblemsHandler method getElement.
private Element getElement(NamedObject component) {
if (component instanceof EnrichableModel) {
EnrichableModel enrichableModel = (EnrichableModel) component;
Element element;
element = getElement(enrichableModel, ExtensionOperationDescriptorModelProperty.class, mp -> mp.getOperationMethod().getElement());
if (element != null) {
return element;
}
element = getElement(enrichableModel, ExtensionParameterDescriptorModelProperty.class, mp -> mp.getExtensionParameter().getElement());
if (element != null) {
return element;
}
element = getElement(enrichableModel, ExtensionTypeDescriptorModelProperty.class, mp -> mp.getType().getElement());
if (element != null) {
return element;
}
}
if (component instanceof WithElement) {
Optional<? extends Element> optionalElement = ((WithElement) component).getElement();
if (optionalElement.isPresent()) {
return optionalElement.get();
}
}
return null;
}
Aggregations