KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > xml > bind > annotation > XmlAnyAttribute


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 JavaDoc;
9 import java.lang.annotation.Retention JavaDoc;
10 import java.lang.annotation.Target JavaDoc;
11 import java.util.Map JavaDoc;
12
13 import static java.lang.annotation.RetentionPolicy.RUNTIME JavaDoc;
14 import static java.lang.annotation.ElementType.FIELD JavaDoc;
15 import static java.lang.annotation.ElementType.METHOD JavaDoc;
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>&#64;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>&#64;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}&lt;{@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 JavaDoc(RUNTIME)
52 @Target JavaDoc({FIELD,METHOD})
53 public @interface XmlAnyAttribute {
54 }
55
Popular Tags