< prev index next >

src/java.xml.bind/share/classes/com/sun/xml/internal/txw2/annotation/XmlElement.java

Print this page




  33 import java.lang.annotation.Retention;
  34 import java.lang.annotation.Target;
  35 
  36 import static java.lang.annotation.ElementType.TYPE;
  37 import static java.lang.annotation.RetentionPolicy.RUNTIME;
  38 import static java.lang.annotation.ElementType.METHOD;
  39 
  40 /**
  41  * Specifies the name of the XML element.
  42  *
  43  * <h2>Used on method</h2>
  44  * <p>
  45  * When used on methods declared on interfaces that derive
  46  * from {@link TypedXmlWriter}, it specifies that the invocation
  47  * of the method will produce an element of the specified name.
  48  *
  49  * <p>
  50  * The method signature has to match one of the following patterns.
  51  *
  52  * <dl>
  53  *  <dt>Child writer: <tt>TW foo()</tt></dt>
  54  *  <dd>TW must be an interface derived from {@link TypedXmlWriter}.
  55  *      When this method is called, a new child element is started,
  56  *      and its content can be written by using the returned <tt>TW</tt>
  57  *      object. This child element will be ended when its _commit method
  58  *      is called.
  59  *  <dt>Leaf element: <tt>void foo(DT1,DT2,...)</tt></dt>
  60  *  <dd>DTi must be datatype objects.
  61  *      When this method is called, a new child element is started,
  62  *      followed by the whitespace-separated text data from each of
  63  *      the datatype objects, followed by the end tag.
  64  * </dl>
  65  *
  66  * <h2>Used on interface</h2>
  67  * <p>
  68  * When used on interfaces that derive from {@link TypedXmlWriter},
  69  * it associates an element name with that interface. This name is
  70  * used in a few places, such as in {@link TXW#create(Class,XmlSerializer)}
  71  * and {@link TypedXmlWriter#_element(Class)}.
  72  *
  73  *
  74  * @author Kohsuke Kawaguchi
  75  */
  76 @Retention(RUNTIME)
  77 @Target({METHOD,TYPE})
  78 public @interface XmlElement {
  79     /**


  33 import java.lang.annotation.Retention;
  34 import java.lang.annotation.Target;
  35 
  36 import static java.lang.annotation.ElementType.TYPE;
  37 import static java.lang.annotation.RetentionPolicy.RUNTIME;
  38 import static java.lang.annotation.ElementType.METHOD;
  39 
  40 /**
  41  * Specifies the name of the XML element.
  42  *
  43  * <h2>Used on method</h2>
  44  * <p>
  45  * When used on methods declared on interfaces that derive
  46  * from {@link TypedXmlWriter}, it specifies that the invocation
  47  * of the method will produce an element of the specified name.
  48  *
  49  * <p>
  50  * The method signature has to match one of the following patterns.
  51  *
  52  * <dl>
  53  *  <dt>Child writer: {@code TW foo()}</dt>
  54  *  <dd>TW must be an interface derived from {@link TypedXmlWriter}.
  55  *      When this method is called, a new child element is started,
  56  *      and its content can be written by using the returned {@code TW}
  57  *      object. This child element will be ended when its _commit method
  58  *      is called.
  59  *  <dt>Leaf element: {@code void foo(DT1,DT2,...)}</dt>
  60  *  <dd>DTi must be datatype objects.
  61  *      When this method is called, a new child element is started,
  62  *      followed by the whitespace-separated text data from each of
  63  *      the datatype objects, followed by the end tag.
  64  * </dl>
  65  *
  66  * <h2>Used on interface</h2>
  67  * <p>
  68  * When used on interfaces that derive from {@link TypedXmlWriter},
  69  * it associates an element name with that interface. This name is
  70  * used in a few places, such as in {@link TXW#create(Class,XmlSerializer)}
  71  * and {@link TypedXmlWriter#_element(Class)}.
  72  *
  73  *
  74  * @author Kohsuke Kawaguchi
  75  */
  76 @Retention(RUNTIME)
  77 @Target({METHOD,TYPE})
  78 public @interface XmlElement {
  79     /**
< prev index next >