1 /*
   2  * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package javax.xml.bind.annotation;
  27 
  28 import javax.xml.namespace.QName;
  29 import java.lang.annotation.Retention;
  30 import java.lang.annotation.Target;
  31 import java.util.Map;
  32 
  33 import static java.lang.annotation.RetentionPolicy.RUNTIME;
  34 import static java.lang.annotation.ElementType.FIELD;
  35 import static java.lang.annotation.ElementType.METHOD;
  36 
  37 /**
  38  * <p>
  39  * Maps a JavaBean property to a map of wildcard attributes.
  40  *
  41  * <p> <b>Usage</b> </p>
  42  * <p>
  43  * The <tt>@XmlAnyAttribute</tt> annotation can be used with the
  44  * following program elements:
  45  * <ul>
  46  *   <li> JavaBean property </li>
  47  *   <li> non static, non transient field </li>
  48  * </ul>
  49  *
  50  * <p>See "Package Specification" in javax.xml.bind.package javadoc for
  51  * additional common information.</p>
  52  *
  53  * The usage is subject to the following constraints:
  54  * <ul>
  55  *   <li> At most one field or property in a class can be annotated
  56  *        with <tt>@XmlAnyAttribute</tt>.  </li>
  57  *   <li> The type of the property or the field must <tt>java.util.Map</tt> </li>
  58  * </ul>
  59  *
  60  * <p>
  61  * While processing attributes to be unmarshalled into a value class,
  62  * each attribute that is not statically associated with another
  63  * JavaBean property, via {@link XmlAttribute}, is entered into the
  64  * wildcard attribute map represented by
  65  * {@link Map}&lt;{@link QName},{@link Object}&gt;. The attribute QName is the
  66  * map's key. The key's value is the String value of the attribute.
  67  *
  68  * @author Kohsuke Kawaguchi, Sun Microsystems, Inc.
  69  * @since 1.6, JAXB 2.0
  70  */
  71 @Retention(RUNTIME)
  72 @Target({FIELD,METHOD})
  73 public @interface XmlAnyAttribute {
  74 }