Class PackageBasedModelElementClassProvider

  • All Implemented Interfaces:
    ModelElementClassProvider

    public class PackageBasedModelElementClassProvider
    extends java.lang.Object
    implements ModelElementClassProvider
    A package-based 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
      PackageBasedModelElementClassProvider​(java.lang.ClassLoader classLoader, java.lang.String... packageNames)
      Create a package-based model element class provider.
    • 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)
      Return the requested class for the requested version (if specified).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PackageBasedModelElementClassProvider

        public PackageBasedModelElementClassProvider​(java.lang.ClassLoader classLoader,
                                                     java.lang.String... packageNames)
        Create a package-based model element class provider.
        Parameters:
        classLoader - The class loader.
        packageNames - The package names.
    • Method Detail

      • getClass

        public java.lang.Class<? extends NamedObj> getClass​(java.lang.String className,
                                                            VersionSpecification versionSpec)
                                                     throws java.lang.ClassNotFoundException
        Return the requested class for the requested version (if specified).

        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. ;-) )

        Specified by:
        getClass in interface ModelElementClassProvider
        Parameters:
        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.
        Returns:
        the concrete class of the NamedObj matching the given className.
        Throws:
        java.lang.ClassNotFoundException - if this provider can not provide the requested class for the requested version (if specified).
        See Also:
        VersionSpecification