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 void
clear()
void
enableLocalRegistration()
boolean
existsPackage(String packageName)
static JavaClasspath
get()
static JavaClasspath
get(EObject obj)
static JavaClasspath
get(Resource resource)
static JavaClasspath
get(ResourceSet set)
ConcreteClassifier
getConcreteClassifier(String fullQualifiedClassifierName)
Collection<ConcreteClassifier>
getConcreteClassifiers(String packageName)
Module
getModule(String moduleName)
Package
getPackage(String packageName)
Map<URI,URI>
getURIMap()
boolean
isPackageRegistered(String packageName)
boolean
isRegistered(String fullQualifiedName)
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.void
registerClassifier(CompilationUnit compilationUnit, URI uri)
Registers all classes defined in the given compilation unit.void
registerJavaRoot(JavaRoot root, URI physicalUri)
void
registerModule(String moduleName, URI physicalUri)
void
registerModule(Module module, URI physicalUri)
void
registerPackage(String packageName, URI physicalUri)
void
registerPackage(Package pack, URI physicalUri)
void
registerStdLib()
Registers all classes of the Java standard library (src.zip
for Java 9+) located atSystem.getProperty("java.home")
.void
registerZip(URI zipURI)
Registers all source and class files within a zip file.static void
remove(EObject obj)
static void
remove(Resource resource)
static void
remove(ResourceSet set)
void
unRegisterClassifier(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.zip
for 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)
-
-