KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openharmonise > commons > xml > namespace > NamespaceType


1 /*
2  * The contents of this file are subject to the
3  * Mozilla Public License Version 1.1 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at http://www.mozilla.org/MPL/
6  *
7  * Software distributed under the License is distributed on an "AS IS"
8  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
9  * See the License for the specific language governing rights and
10  * limitations under the License.
11  *
12  * The Initial Developer of the Original Code is Simulacra Media Ltd.
13  * Portions created by Simulacra Media Ltd are Copyright (C) Simulacra Media Ltd, 2004.
14  *
15  * All Rights Reserved.
16  *
17  * Contributor(s):
18  */

19 package org.openharmonise.commons.xml.namespace;
20
21 /**
22  * Static enummeration containing constants describing regularly used namespaces. Each namespace
23  * contains its URI and an accepted prefix.
24  *
25  * @author Matthew Large
26  * @version $Revision: 1.3 $
27  *
28  */

29 public class NamespaceType {
30
31     /**
32      * Namespace prefix.
33      */

34     private String JavaDoc m_sPrefix = null;
35     
36     /**
37      * Namespace URI.
38      */

39     private String JavaDoc m_sURI = null;
40
41     
42     /**
43      * Namespace information for general Harmonise elements.
44      */

45     public static final NamespaceType OHRM = new NamespaceType("ohrm", "OHRM");
46     
47     /**
48      * Namespace information for Harmonise Role Based Security elements.
49      */

50     public static final NamespaceType OHRM_RBS = new NamespaceType("ohrm_rbs", "OHRM_RBS");
51     
52     /**
53      * Namespace information for Harmonise workflow elements.
54      */

55     public static final NamespaceType OHRM_WORKFLOW = new NamespaceType("ohflw", "OHRM_WORKFLOW");
56     
57     /**
58      * Namespace information for Harmonise Document elements.
59      */

60     public static final NamespaceType OHRM_DOC = new NamespaceType("ohrmd","http://www.openharmonise.org/harmonise/document");
61     
62     /**
63      * Namespace information for WebDAV elements.
64      */

65     public static final NamespaceType DAV = new NamespaceType("D", "DAV:");
66     
67     /**
68      * Namespace information for XMLSchema elements.
69      */

70     public static final NamespaceType XML_SCHEMA = new NamespaceType("xsd", "http://www.w3.org/2001/XMLSchema");
71     
72     /**
73      * Namespace information for XML elements.
74      */

75     public static final NamespaceType XML = new NamespaceType("xml", "http://www.w3.org/XML/1998/namespace");
76     
77     /**
78      * Namespace information for XML Schema Instance elements.
79      */

80     public static final NamespaceType XML_SCHEMA_INSTANCE = new NamespaceType("xsi", "http://www.w3.org/2001/XMLSchema-instance");
81     
82     /**
83      * Namespace information for LOM elements.
84      */

85     public static final NamespaceType LOM_XML = new NamespaceType("lom", "http://www.imsglobal.org/xsd/imsmd_v1p2");
86     
87     /**
88      * Namespace information for Curriculum Online elements.
89      */

90     public static final NamespaceType COL_RDF = new NamespaceType("col", "hhttp://www.dfes.gov.uk/curriculumonline/ts/metadata/rdf/col#");
91     
92     /**
93      * Namespace information for LOM Classification elements.
94      */

95     public static final NamespaceType LOM_CLS = new NamespaceType("lom_cls", "http://www.imsproject.org/rdf/imsmd_classificationv1p2#");
96     
97     /**
98      * Namespace information for RDF elements.
99      */

100     public static final NamespaceType RDF = new NamespaceType("rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#");
101     
102     /**
103      * Namespace information for RDFSchema elements.
104      */

105     public static final NamespaceType RDF_SCHEMA = new NamespaceType("rdfs", "http://www.w3.org/2000/01/rdf-schema#");
106     
107     /**
108      * Namespace information for XSL:T elements.
109      */

110     public static final NamespaceType XSLT = new NamespaceType("xsl", "http://www.w3.org/1999/XSL/Transform");
111     
112     /**
113      * Namespace information for XSL:FO elements.
114      */

115     public static final NamespaceType XSLFO = new NamespaceType("fo", "http://www.w3.org/1999/XSL/Format");
116     
117     /**
118      * Namespace information for SOAP Encoding elements.
119      */

120     public static final NamespaceType SOAP_ENCODING = new NamespaceType("enc", "http://www.w3.org/2003/05/soap-encoding");
121     
122     /**
123      * Namespace information for SVG (Scaleable Vector Graphics) elements.
124      */

125     public static final NamespaceType SVG = new NamespaceType("svg", "http://www.w3.org/2000/svg");
126     
127     /**
128      * Namespace information for XInclude elements.
129      */

130     public static final NamespaceType XINCLUDE = new NamespaceType("xi","http://www.w3.org/2001/XInclude");
131     
132     /**
133      * Constructs a new NamespaceType instance with a given prefix and uri.
134      *
135      * @param sPrefix namespace prefix
136      * @param sURI namespace URI
137      */

138     protected NamespaceType(String JavaDoc sPrefix, String JavaDoc sURI) {
139         super();
140         this.m_sPrefix = sPrefix;
141         this.m_sURI = sURI;
142     }
143     
144     /**
145      * Returns an accepted prefix for this namespace.
146      *
147      * @return Prefix String for this namespace
148      */

149     public String JavaDoc getPrefix() {
150         return this.m_sPrefix;
151     }
152     
153     /**
154      * Returns the URI for this namespace.
155      *
156      * @return URI String for this namespace
157      */

158     public String JavaDoc getURI() {
159         return this.m_sURI;
160     }
161     
162     /* (non-Javadoc)
163      * @see java.lang.Object#toString()
164      */

165     public String JavaDoc toString() {
166         return new StringBuffer JavaDoc(this.m_sPrefix).append(":").append(this.m_sURI).toString();
167     }
168
169 }
170
Popular Tags