Skip to content

Commit

Permalink
Fix Javadoc for field reflection hints
Browse files Browse the repository at this point in the history
Closes gh-34297
  • Loading branch information
bclozel committed Jan 21, 2025
1 parent 6863b90 commit e9dc6be
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -32,15 +32,19 @@
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,

Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -199,8 +199,8 @@ public ReflectionHints registerForInterfaces(Class<?> type, Consumer<TypeHint.Bu
}

/**
* 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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,11 @@ public Builder onReachableType(Class<?> reachableType) {
}

/**
* 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,7 @@ public FieldHintPredicate onField(String className, String fieldName) throws Cla
}

/**
* 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
*/
Expand Down

0 comments on commit e9dc6be

Please sign in to comment.