public final class MoreTypes
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static javax.lang.model.type.ExecutableType |
asExecutable(javax.lang.model.type.TypeMirror maybeExecutableType)
Returns a
ExecutableType if the TypeMirror represents an executable type such
as a method, constructor, or initializer or throws an IllegalArgumentException. |
static javax.lang.model.element.TypeElement |
asTypeElement(javax.lang.model.type.DeclaredType type)
Returns the TypeElement corresponding to a DeclaredType.
|
static javax.lang.model.element.TypeElement |
asTypeElement(javax.lang.model.type.TypeMirror type)
Returns the TypeElement corresponding to a TypeMirror.
|
static java.util.Optional<javax.lang.model.element.ExecutableElement> |
findInheritedMethod(javax.lang.model.util.Types types,
javax.lang.model.element.TypeElement classElement,
javax.lang.model.element.ExecutableElement method)
Returns the first matching method, if one exists (starting with classElement, then searching
each sub classes).
|
static java.util.Optional<javax.lang.model.element.ExecutableElement> |
findMethod(javax.lang.model.util.Types types,
javax.lang.model.element.TypeElement classElement,
javax.lang.model.element.ExecutableElement method)
Returns a method with a matching signature in classElement if one exists.
|
static java.util.Set<javax.lang.model.element.ExecutableElement> |
findMethods(javax.lang.model.element.TypeElement classElement,
java.lang.String name)
Returns methods with a matching name in classElement.
|
static javax.lang.model.type.DeclaredType |
getDeclaredType(javax.lang.model.type.TypeMirror type)
If the received mirror represents a declared type or an array of declared types, this returns
the represented declared type.
|
public static javax.lang.model.type.DeclaredType getDeclaredType(javax.lang.model.type.TypeMirror type)
public static javax.lang.model.element.TypeElement asTypeElement(javax.lang.model.type.TypeMirror type)
public static javax.lang.model.element.TypeElement asTypeElement(javax.lang.model.type.DeclaredType type)
public static javax.lang.model.type.ExecutableType asExecutable(javax.lang.model.type.TypeMirror maybeExecutableType)
ExecutableType if the TypeMirror represents an executable type such
as a method, constructor, or initializer or throws an IllegalArgumentException.public static java.util.Optional<javax.lang.model.element.ExecutableElement> findInheritedMethod(javax.lang.model.util.Types types,
javax.lang.model.element.TypeElement classElement,
javax.lang.model.element.ExecutableElement method)
public static java.util.Optional<javax.lang.model.element.ExecutableElement> findMethod(javax.lang.model.util.Types types,
javax.lang.model.element.TypeElement classElement,
javax.lang.model.element.ExecutableElement method)
public static java.util.Set<javax.lang.model.element.ExecutableElement> findMethods(javax.lang.model.element.TypeElement classElement,
java.lang.String name)