1 19 20 package org.netbeans.modules.j2ee.ejbcore.test; 21 22 import java.net.URL ; 23 import javax.ejb.Stateless ; 24 import org.netbeans.api.java.classpath.ClassPath; 25 import org.netbeans.spi.java.classpath.ClassPathProvider; 26 import org.netbeans.spi.java.classpath.support.ClassPathSupport; 27 import org.openide.filesystems.FileObject; 28 import org.openide.filesystems.FileUtil; 29 30 34 public class ClassPathProviderImpl implements ClassPathProvider { 35 36 private ClassPath classPath; 37 38 public ClassPath findClassPath(FileObject file, String type) { 39 if (type == ClassPath.SOURCE) { 40 return classPath; 41 } else if (type == ClassPath.COMPILE) { 42 URL statelessAnnotationURL = Stateless .class.getProtectionDomain().getCodeSource().getLocation(); 43 return ClassPathSupport.createClassPath(new URL [] { FileUtil.getArchiveRoot(statelessAnnotationURL) }); 44 } 45 return null; 46 } 47 48 public void setClassPath(FileObject[] sources) { 49 classPath = ClassPathSupport.createClassPath(sources); 50 } 51 52 } 53 | Popular Tags |