Class 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 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 versions
        knownClasses - 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 interface ModelElementClassProvider
        Parameters:
        className - The class name
        versionSpec - The version
        Returns:
        The class
        Throws:
        java.lang.ClassNotFoundException - If the class is not found.
        See Also:
        VersionSpecification