Search in sources :

Example 11 with JavaTypeElement

use of org.revapi.java.spi.JavaTypeElement in project revapi by revapi.

the class Removed method doEnd.

@Override
protected List<Difference> doEnd() {
    ActiveElements<JavaTypeElement> types = popIfActive();
    if (types != null) {
        TypeElement typeInNew = getNewTypeEnvironment().getElementUtils().getTypeElement(types.oldElement.getDeclaringElement().getQualifiedName());
        Difference difference = typeInNew == null ? createDifference(Code.CLASS_REMOVED, Code.attachmentsFor(types.oldElement, types.newElement)) : createDifference(Code.CLASS_EXTERNAL_CLASS_NO_LONGER_EXPOSED_IN_API, Code.attachmentsFor(types.oldElement, types.newElement));
        return Collections.singletonList(difference);
    }
    return null;
}
Also used : JavaTypeElement(org.revapi.java.spi.JavaTypeElement) TypeElement(javax.lang.model.element.TypeElement) Difference(org.revapi.Difference) JavaTypeElement(org.revapi.java.spi.JavaTypeElement)

Aggregations

JavaTypeElement (org.revapi.java.spi.JavaTypeElement)11 Difference (org.revapi.Difference)6 TypeElement (javax.lang.model.element.TypeElement)4 TypeMirror (javax.lang.model.type.TypeMirror)4 ArrayList (java.util.ArrayList)3 List (java.util.List)2 Nullable (javax.annotation.Nullable)2 DeclaredType (javax.lang.model.type.DeclaredType)2 UseSite (org.revapi.java.spi.UseSite)2 Types (javax.lang.model.util.Types)1 CoIterator (org.revapi.CoIterator)1 TypeElement (org.revapi.java.model.TypeElement)1 CheckBase (org.revapi.java.spi.CheckBase)1 Code (org.revapi.java.spi.Code)1 JavaModelElement (org.revapi.java.spi.JavaModelElement)1 Util (org.revapi.java.spi.Util)1