8374749: Clarify AnnotationValue specification

Reviewed-by: liach, iris
This commit is contained in:
Joe Darcy 2026-01-09 02:27:16 +00:00
parent 368de9ff2e
commit 9932c78c23
2 changed files with 13 additions and 9 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2026, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -36,6 +36,8 @@ import javax.lang.model.type.DeclaredType;
* method. There is no guarantee that any particular annotation will
* always be represented by the same object.
*
* @jls 9.6 Annotation Interfaces
* @jls 9.7 Annotations
* @since 1.6
*/
public interface AnnotationMirror {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2026, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -27,14 +27,16 @@ package javax.lang.model.element;
/**
* Represents a value of an annotation interface element.
* A value is of one of the following types:
* <ul><li> a wrapper class (such as {@link Integer}) for a primitive type
* <li> {@code String}
* <li> {@code TypeMirror}
* <li> {@code VariableElement} (representing an enum constant)
* <li> {@code AnnotationMirror}
* A value is of one of the following types (JLS {@jls 9.6.1}):
* <ul><li> a {@linkplain java.lang##wrapperClass wrapper class} to hold a
* primitive type, such as an {@code Integer} object to hold an
* {@code int}
* <li> {@code String} representing a {@code String}
* <li> {@link javax.lang.model.type.TypeMirror TypeMirror} representing a {@code Class} literal
* <li> {@link VariableElement} representing an enum constant
* <li> {@link AnnotationMirror} representing an annotation
* <li> {@code List<? extends AnnotationValue>}
* (representing the elements, in declared order, if the value is an array)
* representing the elements, in declared order, if the value is an array
* </ul>
*
* @since 1.6