KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > ws > jaxme > xs > xml > XsTAttribute


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;
18
19 import org.xml.sax.SAXException JavaDoc;
20
21
22 /** <p>Interface of <code>xs:attribute</code>, following
23  * this specification:
24  * <pre>
25  * &lt;xs:complexType name="attribute"&gt;
26  * &lt;xs:complexContent&gt;
27  * &lt;xs:extension base="xs:annotated"&gt;
28  * &lt;xs:sequence&gt;
29  * &lt;xs:element name="simpleType" minOccurs="0" type="xs:localSimpleType"/&gt;
30  * &lt;/xs:sequence&gt;
31  * &lt;xs:attributeGroup ref="xs:defRef"/&gt;
32  * &lt;xs:attribute name="type" type="xs:QName"/&gt;
33  * &lt;xs:attribute name="use" use="optional" default="optional"&gt;
34  * &lt;xs:simpleType&gt;
35  * &lt;xs:restriction base="xs:NMTOKEN"&gt;
36  * &lt;xs:enumeration value="prohibited"/&gt;
37  * &lt;xs:enumeration value="optional"/&gt;
38  * &lt;xs:enumeration value="required"/&gt;
39  * &lt;/xs:restriction&gt;
40  * &lt;/xs:simpleType&gt;
41  * &lt;/xs:attribute&gt;
42  * &lt;xs:attribute name="default" type="xs:string"/&gt;
43  * &lt;xs:attribute name="fixed" type="xs:string"/&gt;
44  * &lt;xs:attribute name="form" type="xs:formChoice"/&gt;
45  * &lt;/xs:extension&gt;
46  * &lt;/xs:complexContent&gt;
47  * &lt;/xs:complexType&gt;
48  * </pre></p>
49  *
50  * @author <a HREF="mailto:joe@ispsoft.de">Jochen Wiedmann</a>
51  */

52 public interface XsTAttribute extends XsTAnnotated {
53   public static class Use {
54     private String JavaDoc value;
55     Use(String JavaDoc pValue) { value = pValue; }
56     public String JavaDoc toString() { return value; }
57     public String JavaDoc getValue() { return value; }
58     public static Use valueOf(String JavaDoc pValue) {
59       if ("prohibited".equals(pValue)) {
60         return PROHIBITED;
61       } else if ("optional".equals(pValue)) {
62         return OPTIONAL;
63       } else if ("required".equals(pValue)) {
64         return REQUIRED;
65       } else {
66         throw new IllegalArgumentException JavaDoc("Invalid value for Use: " + pValue + ", expected 'prohibited', 'optional', or 'use'");
67       }
68     }
69   }
70
71   public static final Use PROHIBITED = new Use("prohibited");
72   public static final Use OPTIONAL = new Use("optional");
73   public static final Use REQUIRED = new Use("required");
74
75   public XsTLocalSimpleType createSimpleType();
76
77   public XsTLocalSimpleType getSimpleType();
78
79   public void setType(XsQName pType);
80
81   public XsQName getType();
82
83   public void setUse(Use pUse);
84
85   public Use getUse();
86
87   public void setDefault(String JavaDoc pDefault);
88
89   public String JavaDoc getDefault();
90
91   public void setFixed(String JavaDoc pFixed);
92
93   public String JavaDoc getFixed();
94
95   public void setForm(XsFormChoice pForm) throws SAXException JavaDoc;
96
97   public XsFormChoice getForm();
98
99   public void setName(XsNCName pName);
100
101   public XsNCName getName();
102
103   public void setRef(XsQName pRef);
104
105   public XsQName getRef();
106
107   public boolean isGlobal();
108 }
109
Popular Tags