public class PackageBasedModelElementClassProvider extends java.lang.Object implements ModelElementClassProvider
Constructor and Description |
---|
PackageBasedModelElementClassProvider(java.lang.ClassLoader classLoader,
java.lang.String... packageNames)
Create a package-based model element class provider.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Class<? extends NamedObj> |
getClass(java.lang.String className,
VersionSpecification versionSpec)
Return the requested class for the requested version (if specified).
|
public PackageBasedModelElementClassProvider(java.lang.ClassLoader classLoader, java.lang.String... packageNames)
classLoader
- The class loader.packageNames
- The package names.public java.lang.Class<? extends NamedObj> getClass(java.lang.String className, VersionSpecification versionSpec) throws java.lang.ClassNotFoundException
If this provider doesn't have this class available, it should
throw a ClassNotFoundException
. (Optionally, it
could also just return null, for those dvp-ers who don't like
exceptions. ;-) )
getClass
in interface ModelElementClassProvider
className
- typically a fully qualified Java class name. Mandatory non-null.versionSpec
- optional constraint on desired version for
the class that must be provided. If null, no version constraint
is imposed.NamedObj
matching the given className.java.lang.ClassNotFoundException
- if this provider can not provide
the requested class for the requested version (if specified).VersionSpecification