Package org.emftext.language.java
Class JavaClasspath
- java.lang.Object
-
- org.emftext.language.java.JavaClasspath
-
public class JavaClasspath extends Object
This class is responsible for managing and retrieving Java resources to establish inter-model references between different Java classes represented as EMF-models.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()voidenableLocalRegistration()booleanexistsPackage(String packageName)static JavaClasspathget()static JavaClasspathget(EObject obj)static JavaClasspathget(Resource resource)static JavaClasspathget(ResourceSet set)ConcreteClassifiergetConcreteClassifier(String fullQualifiedClassifierName)Collection<ConcreteClassifier>getConcreteClassifiers(String packageName)ModulegetModule(String moduleName)PackagegetPackage(String packageName)Map<URI,URI>getURIMap()booleanisPackageRegistered(String packageName)booleanisRegistered(String fullQualifiedName)voidregisterClassifier(String packageName, String classifierName, URI physicalURI)Registers the classifier with the given name and package that is physically located at the given URI.voidregisterClassifier(CompilationUnit compilationUnit, URI uri)Registers all classes defined in the given compilation unit.voidregisterJavaRoot(JavaRoot root, URI physicalUri)voidregisterModule(String moduleName, URI physicalUri)voidregisterModule(Module module, URI physicalUri)voidregisterPackage(String packageName, URI physicalUri)voidregisterPackage(Package pack, URI physicalUri)voidregisterStdLib()Registers all classes of the Java standard library (src.zipfor Java 9+) located atSystem.getProperty("java.home").voidregisterZip(URI zipURI)Registers all source and class files within a zip file.static voidremove(EObject obj)static voidremove(Resource resource)static voidremove(ResourceSet set)voidunRegisterClassifier(String packageName, String classifierName)Removes the classifier identified by its package and name from the class path.
-
-
-
Method Detail
-
get
public static JavaClasspath get()
-
get
public static JavaClasspath get(EObject obj)
-
get
public static JavaClasspath get(Resource resource)
-
get
public static JavaClasspath get(ResourceSet set)
-
remove
public static void remove(EObject obj)
-
remove
public static void remove(Resource resource)
-
remove
public static void remove(ResourceSet set)
-
enableLocalRegistration
public void enableLocalRegistration()
-
clear
public void clear()
-
getConcreteClassifier
public ConcreteClassifier getConcreteClassifier(String fullQualifiedClassifierName)
-
getConcreteClassifiers
public Collection<ConcreteClassifier> getConcreteClassifiers(String packageName)
-
registerStdLib
public void registerStdLib()
Registers all classes of the Java standard library (src.zipfor Java 9+) located atSystem.getProperty("java.home").
-
registerZip
public void registerZip(URI zipURI)
Registers all source and class files within a zip file.- Parameters:
zipURI- URI pointing to the zip file.
-
existsPackage
public boolean existsPackage(String packageName)
-
registerClassifier
public void registerClassifier(CompilationUnit compilationUnit, URI uri)
Registers all classes defined in the given compilation unit.- Parameters:
compilationUnit- the given compilation unit.uri- the physical URI of the compilation unit.
-
registerClassifier
public void registerClassifier(String packageName, String classifierName, URI physicalURI)
Registers the classifier with the given name and package that is physically located at the given URI. If there is already a classifier registered for the given class name, the old one is replaced with the new one.- Parameters:
packageName- the name of the package that contains the classifier.classifierName- the simple name of the classifier.physicalURI- the URI where the classifier can be found (class or source file).
-
unRegisterClassifier
public void unRegisterClassifier(String packageName, String classifierName)
Removes the classifier identified by its package and name from the class path.- Parameters:
packageName- name of the package.classifierName- name of the classifier.
-
isPackageRegistered
public boolean isPackageRegistered(String packageName)
-
isRegistered
public boolean isRegistered(String fullQualifiedName)
-
-