Package org.ptolemy.classloading.osgi
Class DefaultModelElementClassProvider
- java.lang.Object
-
- org.ptolemy.classloading.osgi.DefaultModelElementClassProvider
-
- All Implemented Interfaces:
ModelElementClassProvider
public class DefaultModelElementClassProvider extends java.lang.Object implements ModelElementClassProvider
A simple provider that gets a list of classes to be provided in its constructor.- Since:
- Ptolemy II 11.0
- Version:
- $Id$
- Author:
- erwinDL
- Pt.AcceptedRating:
- Red (reviewmoderator)
- Pt.ProposedRating:
- Red (erwinDL)
-
-
Constructor Summary
Constructors Constructor Description DefaultModelElementClassProvider(java.lang.Class<? extends NamedObj>... knownClasses)
Create a provider that does not care about class versions, i.e.DefaultModelElementClassProvider(VersionSpecification version, java.lang.Class<? extends NamedObj>... knownClasses)
Create a provider that cares about class versions, i.e.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Class<? extends NamedObj>
getClass(java.lang.String className, VersionSpecification versionSpec)
Get a class by name and version.
-
-
-
Constructor Detail
-
DefaultModelElementClassProvider
@SafeVarargs public DefaultModelElementClassProvider(java.lang.Class<? extends NamedObj>... knownClasses)
Create a provider that does not care about class versions, i.e. it will only check on class names to check if it can provide a requested class.- Parameters:
knownClasses
- The known classes
-
DefaultModelElementClassProvider
@SafeVarargs public DefaultModelElementClassProvider(VersionSpecification version, java.lang.Class<? extends NamedObj>... knownClasses)
Create a provider that cares about class versions, i.e. it will check on class names and on the requested version to check if it can provide a requested class.- Parameters:
version
- if null, the provider will not care about versionsknownClasses
- The known classes
-
-
Method Detail
-
getClass
public java.lang.Class<? extends NamedObj> getClass(java.lang.String className, VersionSpecification versionSpec) throws java.lang.ClassNotFoundException
Get a class by name and version.- Specified by:
getClass
in interfaceModelElementClassProvider
- Parameters:
className
- The class nameversionSpec
- The version- Returns:
- The class
- Throws:
java.lang.ClassNotFoundException
- If the class is not found.- See Also:
VersionSpecification
-
-