public class MemberCollector extends Object
Note: The collector uses internal caching and can be called with the same arguments repeatedly without repeated performance costs.
This class is not thread-safe.
Modifier and Type | Class and Description |
---|---|
static interface |
MemberCollector.FieldFilter
Filter used during the collection of fields to restrict the kind of
collected fields.
|
static interface |
MemberCollector.MethodFilter
Filter used during the collection of methods to restrict the kind of
collected methods.
|
Modifier and Type | Field and Description |
---|---|
static MemberCollector.MethodFilter |
ALL_METHOD_FILTER |
Constructor and Description |
---|
MemberCollector(TreeLogger logger) |
Modifier and Type | Method and Description |
---|---|
Collection<FieldLiteral<?>> |
getFields(TypeLiteral<?> typeLiteral)
Returns all fields in the provided type, including those of the type's
(recursive) super classes.
|
Collection<MethodLiteral<?,Method>> |
getMethods(TypeLiteral<?> typeLiteral)
Returns all methods in the provided type, including those of the type's
(recursive) super classes and interfaces.
|
void |
setFieldFilter(MemberCollector.FieldFilter filter)
Sets this collector's field filter.
|
void |
setMethodFilter(MemberCollector.MethodFilter filter)
Sets this collector's method filter.
|
public static final MemberCollector.MethodFilter ALL_METHOD_FILTER
@Inject public MemberCollector(TreeLogger logger)
public void setMethodFilter(MemberCollector.MethodFilter filter) throws IllegalStateException
filter
- new method filter for this collectorIllegalStateException
- if the filter is set after members have been
requestedpublic void setFieldFilter(MemberCollector.FieldFilter filter) throws IllegalStateException
filter
- new field filter for this collectorIllegalStateException
- if the filter is set after members have been
requestedpublic Collection<MethodLiteral<?,Method>> getMethods(TypeLiteral<?> typeLiteral)
typeLiteral
- type for which methods are collectedpublic Collection<FieldLiteral<?>> getFields(TypeLiteral<?> typeLiteral)
typeLiteral
- type for which fields are collectedCopyright © 2008–2018. All rights reserved.