1 7 package com.bull.eclipse.jonas.actions.persistence.utils; 8 9 import org.eclipse.core.resources.IResource; 10 import org.eclipse.jdt.core.IJavaElement; 11 import org.eclipse.jdt.core.JavaModelException; 12 13 19 public class PersistencePackage { 20 21 static public String getPersistencePackage(IJavaElement resource[]) throws JavaModelException { 22 String packagePersistence = null; 23 for(int i=0;i<resource.length;i++) { 24 IJavaElement ele = (IJavaElement)resource[i]; 25 if ("persistence".equals(ele.getCorrespondingResource().getLocation().lastSegment()) && !"".equals(ele.getElementName())) 26 packagePersistence = ele.getElementName().substring(0, ele.getElementName().lastIndexOf(".")); 27 } 28 return packagePersistence; 29 } 30 } 31 | Popular Tags |