Class ClassHierarchyImpl

java.lang.Object
org.glavo.classfile.impl.ClassHierarchyImpl

public final class ClassHierarchyImpl extends Object
Class hierarchy resolution framework is answering questions about classes assignability, common classes ancestor and whether the class represents an interface. All the requests are handled without class loading nor full verification, optionally with incomplete dependencies and with focus on maximum performance.
  • Constructor Details

    • ClassHierarchyImpl

      public ClassHierarchyImpl(ClassHierarchyResolver classHierarchyResolver)
      Public constructor of ClassHierarchyImpl accepting instances of ClassHierarchyInfoResolver to resolve individual class streams.
      Parameters:
      classHierarchyResolver - ClassHierarchyInfoResolver instance
  • Method Details

    • isInterface

      public boolean isInterface(ClassDesc classDesc)
      Method answering question whether given class is an interface, responding without the class stream resolution and parsing is preferred in case the interface status is known from previous activities.
      Parameters:
      classDesc - class path in form of <package>/<class_name>.class
      Returns:
      true if the given class name represents an interface
    • commonAncestor

      public ClassDesc commonAncestor(ClassDesc symbol1, ClassDesc symbol2)
      Method resolving common ancestor of two classes
      Parameters:
      symbol1 - first class descriptor
      symbol2 - second class descriptor
      Returns:
      common ancestor class name or null if it could not be identified
    • isAssignableFrom

      public boolean isAssignableFrom(ClassDesc thisClass, ClassDesc fromClass)