T
- The type of the harmonizer token to be used for linking methods of different types.public static class MethodGraph.Compiler.Default<T> extends MethodGraph.Compiler.AbstractBase
Modifier and Type | Class and Description |
---|---|
static interface |
MethodGraph.Compiler.Default.Harmonizer<S>
A harmonizer is responsible for creating a token that identifies a method's relevant attributes for considering
two methods of being equal or not.
|
protected static class |
MethodGraph.Compiler.Default.Key<S>
A key represents a collection of methods within a method graph to later yield a node representing a collection of methods,
i.e. a method representative including information on the required method bridges.
|
static interface |
MethodGraph.Compiler.Default.Merger
Implementations are responsible for identifying a representative method for a
MethodGraph.Node
between several ambiguously resolved methods. |
MethodGraph.Compiler.AbstractBase, MethodGraph.Compiler.Default<T>, MethodGraph.Compiler.ForDeclaredMethods
DEFAULT
Modifier | Constructor and Description |
---|---|
protected |
Default(MethodGraph.Compiler.Default.Harmonizer<T> harmonizer,
MethodGraph.Compiler.Default.Merger merger,
TypeDescription.Generic.Visitor<? extends TypeDescription.Generic> visitor)
Creates a new default method graph compiler.
|
Modifier and Type | Method and Description |
---|---|
protected MethodGraph.Compiler.Default.Key.Store<T> |
analyze(TypeDefinition typeDefinition,
TypeDefinition key,
Map<TypeDefinition,MethodGraph.Compiler.Default.Key.Store<T>> snapshots,
ElementMatcher<? super MethodDescription> relevanceMatcher)
Analyzes the given type description without checking if the end of the type hierarchy was reached.
|
protected MethodGraph.Compiler.Default.Key.Store<T> |
analyzeNullable(TypeDescription.Generic typeDescription,
Map<TypeDefinition,MethodGraph.Compiler.Default.Key.Store<T>> snapshots,
ElementMatcher<? super MethodDescription> relevanceMatcher)
Analyzes the given type description.
|
MethodGraph.Linked |
compile(TypeDefinition typeDefinition,
TypeDescription viewPoint)
Compiles the given type into a method graph.
|
protected MethodGraph.Compiler.Default.Key.Store<T> |
doAnalyze(TypeDefinition typeDefinition,
Map<TypeDefinition,MethodGraph.Compiler.Default.Key.Store<T>> snapshots,
ElementMatcher<? super MethodDescription> relevanceMatcher)
Analyzes the given type description without checking if it is already presented in the key store.
|
static MethodGraph.Compiler |
forJavaHierarchy()
Creates a default compiler for a method hierarchy following the rules of the Java programming language.
|
static MethodGraph.Compiler |
forJVMHierarchy()
Creates a default compiler for a method hierarchy following the rules of the Java virtual machine.
|
static <S> MethodGraph.Compiler |
of(MethodGraph.Compiler.Default.Harmonizer<S> harmonizer,
MethodGraph.Compiler.Default.Merger merger)
Creates a default compiler using the given harmonizer and merger.
|
static <S> MethodGraph.Compiler |
of(MethodGraph.Compiler.Default.Harmonizer<S> harmonizer,
MethodGraph.Compiler.Default.Merger merger,
TypeDescription.Generic.Visitor<? extends TypeDescription.Generic> visitor)
Creates a default compiler using the given harmonizer and merger.
|
compile
protected Default(MethodGraph.Compiler.Default.Harmonizer<T> harmonizer, MethodGraph.Compiler.Default.Merger merger, TypeDescription.Generic.Visitor<? extends TypeDescription.Generic> visitor)
harmonizer
- The harmonizer to be used.merger
- The merger to be used.visitor
- A visitor to apply to all type descriptions before analyzing their methods or resolving super types.public static <S> MethodGraph.Compiler of(MethodGraph.Compiler.Default.Harmonizer<S> harmonizer, MethodGraph.Compiler.Default.Merger merger)
S
- The type of the harmonizer token.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.public static <S> MethodGraph.Compiler of(MethodGraph.Compiler.Default.Harmonizer<S> harmonizer, MethodGraph.Compiler.Default.Merger merger, TypeDescription.Generic.Visitor<? extends TypeDescription.Generic> visitor)
S
- The type of the harmonizer token.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.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.
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.
public MethodGraph.Linked compile(TypeDefinition typeDefinition, TypeDescription viewPoint)
MethodGraph.Compiler
typeDefinition
- The type to be compiled.viewPoint
- The view point that determines the method's visibility.protected MethodGraph.Compiler.Default.Key.Store<T> analyze(TypeDefinition typeDefinition, TypeDefinition key, Map<TypeDefinition,MethodGraph.Compiler.Default.Key.Store<T>> snapshots, ElementMatcher<? super MethodDescription> relevanceMatcher)
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.protected MethodGraph.Compiler.Default.Key.Store<T> analyzeNullable(TypeDescription.Generic typeDescription, Map<TypeDefinition,MethodGraph.Compiler.Default.Key.Store<T>> snapshots, ElementMatcher<? super MethodDescription> relevanceMatcher)
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.protected MethodGraph.Compiler.Default.Key.Store<T> doAnalyze(TypeDefinition typeDefinition, Map<TypeDefinition,MethodGraph.Compiler.Default.Key.Store<T>> snapshots, ElementMatcher<? super MethodDescription> relevanceMatcher)
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.Copyright © 2014–2017. All rights reserved.