KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > xml > schema > model > impl > SchemaElements


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20
21 package org.netbeans.modules.xml.schema.model.impl;
22
23 import java.util.HashMap JavaDoc;
24 import java.util.HashSet JavaDoc;
25 import java.util.List JavaDoc;
26 import java.util.Map JavaDoc;
27 import java.util.Set JavaDoc;
28 import javax.xml.XMLConstants JavaDoc;
29 import javax.xml.namespace.QName JavaDoc;
30
31 /**
32  * An enumeration representing the valid schema element and attribute
33  * names.
34  * @author Samaresh Panda (Samaresh.Panda@Sun.Com)
35  * @author Chris Webster
36  */

37 public enum SchemaElements {
38     ALL("all"),
39     ANNOTATION("annotation"),
40     ANY("any"),
41     ANYTYPE("anyType"),
42     ANY_ATTRIBUTE("anyAttribute"),
43     APPINFO("appinfo"),
44     ATTRIBUTE("attribute"),
45     ATTRIBUTE_GROUP("attributeGroup"),
46     CHOICE("choice"),
47     COMPLEX_CONTENT("complexContent"),
48     COMPLEX_TYPE("complexType"),
49     DOCUMENTATION("documentation"),
50     ELEMENT("element"),
51     ENUMERATION("enumeration"),
52     EXTENSION("extension"),
53     FIELD("field"),
54     FRACTION_DIGITS("fractionDigits"),
55     GROUP("group"),
56     INCLUDE("include"),
57     IMPORT("import"),
58     KEY("key"),
59     KEYREF("keyref"),
60     LENGTH("length"),
61     LIST("list"),
62     MAX_EXCLUSIVE("maxExclusive"),
63     MAX_INCLUSIVE("maxInclusive"),
64     MIN_EXCLUSIVE("minExclusive"),
65     MIN_INCLUSIVE("minInclusive"),
66     MAX_LENGTH("maxLength"),
67     MIN_LENGTH("minLength"),
68     NOTATION("notation"),
69     PATTERN("pattern"),
70     REDEFINE("redefine"),
71     RESTRICTION("restriction"),
72     SCHEMA("schema"),
73     SELECTOR("selector"),
74     SEQUENCE("sequence"),
75     SIMPLE_CONTENT("simpleContent"),
76     SIMPLE_TYPE("simpleType"),
77     TOTAL_DIGITS("totalDigits"),
78     UNION("union"),
79     UNIQUE("unique"),
80     WHITESPACE("whiteSpace");
81
82     SchemaElements(String JavaDoc docName) {
83         this.docName = docName;
84         //this.possibleAttrs = attrs;
85
}
86     
87     public String JavaDoc getName() {
88         return docName;
89     }
90     
91     public QName JavaDoc getQName() {
92         return new QName JavaDoc(XMLConstants.W3C_XML_SCHEMA_NS_URI, docName);
93     }
94     
95     public static Set JavaDoc<QName JavaDoc> allQNames() {
96         if (allQNames == null) {
97             allQNames = new HashSet JavaDoc<QName JavaDoc>();
98             for (SchemaElements v : values()) {
99                 allQNames.add(v.getQName());
100             }
101         }
102         return allQNames;
103     }
104     
105     private final String JavaDoc docName;
106     private static Set JavaDoc<QName JavaDoc> allQNames = null;
107 }
108
Popular Tags