1 /* 2 * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 3 * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. 4 */ 5 6 package javax.xml.bind.annotation; 7 8 import javax.xml.namespace.QName; 9 import java.lang.annotation.Retention; 10 import java.lang.annotation.Target; 11 import java.util.Map; 12 13 import static java.lang.annotation.RetentionPolicy.RUNTIME; 14 import static java.lang.annotation.ElementType.FIELD; 15 import static java.lang.annotation.ElementType.METHOD; 16 17 /** 18 * <p> 19 * Maps a JavaBean property to a map of wildcard attributes. 20 * 21 * <p> <b>Usage</b> </p> 22 * <p> 23 * The <tt>@XmlAnyAttribute</tt> annotation can be used with the 24 * following program elements: 25 * <ul> 26 * <li> JavaBean property </li> 27 * <li> non static, non transient field </li> 28 * </ul> 29 * 30 * <p>See "Package Specification" in javax.xml.bind.package javadoc for 31 * additional common information.</p> 32 * 33 * The usage is subject to the following constraints: 34 * <ul> 35 * <li> At most one field or property in a class can be annotated 36 * with <tt>@XmlAnyAttribute</tt>. </li> 37 * <li> The type of the property or the field must <tt>java.util.Map</tt> </li> 38 * </ul> 39 * 40 * <p> 41 * While processing attributes to be unmarshalled into a value class, 42 * each attribute that is not statically associated with another 43 * JavaBean property, via {@link XmlAttribute}, is entered into the 44 * wildcard attribute map represented by 45 * {@link Map}<{@link QName},{@link Object}>. The attribute QName is the 46 * map's key. The key's value is the String value of the attribute. 47 * 48 * @author Kohsuke Kawaguchi, Sun Microsystems, Inc. 49 * @since JAXB2.0 50 */ 51 @Retention(RUNTIME) 52 @Target({FIELD,METHOD}) 53 public @interface XmlAnyAttribute { 54 } 55