325N/A * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. 325N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 325N/A * This code is free software; you can redistribute it and/or modify it 325N/A * under the terms of the GNU General Public License version 2 only, as 325N/A * published by the Free Software Foundation. Oracle designates this 325N/A * particular file as subject to the "Classpath" exception as provided 325N/A * by Oracle in the LICENSE file that accompanied this code. 325N/A * This code is distributed in the hope that it will be useful, but WITHOUT 325N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 325N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 325N/A * version 2 for more details (a copy is included in the LICENSE file that 325N/A * accompanied this code). 325N/A * You should have received a copy of the GNU General Public License version 325N/A * 2 along with this work; if not, write to the Free Software Foundation, 325N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 325N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 325N/A * or visit www.oracle.com if you need additional information or have any 325N/A * Maps a JavaBean property to a XML attribute. 325N/A * <p> <b>Usage</b> </p> 325N/A * The <tt>@XmlAttribute</tt> annotation can be used with the 325N/A * following program elements: 325N/A * <li> JavaBean property </li> 325N/A * <p> A static final field is mapped to a XML fixed attribute. 325N/A * <p>See "Package Specification" in javax.xml.bind.package javadoc for 325N/A * additional common information.</p> 325N/A * The usage is subject to the following constraints: 325N/A * <li> If type of the field or the property is a collection 325N/A * type, then the collection item type must be mapped to schema 325N/A * @XmlAttribute List<Integer> items; //legal 325N/A * @XmlAttribute List<Bar> foo; // illegal if Bar does not map to a schema simple type 325N/A * <li> If the type of the field or the property is a non 325N/A * collection type, then the type of the property or field 325N/A * must map to a simple schema type. 325N/A * @XmlAttribute int foo; // legal 325N/A * @XmlAttribute Foo foo; // illegal if Foo does not map to a schema simple type 325N/A * <li> This annotation can be used with the following annotations: 325N/A * {@link XmlSchemaType}, 325N/A * {@link XmlAttachmentRef}, 325N/A * {@link XmlInlineBinaryData}, 325N/A * <p> <b>Example 1: </b>Map a JavaBean property to an XML attribute.</p> 325N/A * //Example: Code fragment 325N/A * public class USPrice { 325N/A * public java.math.BigDecimal getPrice() {...} ; 325N/A * public void setPrice(java.math.BigDecimal ) {...}; 325N/A * <!-- Example: XML Schema fragment --> 325N/A * <xs:complexType name="USPrice"> 325N/A * <xs:attribute name="price" type="xs:decimal"/> 325N/A * <p> <b>Example 2: </b>Map a JavaBean property to an XML attribute with anonymous type.</p> 325N/A * See Example 7 in @{@link XmlType}. 325N/A * <p> <b>Example 3: </b>Map a JavaBean collection property to an XML attribute.</p> 325N/A * // Example: Code fragment 325N/A * @XmlAttribute List<Integer> items; 325N/A * <!-- Example: XML Schema fragment --> 325N/A * <xs:complexType name="foo"> 325N/A * <xs:attribute name="items"> 325N/A * <xs:list itemType="xs:int"/> 325N/A * @author Sekhar Vajjhala, Sun Microsystems, Inc. 325N/A * Name of the XML Schema attribute. By default, the XML Schema 325N/A * attribute name is derived from the JavaBean property name. 325N/A * Specifies if the XML Schema attribute is optional or 325N/A * required. If true, then the JavaBean property is mapped to a 325N/A * XML Schema attribute that is required. Otherwise it is mapped 325N/A * to a XML Schema attribute that is optional. 325N/A * Specifies the XML target namespace of the XML Schema