use of japicmp.model.JApiImplementedInterface in project japicmp-gradle-plugin by melix.
the class Violation method describe.
public static String describe(JApiCompatibility member) {
if (member instanceof JApiAnnotation) {
return "Annotation " + ((JApiAnnotation) member).getFullyQualifiedName();
}
if (member instanceof JApiAnnotationElement) {
return "Annotation element " + ((JApiAnnotationElement) member).getName();
}
if (member instanceof JApiConstructor) {
JApiConstructor method = (JApiConstructor) member;
Optional<CtConstructor> changedMethod = method.getNewConstructor();
if (!changedMethod.isPresent()) {
changedMethod = method.getOldConstructor();
}
return "Constructor " + (changedMethod.isPresent() ? changedMethod.get().getLongName() : method.getName());
}
if (member instanceof JApiMethod) {
JApiMethod method = (JApiMethod) member;
Optional<CtMethod> changedMethod = method.getNewMethod();
if (!changedMethod.isPresent()) {
changedMethod = method.getOldMethod();
}
return "Method " + (changedMethod.isPresent() ? changedMethod.get().getLongName() : method.getName());
}
if (member instanceof JApiField) {
return "Field " + ((JApiField) member).getName();
}
if (member instanceof JApiClass) {
return "Class " + ((JApiClass) member).getFullyQualifiedName();
}
if (member instanceof JApiSuperclass) {
Optional<JApiClass> jApiClass = ((JApiSuperclass) member).getJApiClass();
return "Superclass " + (jApiClass.isPresent() ? jApiClass.get() : "[removed]");
}
if (member instanceof JApiImplementedInterface) {
return "Implemented interface " + ((JApiImplementedInterface) member).getFullyQualifiedName();
}
return member.toString();
}
use of japicmp.model.JApiImplementedInterface in project japicmp-gradle-plugin by melix.
the class ViolationsGenerator method processClass.
private void processClass(final JApiClass clazz, final Context context) {
String oldClass = context.currentClass;
try {
context.currentClass = clazz.getFullyQualifiedName();
processAllChanges(clazz, context);
for (JApiField field : clazz.getFields()) {
processAllChanges(field, context);
}
for (JApiMethod method : clazz.getMethods()) {
processAllChanges(method, context);
}
for (JApiConstructor constructor : clazz.getConstructors()) {
processAllChanges(constructor, context);
}
for (JApiImplementedInterface anInterface : clazz.getInterfaces()) {
processAllChanges(anInterface, context);
}
} finally {
context.currentClass = oldClass;
}
}
Aggregations