Package com.fasterxml.classmate
Class ResolvedTypeWithMembers
- java.lang.Object
-
- com.fasterxml.classmate.ResolvedTypeWithMembers
-
public class ResolvedTypeWithMembers extends java.lang.Object
Class that contains information about fully resolved members of a type; resolution meaning that masking is handled for methods, and all inheritable annotations are flattened using optional overrides as well ("mix-in annotations"). Instances are created byMemberResolver
.Note that instances are not thread-safe, as the expectation is that instances will not be shared (unlike raw members or resolved types)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
ResolvedTypeWithMembers.AnnotationHandler
Helper class we use to reduce number of calls toAnnotationConfiguration
; mostly because determination may be expensive.
-
Field Summary
Fields Modifier and Type Field Description protected ResolvedTypeWithMembers.AnnotationHandler
_annotationHandler
Handler for resolving annotation informationprotected Filter<RawConstructor>
_constructorFilter
Filter to use for selecting constructors to includeprotected ResolvedConstructor[]
_constructors
protected Filter<RawField>
_fieldFilter
Filter to use for selecting fields to includeprotected HierarchicType
_mainType
Leaf of the type hierarchy, i.e.protected ResolvedField[]
_memberFields
protected ResolvedMethod[]
_memberMethods
protected Filter<RawMethod>
_methodFilter
Filter to use for selecting methods to includeprotected ResolvedField[]
_staticFields
protected ResolvedMethod[]
_staticMethods
protected TypeResolver
_typeResolver
Need to be able to resolve member types stillprotected HierarchicType[]
_types
All types that hierarchy contains, in order of increasing precedence (that is, later entries override members of earlier members)protected static AnnotationConfiguration
DEFAULT_ANNOTATION_CONFIG
Default annotation configuration is to ignore all annotations types.private static ResolvedConstructor[]
NO_RESOLVED_CONSTRUCTORS
private static ResolvedField[]
NO_RESOLVED_FIELDS
private static ResolvedMethod[]
NO_RESOLVED_METHODS
private static ResolvedType[]
NO_RESOLVED_TYPES
-
Constructor Summary
Constructors Constructor Description ResolvedTypeWithMembers(TypeResolver typeResolver, AnnotationConfiguration annotationConfig, HierarchicType mainType, HierarchicType[] types, Filter<RawConstructor> constructorFilter, Filter<RawField> fieldFilter, Filter<RawMethod> methodFilter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<HierarchicType>
allTypesAndOverrides()
Accessor for getting full type hierarchy as priority-ordered list, from the lowest precedence to highest precedence (main type, its mix-in overrides)ResolvedConstructor[]
getConstructors()
ResolvedField[]
getMemberFields()
ResolvedMethod[]
getMemberMethods()
ResolvedField[]
getStaticFields()
Method for finding all static fields of the main type (except for ones possibly filtered out by filter) and applying annotation overrides, if any, to annotations.ResolvedMethod[]
getStaticMethods()
Method for finding all static methods of the main type (except for ones possibly filtered out by filter) and applying annotation overrides, if any, to annotations.java.util.List<HierarchicType>
mainTypeAndOverrides()
Accessor for getting subset of type hierarchy which only contains main type and possible overrides (mix-ins) it has, but not supertypes or their overrides.protected boolean
methodCanInherit(java.lang.annotation.Annotation annotation)
java.util.List<HierarchicType>
overridesOnly()
Accessor for finding just overrides for the main type (if any).protected boolean
parameterCanInherit(java.lang.annotation.Annotation annotation)
protected ResolvedConstructor
resolveConstructor(RawConstructor raw)
Method for resolving individual constructor completelyprotected ResolvedConstructor[]
resolveConstructors()
Method that will actually resolve full information (types, annotations) for constructors of the main type.protected ResolvedField
resolveField(RawField raw)
Method for resolving individual field completelyprotected ResolvedField[]
resolveMemberFields()
Method for fully resolving field definitions and associated annotations.protected ResolvedMethod[]
resolveMemberMethods()
protected ResolvedMethod
resolveMethod(RawMethod raw)
Method for resolving individual method completelyprotected ResolvedField[]
resolveStaticFields()
Method for fully resolving static field definitions and associated annotations.protected ResolvedMethod[]
resolveStaticMethods()
Method that will actually resolve full information (types, annotations) for static methods, using configured filter.int
size()
-
-
-
Field Detail
-
NO_RESOLVED_TYPES
private static final ResolvedType[] NO_RESOLVED_TYPES
-
NO_RESOLVED_METHODS
private static final ResolvedMethod[] NO_RESOLVED_METHODS
-
NO_RESOLVED_FIELDS
private static final ResolvedField[] NO_RESOLVED_FIELDS
-
NO_RESOLVED_CONSTRUCTORS
private static final ResolvedConstructor[] NO_RESOLVED_CONSTRUCTORS
-
DEFAULT_ANNOTATION_CONFIG
protected static final AnnotationConfiguration DEFAULT_ANNOTATION_CONFIG
Default annotation configuration is to ignore all annotations types.
-
_typeResolver
protected final TypeResolver _typeResolver
Need to be able to resolve member types still
-
_annotationHandler
protected final ResolvedTypeWithMembers.AnnotationHandler _annotationHandler
Handler for resolving annotation information
-
_mainType
protected final HierarchicType _mainType
Leaf of the type hierarchy, i.e. type from which this hierarchy was generated.
-
_types
protected final HierarchicType[] _types
All types that hierarchy contains, in order of increasing precedence (that is, later entries override members of earlier members)
-
_constructorFilter
protected Filter<RawConstructor> _constructorFilter
Filter to use for selecting constructors to include
-
_methodFilter
protected Filter<RawMethod> _methodFilter
Filter to use for selecting methods to include
-
_staticMethods
protected ResolvedMethod[] _staticMethods
-
_staticFields
protected ResolvedField[] _staticFields
-
_memberMethods
protected ResolvedMethod[] _memberMethods
-
_memberFields
protected ResolvedField[] _memberFields
-
_constructors
protected ResolvedConstructor[] _constructors
-
-
Constructor Detail
-
ResolvedTypeWithMembers
public ResolvedTypeWithMembers(TypeResolver typeResolver, AnnotationConfiguration annotationConfig, HierarchicType mainType, HierarchicType[] types, Filter<RawConstructor> constructorFilter, Filter<RawField> fieldFilter, Filter<RawMethod> methodFilter)
-
-
Method Detail
-
size
public int size()
-
allTypesAndOverrides
public java.util.List<HierarchicType> allTypesAndOverrides()
Accessor for getting full type hierarchy as priority-ordered list, from the lowest precedence to highest precedence (main type, its mix-in overrides)
-
mainTypeAndOverrides
public java.util.List<HierarchicType> mainTypeAndOverrides()
Accessor for getting subset of type hierarchy which only contains main type and possible overrides (mix-ins) it has, but not supertypes or their overrides.
-
overridesOnly
public java.util.List<HierarchicType> overridesOnly()
Accessor for finding just overrides for the main type (if any).
-
getStaticFields
public ResolvedField[] getStaticFields()
Method for finding all static fields of the main type (except for ones possibly filtered out by filter) and applying annotation overrides, if any, to annotations.- Since:
- 1.2.0
-
getStaticMethods
public ResolvedMethod[] getStaticMethods()
Method for finding all static methods of the main type (except for ones possibly filtered out by filter) and applying annotation overrides, if any, to annotations.
-
getMemberFields
public ResolvedField[] getMemberFields()
-
getMemberMethods
public ResolvedMethod[] getMemberMethods()
-
getConstructors
public ResolvedConstructor[] getConstructors()
-
resolveConstructors
protected ResolvedConstructor[] resolveConstructors()
Method that will actually resolve full information (types, annotations) for constructors of the main type.
-
resolveMemberFields
protected ResolvedField[] resolveMemberFields()
Method for fully resolving field definitions and associated annotations. Neither field definitions nor associated annotations inherit, but we may still need to add annotation overrides, as well as filter out filters and annotations that caller is not interested in.
-
resolveMemberMethods
protected ResolvedMethod[] resolveMemberMethods()
-
resolveStaticFields
protected ResolvedField[] resolveStaticFields()
Method for fully resolving static field definitions and associated annotations. Neither field definitions nor associated annotations inherit, but we may still need to add annotation overrides, as well as filter out filters and annotations that caller is not interested in.- Since:
- 1.2.0
-
resolveStaticMethods
protected ResolvedMethod[] resolveStaticMethods()
Method that will actually resolve full information (types, annotations) for static methods, using configured filter.
-
resolveConstructor
protected ResolvedConstructor resolveConstructor(RawConstructor raw)
Method for resolving individual constructor completely
-
resolveField
protected ResolvedField resolveField(RawField raw)
Method for resolving individual field completely
-
resolveMethod
protected ResolvedMethod resolveMethod(RawMethod raw)
Method for resolving individual method completely
-
methodCanInherit
protected boolean methodCanInherit(java.lang.annotation.Annotation annotation)
-
parameterCanInherit
protected boolean parameterCanInherit(java.lang.annotation.Annotation annotation)
-
-