parent
6863b904b5
commit
e9dc6be51c
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2024 the original author or authors.
|
||||
* Copyright 2002-2025 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -32,15 +32,19 @@ import java.lang.reflect.Method;
|
|||
public enum MemberCategory {
|
||||
|
||||
/**
|
||||
* A category that represents public {@linkplain Field fields}.
|
||||
* @see Class#getFields()
|
||||
* A category that represents reflective field access on public {@linkplain Field fields}.
|
||||
* @see Field#get(Object)
|
||||
* @see Field#set(Object, Object)
|
||||
*/
|
||||
PUBLIC_FIELDS,
|
||||
|
||||
/**
|
||||
* A category that represents {@linkplain Class#getDeclaredFields() declared
|
||||
* fields}: all fields defined by the class but not inherited fields.
|
||||
* A category that represents reflective field access on
|
||||
* {@linkplain Class#getDeclaredFields() declared fields}: all fields defined by the
|
||||
* class but not inherited fields.
|
||||
* @see Class#getDeclaredFields()
|
||||
* @see Field#get(Object)
|
||||
* @see Field#set(Object, Object)
|
||||
*/
|
||||
DECLARED_FIELDS,
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2023 the original author or authors.
|
||||
* Copyright 2002-2025 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -199,8 +199,8 @@ public class ReflectionHints {
|
|||
}
|
||||
|
||||
/**
|
||||
* Register the need for reflection on the specified {@link Field}.
|
||||
* @param field the field that requires reflection
|
||||
* Register the need for reflective field access on the specified {@link Field}.
|
||||
* @param field the field that requires reflective access
|
||||
* @return {@code this}, to facilitate method chaining
|
||||
*/
|
||||
public ReflectionHints registerField(Field field) {
|
||||
|
|
|
@ -182,9 +182,11 @@ public final class TypeHint implements ConditionalHint {
|
|||
}
|
||||
|
||||
/**
|
||||
* Register the need for reflection on the field with the specified name.
|
||||
* Register the need for reflective access on the field with the specified name.
|
||||
* @param name the name of the field
|
||||
* @return {@code this}, to facilitate method chaining
|
||||
* @see java.lang.reflect.Field#get(Object)
|
||||
* @see java.lang.reflect.Field#set(Object, Object)
|
||||
*/
|
||||
public Builder withField(String name) {
|
||||
this.fields.add(name);
|
||||
|
|
|
@ -183,9 +183,7 @@ public class ReflectionHintsPredicates {
|
|||
}
|
||||
|
||||
/**
|
||||
* Return a predicate that checks whether a reflection hint is registered for the given field.
|
||||
* By default, unsafe or write access is not considered.
|
||||
* <p>The returned type exposes additional methods that refine the predicate behavior.
|
||||
* Return a predicate that checks whether a reflective field access hint is registered for the given field.
|
||||
* @param field the field
|
||||
* @return the {@link RuntimeHints} predicate
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue