Module java.base
Package java.lang.classfile

# Interface ClassHierarchyResolver

≠
@FunctionalInterface
public abstract interface ClassHierarchyResolver
Comparing master and cf

Functional Interface:
  This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface ClassHierarchyResolver
Provides class hierarchy information for generating correct Moved to a link with destination ClassFile.StackMapsOption.html with title enum class in java.lang.classfile.stack maps during code building.

Since:
  24

generation and verification. A class hierarchy resolver must be able to process all classes and interfaces encountered during these workloads.

See Java Virtual Machine Specification:
  4.10.1.2 Verification Type System
Since:
  24
See Also:
  - `ClassFile.ClassHierarchyResolverOption`
  - `StackMapTableAttribute`

## Nested Types

- ≠ ClassHierarchyInfo

## Methods

- ≠
  public default java.lang.classfile.ClassHierarchyResolver cached()
  Comparing master and cf

  ### cached

  default ClassHierarchyResolver cached()
  Returns a `Moved to a computer code block.ClassHierarchyResolver` Moved to a computer code block. that caches class hierarchy information from this resolver. The returned resolver will not update if delegate resolver returns differentlythe query results from this resolver changed over time. The returned resolver is not thread-safe.

      MethodHandles.Lookup lookup = ...;
      ClassHierarchyResolver resolver = ClassHierarchyResolver.ofClassLoading(lookup).cached();

  Implementation Requirements:
    The default implementation calls `cached(Supplier)` with `HashMap` supplier as `cacheFactory` .
  Returns:
    the ClassHierarchyResolver
    a `ClassHierarchyResolver` that caches class hierarchy information from this resolver
- ≠
  public default java.lang.classfile.ClassHierarchyResolver cached(java.util.function.Supplier<java.util.Map<java.lang.constant.ClassDesc, java.lang.classfile.ClassHierarchyResolver.ClassHierarchyInfo>> arg0)
  Comparing master and cf

  ### cached

  default ClassHierarchyResolver cached (Supplier<Map<ClassDesc, ClassHierarchyResolver.ClassHierarchyInfo>> cacheFactory)
  Returns a `Moved to a computer code block.ClassHierarchyResolver` Moved to a computer code block. that caches class hierarchy information from this resolver. The returned resolver will not update if delegate resolver returns differentlythe query results from this resolver changed over time. The thread safety of the returned resolver depends on the thread safety of the map returned by the `cacheFactory` .
  Implementation Requirements:
    The default implementation returns a resolver holding an instance of the cache map provided by the `cacheFactory` . It asks looks up in the cache map always first and fills the cache map with all resolved and also unresolved class info, or if a class name has not yet been queried, queries this resolver and caches the result, including a `null` that indicates unknown class names. The cache map may refuse `null` keys and values.
  Parameters:
    `cacheFactory` - the factory for the cache
  Returns:
    the ClassHierarchyResolver with caching
    a `ClassHierarchyResolver` that caches class hierarchy information from this resolver
- ≠
  public static java.lang.classfile.ClassHierarchyResolver defaultResolver()
  Comparing master and cf

  ### defaultResolver

  static ClassHierarchyResolver defaultResolver()
  Returns the default instance of `Moved out of a link with destination ClassHierarchyResolver.html with title interface in java.lang.classfile.Moved to a computer code block.ClassHierarchyResolver` Moved out of a link with destination ClassHierarchyResolver.html with title interface in java.lang.classfile.Moved to a computer code block. that gets `ClassHierarchyResolver.ClassHierarchyInfo` from system class loader with reflection. This default instance cannot load classes from other class loaders, such as the caller's class loader; it also loads the system classes if they are not yet loaded, which makes it unsuitable for instrumentation.
  Returns:
    the default instance of `Moved out of a link with destination ClassHierarchyResolver.html with title interface in java.lang.classfile.Moved to a computer code block.ClassHierarchyResolver` Moved out of a link with destination ClassHierarchyResolver.html with title interface in java.lang.classfile.Moved to a computer code block. that gets `ClassHierarchyResolver.ClassHierarchyInfo` from system class loader with reflection
- ≠
  public abstract java.lang.classfile.ClassHierarchyResolver.ClassHierarchyInfo getClassInfo(java.lang.constant.ClassDesc arg0)
  Comparing master and cf

  ### getClassInfo

  ClassHierarchyResolver.ClassHierarchyInfo getClassInfo (ClassDesc classDesc)
  Returns the ClassHierarchyResolver.Moved out of a link with destination ClassHierarchyResolver.ClassHierarchyInfo.html with title interface in java.lang.classfile. `Moved out of a link with destination ClassHierarchyResolver.ClassHierarchyInfo.html with title interface in java.lang.classfile.ClassHierarchyInfo` Moved out of a link with destination ClassHierarchyResolver.ClassHierarchyInfo.html with title interface in java.lang.classfile. for a given class name, or `Moved to a computer code block. Moved to a computer code block.null` Moved to a computer code block. if the name is unknown to the resolver.

  Moved to a paragraph.This method is called by the Class-File API to obtain the hierarchy information of a class or interface; users should not call this method. The symbolic descriptor passed by the Class-File API always represents a class or interface.

  Parameters:
    `classDesc` - descriptor of the class
  Returns:
    the ClassHierarchyResolver.Moved out of a link with destination ClassHierarchyResolver.ClassHierarchyInfo.html with title interface in java.lang.classfile. `Moved out of a link with destination ClassHierarchyResolver.ClassHierarchyInfo.html with title interface in java.lang.classfile.ClassHierarchyInfo` Moved out of a link with destination ClassHierarchyResolver.ClassHierarchyInfo.html with title interface in java.lang.classfile. for a given class name, or `Moved to a computer code block. Moved to a computer code block.null` Moved to a computer code block. if the name is unknown to the resolver
  Throws:
    `IllegalArgumentException` - if a class shouldn't be queried for hierarchy, such as when it is inaccessible
- ≠
  public static java.lang.classfile.ClassHierarchyResolver of(java.util.Collection<java.lang.constant.ClassDesc> arg0, java.util.Map<java.lang.constant.ClassDesc, java.lang.constant.ClassDesc> arg1)
  Comparing master and cf

  ### of

  static ClassHierarchyResolver of (Collection<ClassDesc> interfaces, Map<ClassDesc, ClassDesc> classToSuperClass)
  Returns a `Moved out of a link with destination ClassHierarchyResolver.html with title interface in java.lang.classfile.Moved to a computer code block.ClassHierarchyResolver` Moved out of a link with destination ClassHierarchyResolver.html with title interface in java.lang.classfile.Moved to a computer code block. that extracts class hierarchy information from collections of class hierarchy metadata.
  Parameters:
    `interfaces` - a collection of classes known to be interfaces
    `classToSuperClass` - a map from classes to their super classes
  Returns:
    the ClassHierarchyResolver
    a `ClassHierarchyResolver` that extracts class hierarchy information from collections of class hierarchy metadata
- ≠
  public static java.lang.classfile.ClassHierarchyResolver ofClassLoading(java.lang.ClassLoader arg0)
  Comparing master and cf

  ### ofClassLoading

  static ClassHierarchyResolver ofClassLoading (ClassLoader loader)
  Returns a `Moved to a computer code block.ClassHierarchyResolver` Moved to a computer code block. that extracts class hierarchy information via the Reflection API with a ClassLoader classes loaded by a class loader with reflection.
  Parameters:
    `loader` - the class loader
  Returns:
    the a `ClassHierarchyResolver` that extracts class hierarchy resolverinformation via classes loaded by a class loader with reflection
- ≠
  public static java.lang.classfile.ClassHierarchyResolver ofClassLoading(java.lang.invoke.MethodHandles.Lookup arg0)
  Comparing master and cf

  ### ofClassLoading

  static ClassHierarchyResolver ofClassLoading (MethodHandles.Lookup lookup)
  Returns a `Moved to a computer code block.ClassHierarchyResolver` Moved to a computer code block. that extracts class hierarchy information via the Reflection API with a Lookup classes accessible to a `MethodHandles.Lookup` with reflection. If the class resolved is inaccessible to the given lookup, it `getClassInfo(ClassDesc)` throws `IllegalArgumentException` instead of returning `null` .
  Parameters:
    `lookup` - the lookup, must be able to access classes to resolve
  Returns:
    the a `ClassHierarchyResolver` that extracts class hierarchy resolverinformation via classes accessible to a `MethodHandles.Lookup` with reflection
- ≠
  public static java.lang.classfile.ClassHierarchyResolver ofResourceParsing(java.lang.ClassLoader arg0)
  Comparing master and cf

  ### ofResourceParsing

  static ClassHierarchyResolver ofResourceParsing (ClassLoader loader)
  Returns a `Moved out of a link with destination ClassHierarchyResolver.html with title interface in java.lang.classfile.Moved to a computer code block.ClassHierarchyResolver` Moved out of a link with destination ClassHierarchyResolver.html with title interface in java.lang.classfile.Moved to a computer code block. that extracts class hierarchy information from classfiles `class` files located by a class loader.
  Parameters:
    `loader` - the class loader, to find class files
  Returns:
    the ClassHierarchyResolver
    a `ClassHierarchyResolver` that extracts class hierarchy information from `class` files located by a class loader
- ≠
  public static java.lang.classfile.ClassHierarchyResolver ofResourceParsing(java.util.function.Function<java.lang.constant.ClassDesc, java.io.InputStream> arg0)
  Comparing master and cf

  ### ofResourceParsing

  static ClassHierarchyResolver ofResourceParsing (Function<ClassDesc, InputStream> classStreamResolver)
  Returns a `Moved out of a link with destination ClassHierarchyResolver.html with title interface in java.lang.classfile.Moved to a computer code block.ClassHierarchyResolver` Moved out of a link with destination ClassHierarchyResolver.html with title interface in java.lang.classfile.Moved to a computer code block. that extracts class hierarchy information from classfiles located `class` files returned by a mapping function. The mapping function should return `Moved to a computer code block.null` Moved to a computer code block. if it cannot provide a mapping `class` file for a classfileclass name. Any `Moved to a link with destination ../../io/IOException.html with title class in java.io.Moved to a computer code block.IOException` Moved to a link with destination ../../io/IOException.html with title class in java.io.Moved to a computer code block. from the provided input stream is rethrown as an `Moved to a link with destination ../../io/UncheckedIOException.html with title class in java.io.Moved to a computer code block.UncheckedIOException` Moved to a link with destination ../../io/UncheckedIOException.html with title class in java.io.Moved to a computer code block. in `getClassInfo(ClassDesc)` .
  Parameters:
    `classStreamResolver` - maps class descriptors to classfile `class` file input streams
  Returns:
    the ClassHierarchyResolver
    a `ClassHierarchyResolver` that extracts class hierarchy information from `class` files returned by a mapping function
- ≠
  public default java.lang.classfile.ClassHierarchyResolver orElse(java.lang.classfile.ClassHierarchyResolver arg0)
  Comparing master and cf

  ### orElse

  default ClassHierarchyResolver orElse (ClassHierarchyResolver other)
  Chains this `Moved out of a link with destination ClassHierarchyResolver.html with title interface in java.lang.classfile.Moved to a computer code block.ClassHierarchyResolver` Moved out of a link with destination ClassHierarchyResolver.html with title interface in java.lang.classfile.Moved to a computer code block. with another to be consulted if this resolver does not know about the specified class.
  Implementation Requirements:
    The default implementation returns resolver implemented to ask query `Moved to a computer code block. Moved to a computer code block.other` Moved to a computer code block. resolver in cases where case this resolver returns `null` .
  Parameters:
    `other` - the other resolver
  Returns:
    the chained resolver

## Summary

Differences
| Elements | Comments | Descriptions | Total
Added | Changed | Removed | Added | Changed | Removed | Added | Changed | Removed
--- | --- | --- | --- | --- | --- | --- | --- | ---
ClassHierarchyResolver |  |  |  |  |  |  | 3 |  | 4 | 7
ClassHierarchyResolver.ClassHierarchyInfo |  |  |  |  |  |  | 5 |  |  | 5
cached() |  |  |  |  |  |  | 2 | 3 | 2 | 7
cached(Supplier) |  |  |  |  |  |  | 4 | 5 | 2 | 11
defaultResolver() |  |  |  |  |  |  | 1 | 4 |  | 5
getClassInfo(ClassDesc) |  |  |  |  |  |  | 3 | 9 |  | 12
of(Collection,Map) |  |  |  |  |  |  | 3 | 2 | 2 | 7
ofClassLoading(ClassLoader) |  |  |  |  |  |  | 4 | 4 | 1 | 9
ofClassLoading(MethodHandles.Lookup) |  |  |  |  |  |  | 7 | 4 | 2 | 13
ofResourceParsing(ClassLoader) |  |  |  |  |  |  | 3 | 2 | 3 | 8
ofResourceParsing(Function) |  |  |  |  |  |  | 5 | 9 | 5 | 19
orElse(ClassHierarchyResolver) |  |  |  |  |  |  |  | 5 |  | 5
Total |  |  |  |  |  |  | 40 | 47 | 21 | 108