Class ReflectionUtils.TypeMetadata
java.lang.Object
io.fluxzero.common.reflection.ReflectionUtils.TypeMetadata
- Enclosing class:
ReflectionUtils
Lazily computed reflection metadata for a single Java type.
This is the central cache for type-level reflection in Fluxzero. It keeps the structural model of a type
together in one place: methods, fields, property descriptors, type annotations, annotated members, cached
property-path accessors, and compiled MemberInvoker instances.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class -
Method Summary
Modifier and TypeMethodDescriptionannotatedExecutables(Class<? extends Annotation> annotation) Returns annotated methods, including inherited methods, followed by annotated constructors declared by this type.annotatedFields(Class<? extends Annotation> annotation) annotatedMethods(Class<? extends Annotation> annotation) List<? extends AccessibleObject> annotatedProperties(Class<? extends Annotation> annotation) Optional<? extends AccessibleObject> annotatedProperty(Class<? extends Annotation> annotation) annotatedPropertyInvoker(Class<? extends Annotation> annotation) <T> Optional<T> annotationAs(AnnotatedElement member, Class<? extends Annotation> annotationType, Class<? extends T> returnType) annotations(AnnotatedElement element) booleandeclaresField(String fieldName) Optional<Constructor<?>> <A extends Annotation>
Optional<A> fieldAnnotation(Field field, Class<? extends Annotation> annotation) fields()<A extends Annotation>
Optional<A> methodAnnotation(Executable executable, Class<? extends Annotation> annotation) <A extends Annotation>
List<A> methodAnnotations(Executable executable, Class<? extends Annotation> annotation) methods()propertyPath(String propertyPath) <M> MspecializedMetadata(Class<M> metadataType, Function<Class<?>, ? extends M> factory) Returns type-specific structural metadata owned by this central type cache.Class<?> type()<A extends Annotation>
AtypeAnnotation(Class<? extends Annotation> annotationType) Collection<? extends Annotation>
-
Method Details
-
type
-
methods
-
defaultConstructor
-
method
-
methods
-
fields
-
field
-
declaresField
-
typeAnnotations
-
annotations
-
typeAnnotation
-
annotatedFields
-
annotatedMethods
-
annotatedExecutables
Returns annotated methods, including inherited methods, followed by annotated constructors declared by this type. -
annotatedProperties
-
annotatedProperty
public Optional<? extends AccessibleObject> annotatedProperty(Class<? extends Annotation> annotation) -
annotatedPropertyInvoker
-
getter
-
setter
-
propertyPath
-
invoker
-
specializedMetadata
Returns type-specific structural metadata owned by this central type cache.SDK features can use this extension point for immutable metadata that is derived only from
type(). Runtime or instance state must not be captured by the factory or the returned value.- Type Parameters:
M- metadata type- Parameters:
metadataType- unique metadata kind and expected result typefactory- computes the metadata from this Java type on first access- Returns:
- the cached metadata instance
-
fieldAnnotation
public <A extends Annotation> Optional<A> fieldAnnotation(Field field, Class<? extends Annotation> annotation) -
methodAnnotation
public <A extends Annotation> Optional<A> methodAnnotation(Executable executable, Class<? extends Annotation> annotation) -
methodAnnotations
public <A extends Annotation> List<A> methodAnnotations(Executable executable, Class<? extends Annotation> annotation) -
annotationAs
public <T> Optional<T> annotationAs(AnnotatedElement member, Class<? extends Annotation> annotationType, Class<? extends T> returnType)
-