use of org.mule.runtime.module.extension.api.loader.java.type.WithElement 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