japicmp.output.extapi.jpa.JpaAnalyzer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of japicmp Show documentation
Show all versions of japicmp Show documentation
japicmp is a library that computes the differences between two
versions of a jar file/artifact in order to ease the API documentation for clients/customers.
The newest version!
package japicmp.output.extapi.jpa;
import japicmp.model.JApiAnnotation;
import japicmp.model.JApiClass;
import japicmp.output.extapi.jpa.model.JpaTable;
import java.util.LinkedList;
import java.util.List;
public class JpaAnalyzer {
public static final String JPA_ANNOTATION_ENTITY = "javax.persistence.Entity";
public static final String JPA_ANNOTATION_TRANSIENT = "javax.persistence.Transient";
public List analyze(List classes) {
List jpaTables = new LinkedList<>();
for (JApiClass jApiClass : classes) {
List annotations = jApiClass.getAnnotations();
for (JApiAnnotation jApiAnnotation : annotations) {
String fullyQualifiedName = jApiAnnotation.getFullyQualifiedName();
if (JPA_ANNOTATION_ENTITY.equals(fullyQualifiedName)) {
JpaTable jpaTable = new JpaTable(jApiClass, jApiAnnotation);
jpaTables.add(jpaTable);
}
}
}
return jpaTables;
}
}