KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > ws > jaxme > xs > xml > impl > XsTAnnotatedImpl


1 /*
2  * Copyright 2003, 2004 The Apache Software Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15
16  */

17 package org.apache.ws.jaxme.xs.xml.impl;
18
19 import org.apache.ws.jaxme.xs.xml.*;
20
21
22 /** <p>Implementation of an annotated element, as specified
23  * by the following:
24  * <pre>
25  * &lt;xs:complexType name="annotated"&gt;
26  * &lt;xs:annotation&gt;
27  * &lt;xs:documentation&gt;
28  * This type is extended by all types which allow annotation
29  * other than &lt;schema&gt; itself.
30  * &lt;/xs:documentation&gt;
31  * &lt;/xs:annotation&gt;
32  * &lt;xs:complexContent&gt;
33  * &lt;xs:extension base="xs:openAttrs"&gt;
34  * &lt;xs:sequence&gt;
35  * &lt;xs:element ref="xs:annotation" minOccurs="0"/&gt;
36  * &lt;/xs:sequence&gt;
37  * &lt;xs:attribute name="id" type="xs:ID"/&gt;
38  * &lt;/xs:extension&gt;
39  * &lt;/xs:complexContent&gt;
40  * &lt;/xs:complexType&gt;
41  * </pre></p>
42  *
43  * @author <a HREF="mailto:joe@ispsoft.de">Jochen Wiedmann</a>
44  */

45 public class XsTAnnotatedImpl extends XsTOpenAttrsImpl implements XsTAnnotated {
46   private XsEAnnotation annotation;
47   private XsID id;
48
49   protected XsTAnnotatedImpl(XsObject pParent) {
50     super(pParent);
51   }
52
53   public XsEAnnotation createAnnotation() {
54     if (annotation != null) {
55       throw new NullPointerException JavaDoc("Multiple 'annotation' elements are forbidden.");
56     }
57     return annotation = getObjectFactory().newXsEAnnotation(this);
58   }
59
60   public XsEAnnotation getAnnotation() {
61     return annotation;
62   }
63
64   public void setId(XsID pId) {
65     id = pId;
66   }
67
68   public XsID getId() {
69     return id;
70   }
71 }
72
Popular Tags