11/*
22 * Copyright (c) 2004, 2024 Oracle and/or its affiliates. All rights reserved.
3+ * Copyright (c) 2026 Contributors to the Eclipse Foundation. All rights reserved.
34 *
45 * This program and the accompanying materials are made available under the
56 * terms of the Eclipse Distribution License v. 1.0, which is available at
67 * http://www.eclipse.org/org/documents/edl-v10.php.
78 *
89 * SPDX-License-Identifier: BSD-3-Clause
910 */
10-
1111package jakarta .xml .bind ;
1212
13- import javax .xml .namespace .QName ;
13+ import javax .xml .namespace .QName ;
1414
1515/**
16- * Provide access to Jakarta XML Binding xml binding data for a Jakarta XML
17- * Binding object.
16+ * Provide access to Jakarta XML Binding xml binding data for a Jakarta XML Binding object.
1817 *
1918 * <p>
2019 * Initially, the intent of this class is to just conceptualize how
21- * a Jakarta XML Binding application developer can access xml binding
22- * information,
20+ * a Jakarta XML Binding application developer can access xml binding information,
2321 * independent if binding model is java to schema or schema to java.
24- * Since accessing the XML element name related to a Jakarta XML Binding element
25- * is
22+ * Since accessing the XML element name related to a Jakarta XML Binding element is
2623 * a highly requested feature, demonstrate access to this
2724 * binding information.
2825 * <p>
@@ -37,62 +34,50 @@ public abstract class JAXBIntrospector {
3734 /**
3835 * Do-nothing constructor for the derived classes.
3936 */
40- protected JAXBIntrospector () {
41- }
37+ protected JAXBIntrospector () {}
4238
4339 /**
44- * <p>
45- * Return true if <code>object</code> represents a Jakarta XML Binding element.
46- * </p>
47- * <p>
48- * Parameter <code>object</code> is a Jakarta XML Binding element for following
49- * cases:
40+ * <p>Return true if <code>object</code> represents a Jakarta XML Binding element.</p>
41+ * <p>Parameter <code>object</code> is a Jakarta XML Binding element for following cases:
5042 * <ol>
51- * <li>It is an instance of <code>jakarta.xml.bind.JAXBElement</code>.</li>
52- * <li>The class of <code>object</code> is annotated with
53- * <code>@XmlRootElement</code>.
54- * </li>
43+ * <li>It is an instance of <code>jakarta.xml.bind.JAXBElement</code>.</li>
44+ * <li>The class of <code>object</code> is annotated with
45+ * <code>@XmlRootElement</code>.
46+ * </li>
5547 * </ol>
5648 *
5749 * @see #getElementName(Object)
5850 */
5951 public abstract boolean isElement (Object object );
6052
6153 /**
62- * <p>
63- * Get xml element qname for <code>jaxbElement</code>.
64- * </p>
54+ * <p>Get xml element qname for <code>jaxbElement</code>.</p>
6555 *
66- * @param jaxbElement is an object that {@link #isElement(Object)} returned
67- * true.
56+ * @param jaxbElement is an object that {@link #isElement(Object)} returned true.
6857 *
6958 * @return xml element qname associated with jaxbElement;
7059 * null if <code>jaxbElement</code> is not a JAXBElement.
7160 */
7261 public abstract QName getElementName (Object jaxbElement );
7362
7463 /**
75- * <p>
76- * Get the element value of a Jakarta XML Binding element.
77- * </p>
64+ * <p>Get the element value of a Jakarta XML Binding element.</p>
7865 *
79- * <p>
80- * Convenience method to abstract whether working with either
81- * a jakarta.xml.bind.JAXBElement instance or an instance of
82- * {@code @XmlRootElement} annotated Java class.
83- * </p>
66+ * <p>Convenience method to abstract whether working with either
67+ * a jakarta.xml.bind.JAXBElement instance or an instance of
68+ * {@code @XmlRootElement} annotated Java class.</p>
8469 *
85- * @param jaxbElement object that #isElement(Object) returns true.
70+ * @param jaxbElement object that #isElement(Object) returns true.
8671 *
8772 * @return The element value of the <code>jaxbElement</code>.
8873 */
8974 public static Object getValue (Object jaxbElement ) {
90- if (jaxbElement instanceof JAXBElement ) {
91- return ((JAXBElement <?>) jaxbElement ).getValue ();
92- } else {
93- // assume that class of this instance is
94- // annotated with @XmlRootElement.
95- return jaxbElement ;
96- }
75+ if (jaxbElement instanceof JAXBElement ) {
76+ return ((JAXBElement <?>)jaxbElement ).getValue ();
77+ } else {
78+ // assume that class of this instance is
79+ // annotated with @XmlRootElement.
80+ return jaxbElement ;
81+ }
9782 }
9883}
0 commit comments