Class DefaultJavaPackage

    • Constructor Detail

      • DefaultJavaPackage

        public DefaultJavaPackage​(String name)
        Parameters:
        name - the name of the package, should never be null
    • Method Detail

      • setName

        public void setName​(String name)
      • setClassLibrary

        public void setClassLibrary​(ClassLibrary classLibrary)
      • addClass

        public void addClass​(JavaClass clazz)
      • getClasses

        public Collection<JavaClass> getClasses()
        Returns all the classes found for the package.
        Specified by:
        getClasses in interface JavaPackage
        Returns:
        all the classes found for the package, never null
      • getClassByName

        public JavaClass getClassByName​(String name)
        Try to get any class of this package by name. The name can be both the fully qualified name or just the name of the class.
        Specified by:
        getClassByName in interface JavaPackage
        Parameters:
        name - the (fully qualified) name of the class
        Returns:
        the matching class, otherwise null
      • getParentPackage

        public JavaPackage getParentPackage()
        The parent of this package For instance: the package of java.lang.reflect is java.lang
        Specified by:
        getParentPackage in interface JavaPackage
        Returns:
        the parent package, otherwise null
      • getSubPackages

        public List<JavaPackage> getSubPackages()
        For instance: one of the children of java.lang would be java.lang.reflect
        Specified by:
        getSubPackages in interface JavaPackage
        Returns:
        all the children of this package , never null
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object