Package de.gebit.integrity.classloading
Class DefaultIntegrityClassLoader
- java.lang.Object
-
- de.gebit.integrity.classloading.DefaultIntegrityClassLoader
-
- All Implemented Interfaces:
IntegrityClassLoader
public class DefaultIntegrityClassLoader extends java.lang.Object implements IntegrityClassLoader
Basic implementation ofIntegrityClassLoader
. Uses the injected Java classloader internally.- Author:
- Rene Schneider - initial API and implementation
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.ClassLoader
classLoader
The actual classloader used internally.protected ModelSourceExplorer
modelSourceExplorer
The model source explorer.
-
Constructor Summary
Constructors Constructor Description DefaultIntegrityClassLoader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Class<?>
loadClass(JavaClassReference aClassReference)
Load the class defined by the providedJavaClassReference
.java.lang.Class<?>
loadClass(JavaConstantReference aConstantReference)
Load the class defined by the providedJavaConstantReference
.java.lang.Class<?>
loadClass(MethodReference aMethodReference)
Load the class defined by the providedMethodReference
.java.lang.Class<?>
loadClass(OperationDefinition anOperationDefinition)
Load the class defined by the providedOperationDefinition
.java.lang.Class<?>
loadClass(java.lang.String aClassName)
Loads the class given by the fully-qualified name.java.lang.Class<?>
loadClass(org.eclipse.xtext.common.types.JvmType aType)
Load the class defined by the providedJvmType
.java.lang.reflect.Method
loadMethod(MethodReference aMethodReference)
First loads the class defined by the providedMethodReference
, then loads the method.
-
-
-
Field Detail
-
classLoader
@Inject protected java.lang.ClassLoader classLoader
The actual classloader used internally.
-
modelSourceExplorer
@Inject protected ModelSourceExplorer modelSourceExplorer
The model source explorer.
-
-
Method Detail
-
loadClass
public java.lang.Class<?> loadClass(org.eclipse.xtext.common.types.JvmType aType) throws java.lang.ClassNotFoundException
Description copied from interface:IntegrityClassLoader
Load the class defined by the providedJvmType
.- Specified by:
loadClass
in interfaceIntegrityClassLoader
- Parameters:
aType
- the type referring to the class- Returns:
- the loaded class
- Throws:
java.lang.ClassNotFoundException
-
loadClass
public java.lang.Class<?> loadClass(java.lang.String aClassName) throws java.lang.ClassNotFoundException
Description copied from interface:IntegrityClassLoader
Loads the class given by the fully-qualified name.- Specified by:
loadClass
in interfaceIntegrityClassLoader
- Parameters:
aClassName
- the class to load- Returns:
- the loaded class
- Throws:
java.lang.ClassNotFoundException
-
loadClass
public java.lang.Class<?> loadClass(OperationDefinition anOperationDefinition) throws java.lang.ClassNotFoundException
Description copied from interface:IntegrityClassLoader
Load the class defined by the providedOperationDefinition
.- Specified by:
loadClass
in interfaceIntegrityClassLoader
- Parameters:
anOperationDefinition
- the operation definition referring to the class- Returns:
- the loaded class
- Throws:
java.lang.ClassNotFoundException
-
loadClass
public java.lang.Class<?> loadClass(MethodReference aMethodReference) throws java.lang.ClassNotFoundException
Description copied from interface:IntegrityClassLoader
Load the class defined by the providedMethodReference
.- Specified by:
loadClass
in interfaceIntegrityClassLoader
- Parameters:
aMethodReference
- the method reference referring to the class- Returns:
- the loaded class
- Throws:
java.lang.ClassNotFoundException
-
loadClass
public java.lang.Class<?> loadClass(JavaConstantReference aConstantReference) throws java.lang.ClassNotFoundException
Description copied from interface:IntegrityClassLoader
Load the class defined by the providedJavaConstantReference
.- Specified by:
loadClass
in interfaceIntegrityClassLoader
- Parameters:
aConstantReference
- the constant reference referring to the class- Returns:
- the loaded class
- Throws:
java.lang.ClassNotFoundException
-
loadClass
public java.lang.Class<?> loadClass(JavaClassReference aClassReference) throws java.lang.ClassNotFoundException
Description copied from interface:IntegrityClassLoader
Load the class defined by the providedJavaClassReference
.- Specified by:
loadClass
in interfaceIntegrityClassLoader
- Parameters:
aClassReference
- the class reference referring to the class- Returns:
- the loaded class
- Throws:
java.lang.ClassNotFoundException
-
loadMethod
public java.lang.reflect.Method loadMethod(MethodReference aMethodReference) throws java.lang.ClassNotFoundException, MethodNotFoundException
Description copied from interface:IntegrityClassLoader
First loads the class defined by the providedMethodReference
, then loads the method.- Specified by:
loadMethod
in interfaceIntegrityClassLoader
- Parameters:
aMethodReference
- the method reference referring to class and method- Returns:
- the loaded method
- Throws:
java.lang.ClassNotFoundException
MethodNotFoundException
-
-