Package org.mapstruct.ap.internal.util
Class EclipseElementUtilsDecorator
- java.lang.Object
-
- org.mapstruct.ap.internal.util.AbstractElementUtilsDecorator
-
- org.mapstruct.ap.internal.util.EclipseElementUtilsDecorator
-
- All Implemented Interfaces:
Elements
,ElementUtils
public class EclipseElementUtilsDecorator extends AbstractElementUtilsDecorator
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface javax.lang.model.util.Elements
Elements.Origin
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected TypeElement
replaceTypeElementIfNecessary(TypeElement element)
When running during Eclipse Incremental Compilation, we might get a TypeElement that has an UnresolvedTypeBinding and which is not automatically resolved.-
Methods inherited from class org.mapstruct.ap.internal.util.AbstractElementUtilsDecorator
getAllAnnotationMirrors, getAllEnclosedExecutableElements, getAllEnclosedFields, getAllMembers, getBinaryName, getConstantExpression, getDocComment, getElementValuesWithDefaults, getName, getPackageElement, getPackageOf, getTypeElement, hides, isDeprecated, isFunctionalInterface, overrides, printElements
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javax.lang.model.util.Elements
getAllModuleElements, getAllPackageElements, getAllTypeElements, getModuleElement, getModuleOf, getOrigin, getOrigin, getOrigin, getPackageElement, getTypeElement, isBridge
-
-
-
-
Method Detail
-
replaceTypeElementIfNecessary
protected TypeElement replaceTypeElementIfNecessary(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 classAbstractElementUtilsDecorator
- 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.
-
-