Class MethodGraph.Compiler.Default<T>

java.lang.Object
net.bytebuddy.dynamic.scaffold.MethodGraph.Compiler.AbstractBase
net.bytebuddy.dynamic.scaffold.MethodGraph.Compiler.Default<T>
Type Parameters:
T - The type of the harmonizer token to be used for linking methods of different types.
All Implemented Interfaces:
MethodGraph.Compiler
Enclosing interface:
MethodGraph.Compiler

@Enhance public static class MethodGraph.Compiler.Default<T> extends MethodGraph.Compiler.AbstractBase
A default implementation of a method graph.
  • Field Details

  • Constructor Details

  • Method Details

    • of

      Creates a default compiler using the given harmonizer and merger. All raw types are reified before analyzing their properties.
      Type Parameters:
      S - The type of the harmonizer token.
      Parameters:
      harmonizer - The harmonizer to be used for creating tokens that uniquely identify a method hierarchy.
      merger - The merger to be used for identifying a method to represent an ambiguous method resolution.
      Returns:
      A default compiler for the given harmonizer and merger.
    • of

      Creates a default compiler using the given harmonizer and merger.
      Type Parameters:
      S - The type of the harmonizer token.
      Parameters:
      harmonizer - The harmonizer to be used for creating tokens that uniquely identify a method hierarchy.
      merger - The merger to be used for identifying a method to represent an ambiguous method resolution.
      visitor - A visitor to apply to all type descriptions before analyzing their methods or resolving super types.
      Returns:
      A default compiler for the given harmonizer and merger.
    • forJavaHierarchy

      public static MethodGraph.Compiler forJavaHierarchy()

      Creates a default compiler for a method hierarchy following the rules of the Java programming language. According to these rules, two methods of the same name are only different if their parameter types represent different raw types. The return type is not considered as a part of the signature.

      Ambiguous methods are merged by considering the method that was discovered first.

      Returns:
      A compiler for resolving a method hierarchy following the rules of the Java programming language.
    • forJVMHierarchy

      public static MethodGraph.Compiler forJVMHierarchy()

      Creates a default compiler for a method hierarchy following the rules of the Java virtual machine. According to these rules, two methods of the same name are different if their parameter types and return types represent different type erasures.

      Ambiguous methods are merged by considering the method that was discovered first.

      Returns:
      A compiler for resolving a method hierarchy following the rules of the Java programming language.
    • compile

      public MethodGraph.Linked compile(TypeDefinition typeDefinition, TypeDescription viewPoint)
      Compiles the given type into a method graph.
      Parameters:
      typeDefinition - The type to be compiled.
      viewPoint - The view point that determines the method's visibility.
      Returns:
      A linked method graph representing the given type.
    • analyze

      Analyzes the given type description without checking if the end of the type hierarchy was reached.
      Parameters:
      typeDefinition - The type to analyze.
      key - The type in its original form before applying the visitor.
      snapshots - A map containing snapshots of key stores for previously analyzed types.
      relevanceMatcher - A matcher for filtering methods that should be included in the graph.
      Returns:
      A key store describing the provided type.
    • analyzeNullable

      Analyzes the given type description.
      Parameters:
      typeDescription - The type to analyze.
      snapshots - A map containing snapshots of key stores for previously analyzed types.
      relevanceMatcher - A matcher for filtering methods that should be included in the graph.
      Returns:
      A key store describing the provided type.
    • doAnalyze

      Analyzes the given type description without checking if it is already presented in the key store.
      Parameters:
      typeDefinition - The type to analyze.
      snapshots - A map containing snapshots of key stores for previously analyzed types.
      relevanceMatcher - A matcher for filtering methods that should be included in the graph.
      Returns:
      A key store describing the provided type.