Class Clazz

java.lang.Object
org.vafer.jdependency.Clazz
All Implemented Interfaces:
Comparable<Clazz>

public final class Clazz extends Object implements Comparable<Clazz>
A `Clazz` represents the single class identifier inside a classpath. There is only one `Clazz` per classname. It has incoming and outgoing edges defining references and dependencies. If there are different versions found, it collects their sources as ClazzpathUnits.
  • Field Details

  • Constructor Details

    • Clazz

      public Clazz(String pName)
  • Method Details

    • parseClassFileName

      public static Clazz.ParsedFileName parseClassFileName(String pFileName)
      Determine the class name for the provided filename.
      Parameters:
      pFileName - The filename
      Returns:
      the class name for the provided filename OR null if it is not a .class file.
    • isMultiReleaseClassFile

      public static boolean isMultiReleaseClassFile(String pFileName)
      Determine if the provided filename is the name of a class that is specific for a java version.
      Parameters:
      pFileName - The filename to be evaluated
      Returns:
      true if this is a filename for a specific java version, false if it is not
    • addMultiReleaseFile

      public void addMultiReleaseFile(ClazzpathUnit pUnit, String pForJava, String pFileName)
      Record that this class name can be found at:
      Parameters:
      pUnit - The unit in which the class can be found
      pForJava - For which Java version
      pFileName - Under which filename in the jar.
    • getName

      public String getName()
    • getFileNames

      public Map<String,Clazz.ClazzFile> getFileNames()
    • addClazzpathUnit

      public void addClazzpathUnit(ClazzpathUnit pUnit, String pDigest)
    • removeClazzpathUnit

      public void removeClazzpathUnit(ClazzpathUnit pUnit)
    • getClazzpathUnits

      public Set<ClazzpathUnit> getClazzpathUnits()
    • getVersions

      public Set<String> getVersions()
    • addDependency

      public void addDependency(Clazz pClazz)
    • removeDependency

      public void removeDependency(Clazz pClazz)
    • getDependencies

      public Set<Clazz> getDependencies()
    • getReferences

      public Set<Clazz> getReferences()
    • getTransitiveDependencies

      public Set<Clazz> getTransitiveDependencies()
    • findTransitiveDependencies

      void findTransitiveDependencies(Set<? super Clazz> pAll)
    • equals

      public boolean equals(Object pO)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • compareTo

      public int compareTo(Clazz pO)
      Specified by:
      compareTo in interface Comparable<Clazz>
    • toString

      public String toString()
      Overrides:
      toString in class Object