Package com.google.auto.common
Class Overrides.ExplicitOverrides
java.lang.Object
com.google.auto.common.Overrides
com.google.auto.common.Overrides.ExplicitOverrides
- Enclosing class:
Overrides
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate class
Visitor that replaces type variables with their values in the types it sees.Nested classes/interfaces inherited from class com.google.auto.common.Overrides
Overrides.ExplicitOverrides, Overrides.NativeOverrides
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate TypeElement
asTypeElement
(TypeMirror typeMirror) (package private) com.google.common.collect.ImmutableList
<TypeMirror> erasedParameterTypes
(ExecutableElement method, TypeElement in) Returns the list of erased parameter types of the given method as they appear in the given type.private boolean
isSubsignature
(ExecutableElement overrider, ExecutableElement overridden, TypeElement in) (package private) ExecutableElement
methodFromSuperclasses
(TypeElement in, ExecutableElement method) Returns the given method as it appears in the given type.(package private) ExecutableElement
methodFromSuperinterfaces
(TypeElement in, ExecutableElement method) Returns the given interface method as it appears in the given type.private ExecutableElement
methodInType
(TypeElement type, ExecutableElement method) Returns the method from within the given type that has the same erased signature as the given method, or null if there is no such method.boolean
overrides
(ExecutableElement overrider, ExecutableElement overridden, TypeElement in) private TypeElement
superclass
(TypeElement type) private com.google.common.collect.ImmutableList
<TypeElement> superinterfaces
(TypeElement type)
-
Field Details
-
typeUtils
-
-
Constructor Details
-
ExplicitOverrides
ExplicitOverrides(Types typeUtils)
-
-
Method Details
-
overrides
-
isSubsignature
private boolean isSubsignature(ExecutableElement overrider, ExecutableElement overridden, TypeElement in) -
erasedParameterTypes
com.google.common.collect.ImmutableList<TypeMirror> erasedParameterTypes(ExecutableElement method, TypeElement in) Returns the list of erased parameter types of the given method as they appear in the given type. For example, if the method isadd(E)
fromList<E>
and we ask how it appears inclass NumberList implements List<Number>
, the answer will beNumber
. That will also be the answer forclass NumberList<E extends Number> implements List<E>
. The parameter types are erased since the purpose of this method is to determine whether two methods are candidates for one to override the other. -
methodFromSuperclasses
Returns the given method as it appears in the given type. This is the method itself, or the nearest override in a superclass of the given type, or null if the method is not found in the given type or any of its superclasses. -
methodFromSuperinterfaces
Returns the given interface method as it appears in the given type. This is the method itself, or the nearest override in a superinterface of the given type, or null if the method is not found in the given type or any of its transitive superinterfaces. -
methodInType
Returns the method from within the given type that has the same erased signature as the given method, or null if there is no such method. -
superclass
-
superinterfaces
-
asTypeElement
-