Class EclipseElementUtilsDecorator

    • Field Detail

      • delegate

        private final javax.lang.model.util.Elements delegate
    • Constructor Detail

      • EclipseElementUtilsDecorator

        EclipseElementUtilsDecorator​(javax.annotation.processing.ProcessingEnvironment processingEnv,
                                     javax.lang.model.element.TypeElement mapperElement)
    • Method Detail

      • replaceTypeElementIfNecessary

        protected javax.lang.model.element.TypeElement replaceTypeElementIfNecessary​(javax.lang.model.element.TypeElement element)
        When running during Eclipse Incremental Compilation, we might get a TypeElement that has an UnresolvedTypeBinding and which is not automatically resolved. In that case, getEnclosedElements returns an empty list. We take that as a hint to check if the TypeElement resolved by FQN might have any enclosed elements and, if so, return the resolved element.
        Specified by:
        replaceTypeElementIfNecessary in class AbstractElementUtilsDecorator
        Parameters:
        element - the original element
        Returns:
        the element freshly resolved using the qualified name, if the original element did not return any enclosed elements, whereas the resolved element does return enclosed elements.