From c6cbbedb48a9620c2716bfec0968836878ebeee1 Mon Sep 17 00:00:00 2001 From: Maxim Nesen Date: Mon, 19 Feb 2024 09:02:33 +0100 Subject: [PATCH] Snippet fix Signed-off-by: Maxim Nesen --- .../jakarta/xml/bind/annotation/XmlElements.java | 14 +++++++------- .../java/jakarta/xml/bind/annotation/XmlMixed.java | 10 ++++++---- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/api/src/main/java/jakarta/xml/bind/annotation/XmlElements.java b/api/src/main/java/jakarta/xml/bind/annotation/XmlElements.java index b96e2c3..3ad1280 100644 --- a/api/src/main/java/jakarta/xml/bind/annotation/XmlElements.java +++ b/api/src/main/java/jakarta/xml/bind/annotation/XmlElements.java @@ -37,7 +37,7 @@ * * * This annotation is intended for annotation a JavaBean collection - * property (e.g. List). + * property (e.g. List). * *

Usage

* @@ -54,7 +54,7 @@ * additional common information.

* *
- * + * *

Example 1: Map to a list of elements

* {@snippet : * // Mapped code fragment @@ -62,7 +62,7 @@ * @XmlElements({ * @XmlElement(name="A", type=Integer.class), * @XmlElement(name="B", type=Float.class) - * }) + * }) * public List items; * } * } @@ -114,7 +114,7 @@ * * } * - *

Example 3: Change element name based on type using an adapter. + *

Example 3: Change element name based on type using an adapter. *

* {@snippet : * class Foo { @@ -125,7 +125,7 @@ * }) * Q bar; * } - * + * * @XmlType abstract class P {...} * @XmlType(name="PX") class PX extends P {...} * @XmlType(name="PY") class PY extends P {...} @@ -145,9 +145,9 @@ * * * } - * + * * @author - * @see XmlElement + * @see XmlElement * @see XmlElementRef * @see XmlElementRefs * @see XmlJavaTypeAdapter diff --git a/api/src/main/java/jakarta/xml/bind/annotation/XmlMixed.java b/api/src/main/java/jakarta/xml/bind/annotation/XmlMixed.java index 7e707a1..5a7f7ea 100644 --- a/api/src/main/java/jakarta/xml/bind/annotation/XmlMixed.java +++ b/api/src/main/java/jakarta/xml/bind/annotation/XmlMixed.java @@ -74,9 +74,11 @@ * // Name, Quantity and ProductName. Text data is represented as * // java.util.String for text. * @XmlMixed - * @XmlElementRef(name="productName", type=JAXBElement.class) - * @XmlElementRef(name="quantity", type=JAXBElement.class) - * @XmlElementRef(name="name", type=JAXBElement.class) + * @XmlElementRefs({ + * @XmlElementRef(name="productName", type=JAXBElement.class) + * @XmlElementRef(name="quantity", type=JAXBElement.class) + * @XmlElementRef(name="name", type=JAXBElement.class) + * }) * List getContent() {...} * } * } @@ -98,7 +100,7 @@ * // add child element information item * gcl.add(ObjectFactory.createLetterBodyName("Robert Smith")); * gcl.add("Your order of "); // add text information item as a String - * + * * // add children element information items * gcl.add(ObjectFactory.createLetterBodyQuantity(new BigInteger("1"))); * gcl.add(ObjectFactory.createLetterBodyProductName("Baby Monitor"));