T
- The element kindpublic interface ElementQuery<T extends Element>
Modifier and Type | Interface and Description |
---|---|
static interface |
ElementQuery.Result<T extends Element>
Result interface when building a query.
|
Modifier and Type | Field and Description |
---|---|
static ElementQuery<FieldElement> |
ALL_FIELDS
Constant to retrieve all fields.
|
static ElementQuery<ClassElement> |
ALL_INNER_CLASSES
Constant to retrieve inner classes.
|
static ElementQuery<MethodElement> |
ALL_METHODS
Constant to retrieve all methods.
|
static ElementQuery<ConstructorElement> |
CONSTRUCTORS
Constant to retrieve instance constructors, not including those of the parent class.
|
Modifier and Type | Method and Description |
---|---|
ElementQuery<T> |
annotated(Predicate<AnnotationMetadata> predicate)
Allows filtering elements by annotation.
|
ElementQuery<T> |
filter(Predicate<T> predicate)
A final filter that allows access to the materialized Element.
|
ElementQuery<T> |
includeEnumConstants()
Indicates to include enum constants, only applicable for fields query.
|
ElementQuery<T> |
includeHiddenElements()
Indicates to include hidden methods/fields, only applicable for methods/fields query.
|
ElementQuery<T> |
includeOverriddenMethods()
Indicates to include overridden methods, only applicable for methods query.
|
ElementQuery<T> |
modifiers(Predicate<Set<ElementModifier>> predicate)
Allows filtering by modifiers.
|
ElementQuery<T> |
named(Predicate<String> predicate)
Allows filtering elements by name.
|
static <T1 extends Element> |
of(Class<T1> elementType)
Create a new
ElementQuery for the given element type. |
ElementQuery<T> |
onlyAbstract()
Indicates that only abstract members should be returned.
|
ElementQuery<T> |
onlyAccessible()
Indicates that only accessible members should be returned.
|
ElementQuery<T> |
onlyAccessible(ClassElement fromType)
Indicates that only accessible members from the given type should be returned.
|
ElementQuery<T> |
onlyConcrete()
Indicates that only concrete members should be returned.
|
ElementQuery<T> |
onlyDeclared()
Indicates that only declared members should be returned and not members from parent classes.
|
ElementQuery<T> |
onlyInjected()
Search for methods that are injection points.
|
ElementQuery<T> |
onlyInstance()
Indicates to return only instance (non-static methods).
|
ElementQuery.Result<T> |
result()
Build the query result.
|
ElementQuery<T> |
typed(Predicate<ClassElement> predicate)
Allows filtering elements by type.
|
static final ElementQuery<ClassElement> ALL_INNER_CLASSES
static final ElementQuery<FieldElement> ALL_FIELDS
static final ElementQuery<MethodElement> ALL_METHODS
static final ElementQuery<ConstructorElement> CONSTRUCTORS
@NonNull ElementQuery<T> onlyDeclared()
ElementQuery<T> onlyInjected()
@NonNull ElementQuery<T> onlyConcrete()
@NonNull ElementQuery<T> onlyAbstract()
@NonNull ElementQuery<T> onlyAccessible()
@NonNull ElementQuery<T> onlyAccessible(ClassElement fromType)
fromType
- The origin typeElementQuery<T> onlyInstance()
ElementQuery<T> includeEnumConstants()
ElementQuery<T> includeOverriddenMethods()
ElementQuery<T> includeHiddenElements()
@NonNull ElementQuery<T> named(@NonNull Predicate<String> predicate)
predicate
- The predicate to use. Should return true to include the element.@NonNull ElementQuery<T> typed(@NonNull Predicate<ClassElement> predicate)
MethodElement
instances this is based on the return type.predicate
- The predicate to use. Should return true to include the element.@NonNull ElementQuery<T> annotated(@NonNull Predicate<AnnotationMetadata> predicate)
predicate
- The predicate to use. Should return true to include the element.@NonNull ElementQuery<T> modifiers(@NonNull Predicate<Set<ElementModifier>> predicate)
predicate
- The predicate to use. Should return true to include the element.@NonNull ElementQuery<T> filter(@NonNull Predicate<T> predicate)
predicate
- The predicate to use. Should return true to include the element.@NonNull ElementQuery.Result<T> result()
@NonNull static <T1 extends Element> ElementQuery<T1> of(@NonNull Class<T1> elementType)
ElementQuery
for the given element type.T1
- The element generic typeelementType
- The element type