T
- The type of the harmonizer token to be used for linking methods of different types.public static class MethodGraph.Compiler.Default<T> extends Object implements MethodGraph.Compiler
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.
|
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.Default<T>
DEFAULT
Modifier | Constructor and Description |
---|---|
protected |
Default(MethodGraph.Compiler.Default.Harmonizer<T> harmonizer,
MethodGraph.Compiler.Default.Merger merger)
Creates a new default method graph compiler.
|
Modifier and Type | Method and Description |
---|---|
protected MethodGraph.Compiler.Default.Key.Store<T> |
analyze(GenericTypeDescription typeDescription,
Map<GenericTypeDescription,MethodGraph.Compiler.Default.Key.Store<T>> snapshots,
ElementMatcher<? super MethodDescription> currentMatcher,
ElementMatcher<? super MethodDescription> nextMatcher)
Analyzes the given type description without checking if the end of the type hierarchy was reached.
|
protected MethodGraph.Compiler.Default.Key.Store<T> |
analyzeNullable(GenericTypeDescription typeDescription,
Map<GenericTypeDescription,MethodGraph.Compiler.Default.Key.Store<T>> snapshots,
ElementMatcher<? super MethodDescription> currentMatcher,
ElementMatcher<? super MethodDescription> nextMatcher)
Analyzes the given type description.
|
MethodGraph.Linked |
compile(TypeDescription typeDescription)
Compiles the given type into a method graph.
|
protected MethodGraph.Compiler.Default.Key.Store<T> |
doAnalyze(GenericTypeDescription typeDescription,
Map<GenericTypeDescription,MethodGraph.Compiler.Default.Key.Store<T>> snapshots,
ElementMatcher<? super MethodDescription> currentMatcher,
ElementMatcher<? super MethodDescription> nextMatcher)
Analyzes the given type description without checking if it is already presented in the key store.
|
boolean |
equals(Object other) |
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.
|
int |
hashCode() |
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.
|
String |
toString() |
protected Default(MethodGraph.Compiler.Default.Harmonizer<T> harmonizer, MethodGraph.Compiler.Default.Merger merger)
harmonizer
- The harmonizer to be used.merger
- The merger to be used.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 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 raw types.
Ambiguous methods are merged by considering the method that was discovered first.
public MethodGraph.Linked compile(TypeDescription typeDescription)
MethodGraph.Compiler
compile
in interface MethodGraph.Compiler
typeDescription
- The type to be compiled.protected MethodGraph.Compiler.Default.Key.Store<T> analyze(GenericTypeDescription typeDescription, Map<GenericTypeDescription,MethodGraph.Compiler.Default.Key.Store<T>> snapshots, ElementMatcher<? super MethodDescription> currentMatcher, ElementMatcher<? super MethodDescription> nextMatcher)
typeDescription
- The type to analyze.snapshots
- A map containing snapshots of key stores for previously analyzed types.currentMatcher
- A matcher to be used for filtering methods of the currently analyzed types.nextMatcher
- A matcher to be used for filtering methods of the super types of the analyzed type.protected MethodGraph.Compiler.Default.Key.Store<T> analyzeNullable(GenericTypeDescription typeDescription, Map<GenericTypeDescription,MethodGraph.Compiler.Default.Key.Store<T>> snapshots, ElementMatcher<? super MethodDescription> currentMatcher, ElementMatcher<? super MethodDescription> nextMatcher)
typeDescription
- The type to analyze.snapshots
- A map containing snapshots of key stores for previously analyzed types.currentMatcher
- A matcher to be used for filtering methods of the currently analyzed types.nextMatcher
- A matcher to be used for filtering methods of the super types of the analyzed type.protected MethodGraph.Compiler.Default.Key.Store<T> doAnalyze(GenericTypeDescription typeDescription, Map<GenericTypeDescription,MethodGraph.Compiler.Default.Key.Store<T>> snapshots, ElementMatcher<? super MethodDescription> currentMatcher, ElementMatcher<? super MethodDescription> nextMatcher)
typeDescription
- The type to analyze.snapshots
- A map containing snapshots of key stores for previously analyzed types.currentMatcher
- A matcher to be used for filtering methods of the currently analyzed types.nextMatcher
- A matcher to be used for filtering methods of the super types of the analyzed type.Copyright © 2014–2015. All rights reserved.