KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > xml > retriever > catalog > model > CatalogQNames


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 package org.netbeans.modules.xml.retriever.catalog.model;
20
21 import java.util.Collections JavaDoc;
22 import java.util.HashSet JavaDoc;
23 import java.util.Set JavaDoc;
24 import javax.xml.namespace.QName JavaDoc;
25
26 public enum CatalogQNames {
27     CATALOG("catalog"),
28     SYSTEM("system"),
29     NEXTCATALOG("nextCatalog");//,
30

31     /*SYSTEMID("systemId"),
32     URI("uri"),
33     XPROJECT_CATALOGFILE_LOCATION("xprojectCatalogFileLocation"),
34     REFERENCING_FILE("referencingFile");*/

35     
36     
37     public static final String JavaDoc CATALOG_NS = "urn:oasis:names:tc:entity:xmlns:xml:catalog";
38     public static final String JavaDoc CATALOG_PREFIX = "cat";
39     
40     private static Set JavaDoc<QName JavaDoc> mappedQNames = new HashSet JavaDoc<QName JavaDoc>();
41     static {
42         mappedQNames.add(CATALOG.getQName());
43         mappedQNames.add(SYSTEM.getQName());
44         mappedQNames.add(NEXTCATALOG.getQName());
45         
46         /*mappedQNames.add(SYSTEMID.getQName());
47         mappedQNames.add(URI.getQName());
48         mappedQNames.add(XPROJECT_CATALOGFILE_LOCATION.getQName());
49         mappedQNames.add(REFERENCING_FILE.getQName());*/

50     }
51
52     private QName JavaDoc qname;
53     
54     CatalogQNames(String JavaDoc localName) {
55         qname = new QName JavaDoc(CATALOG_NS, localName, CATALOG_PREFIX);
56     }
57     
58     public QName JavaDoc getQName() {
59         return qname;
60     }
61
62     public String JavaDoc getLocalName() {
63         return qname.getLocalPart();
64     }
65     
66     public String JavaDoc getQualifiedName() {
67         return qname.getPrefix() + ":" + qname.getLocalPart();
68     }
69     
70     public static Set JavaDoc<QName JavaDoc> getMappedQNames() {
71         return Collections.unmodifiableSet(mappedQNames);
72     }
73 }
74
Popular Tags