All Downloads are FREE. Search and download functionalities are using the official Maven repository.

japicmp.output.extapi.jpa.JpaAnalyzer Maven / Gradle / Ivy

Go to download

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;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy