public class APUtils extends Object
Constructor and Description |
---|
APUtils(ProcessingEnvironment processingEnv) |
Modifier and Type | Method and Description |
---|---|
Map<String,VariableElement> |
allFieldsByName(TypeElement type)
Retrieves a by-name map of all fields (inherited or directly declared) of a given
type.
|
boolean |
checkMethodSignature(ExecutableElement method,
CharSequence... paramTypeNames) |
boolean |
checkMethodSignature(ExecutableElement method,
Class<?>[] paramTypes) |
boolean |
checkMethodSignature(ExecutableElement method,
Class<?> firstParamType,
Class<?>... otherParamTypes) |
Map<String,VariableElement> |
declaredFieldsByName(TypeElement type)
Retrieves a by-name map of the directly declared fields of a given type.
|
Map<String,List<ExecutableElement>> |
declaredMethodsByName(TypeElement type)
Retrieves a by-name map of the directly declared methods of a given
type.
|
ExecutableElement |
findConstructor(Iterable<? extends ExecutableElement> allConstructors,
CharSequence... paramTypeNames) |
ExecutableElement |
findConstructor(Iterable<? extends ExecutableElement> allConstructors,
Class<?>... paramTypes) |
ExecutableElement |
findConstructor(Iterable<? extends ExecutableElement> allConstructors,
Class<?> firstParamType,
Class<?>... otherParamTypes) |
ExecutableElement |
findConstructor(TypeElement type,
CharSequence... paramTypeNames) |
ExecutableElement |
findConstructor(TypeElement type,
Class<?>[] paramTypes) |
ExecutableElement |
findConstructor(TypeElement type,
Class<?> firstParamType,
Class<?>... otherParamTypes) |
ExecutableElement |
findDeclaredMethod(TypeElement type,
CharSequence name,
Class<?> firstParamType,
Class<?>... otherParamTypes) |
ExecutableElement |
findDeclaredMethod(TypeElement type,
CharSequence name,
String... paramTypeNames) |
ExecutableElement |
findMethod(Iterable<? extends ExecutableElement> allMethods,
CharSequence name,
CharSequence... paramTypeNames) |
ExecutableElement |
findMethod(Iterable<? extends ExecutableElement> allMethods,
CharSequence name,
Class<?> firstParamType,
Class<?>... otherParamTypes) |
ExecutableElement |
findMethod(TypeElement type,
CharSequence name,
Class<?> firstParamType,
Class<?>... otherParamTypes) |
ExecutableElement |
findMethod(TypeElement type,
CharSequence name,
String... paramTypeNames) |
List<? extends VariableElement> |
getAllFields(TypeElement type)
Retrieves all fields of a given type, whether inherited or directly declared.
|
List<? extends ExecutableElement> |
getAllMethods(TypeElement type)
Retrieves all methods of a given type, whether inherited or directly declared.
|
List<? extends VariableElement> |
getDeclaredFields(TypeElement type)
Retrieves the directly declared fields of a given type.
|
List<? extends ExecutableElement> |
getDeclaredMethods(TypeElement type)
Retrieves the directly declared methods of a given type.
|
Elements |
getElementUtils()
Retrieves a reference to the element utilities.
|
Filer |
getFiler()
Retrieves a reference to the filer.
|
Messager |
getMessager()
Retrieves a reference to the messager.
|
ProcessingEnvironment |
getProcessingEnv()
Retrieves a reference to the processing environment.
|
RootReporter |
getReporter() |
ElementReporter |
getReporter(Element elem) |
AnnotationReporter |
getReporter(Element elem,
AnnotationMirror annotation) |
ValueReporter |
getReporter(Element elem,
AnnotationMirror annotation,
AnnotationValue value) |
ValueReporter |
getReporter(Element elem,
AnnotationMirror annotation,
CharSequence valueName) |
AnnotationReporter |
getReporter(Element elem,
CharSequence annotationName) |
ValueReporter |
getReporter(Element elem,
CharSequence annotationName,
CharSequence valueName) |
AnnotationReporter |
getReporter(Element elem,
Class<? extends Annotation> annotationClazz) |
ValueReporter |
getReporter(Element elem,
Class<? extends Annotation> annotationClazz,
CharSequence valueName) |
Types |
getTypeUtils()
Retrieves a reference to the type utilities.
|
Map<String,List<ExecutableElement>> |
methodsByName(TypeElement type)
Retrieves a by-name map of all methods (inherited or directly declared) of a given
type.
|
public APUtils(ProcessingEnvironment processingEnv)
public ProcessingEnvironment getProcessingEnv()
public Types getTypeUtils()
public Elements getElementUtils()
public Filer getFiler()
public Messager getMessager()
public boolean checkMethodSignature(ExecutableElement method, CharSequence... paramTypeNames)
public boolean checkMethodSignature(ExecutableElement method, Class<?>[] paramTypes)
public boolean checkMethodSignature(ExecutableElement method, Class<?> firstParamType, Class<?>... otherParamTypes)
public ExecutableElement findConstructor(Iterable<? extends ExecutableElement> allConstructors, CharSequence... paramTypeNames)
public ExecutableElement findConstructor(Iterable<? extends ExecutableElement> allConstructors, Class<?>... paramTypes)
public ExecutableElement findConstructor(Iterable<? extends ExecutableElement> allConstructors, Class<?> firstParamType, Class<?>... otherParamTypes)
public ExecutableElement findConstructor(TypeElement type, CharSequence... paramTypeNames)
public ExecutableElement findConstructor(TypeElement type, Class<?> firstParamType, Class<?>... otherParamTypes)
public ExecutableElement findConstructor(TypeElement type, Class<?>[] paramTypes)
public ExecutableElement findMethod(Iterable<? extends ExecutableElement> allMethods, CharSequence name, CharSequence... paramTypeNames)
public ExecutableElement findMethod(Iterable<? extends ExecutableElement> allMethods, CharSequence name, Class<?> firstParamType, Class<?>... otherParamTypes)
public ExecutableElement findDeclaredMethod(TypeElement type, CharSequence name, String... paramTypeNames)
public ExecutableElement findDeclaredMethod(TypeElement type, CharSequence name, Class<?> firstParamType, Class<?>... otherParamTypes)
public ExecutableElement findMethod(TypeElement type, CharSequence name, String... paramTypeNames)
public ExecutableElement findMethod(TypeElement type, CharSequence name, Class<?> firstParamType, Class<?>... otherParamTypes)
public Map<String,List<ExecutableElement>> declaredMethodsByName(TypeElement type)
Note that due to overloading, several methods with the same type may exist.
type
- the typepublic Map<String,List<ExecutableElement>> methodsByName(TypeElement type)
Note that due to overloading, several methods with the same type may exist.
type
- the typepublic Map<String,VariableElement> declaredFieldsByName(TypeElement type)
type
- the typepublic Map<String,VariableElement> allFieldsByName(TypeElement type)
type
- the typepublic List<? extends ExecutableElement> getDeclaredMethods(TypeElement type)
type
- the typepublic List<? extends ExecutableElement> getAllMethods(TypeElement type)
type
- the typepublic List<? extends VariableElement> getDeclaredFields(TypeElement type)
type
- the typepublic List<? extends VariableElement> getAllFields(TypeElement type)
type
- the typepublic RootReporter getReporter()
public ElementReporter getReporter(Element elem)
public AnnotationReporter getReporter(Element elem, AnnotationMirror annotation)
public AnnotationReporter getReporter(Element elem, CharSequence annotationName)
public AnnotationReporter getReporter(Element elem, Class<? extends Annotation> annotationClazz)
public ValueReporter getReporter(Element elem, AnnotationMirror annotation, AnnotationValue value)
public ValueReporter getReporter(Element elem, AnnotationMirror annotation, CharSequence valueName)
public ValueReporter getReporter(Element elem, CharSequence annotationName, CharSequence valueName)
public ValueReporter getReporter(Element elem, Class<? extends Annotation> annotationClazz, CharSequence valueName)
Copyright © 2013–2014. All rights reserved.