001: /*
002: * The contents of this file are subject to the
003: * Mozilla Public License Version 1.1 (the "License");
004: * you may not use this file except in compliance with the License.
005: * You may obtain a copy of the License at http://www.mozilla.org/MPL/
006: *
007: * Software distributed under the License is distributed on an "AS IS"
008: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
009: * See the License for the specific language governing rights and
010: * limitations under the License.
011: *
012: * The Initial Developer of the Original Code is Simulacra Media Ltd.
013: * Portions created by Simulacra Media Ltd are Copyright (C) Simulacra Media Ltd, 2004.
014: *
015: * All Rights Reserved.
016: *
017: * Contributor(s):
018: */
019: package org.openharmonise.commons.xml.namespace;
020:
021: /**
022: * Static enummeration containing constants describing regularly used namespaces. Each namespace
023: * contains its URI and an accepted prefix.
024: *
025: * @author Matthew Large
026: * @version $Revision: 1.3 $
027: *
028: */
029: public class NamespaceType {
030:
031: /**
032: * Namespace prefix.
033: */
034: private String m_sPrefix = null;
035:
036: /**
037: * Namespace URI.
038: */
039: private String m_sURI = null;
040:
041: /**
042: * Namespace information for general Harmonise elements.
043: */
044: public static final NamespaceType OHRM = new NamespaceType("ohrm",
045: "OHRM");
046:
047: /**
048: * Namespace information for Harmonise Role Based Security elements.
049: */
050: public static final NamespaceType OHRM_RBS = new NamespaceType(
051: "ohrm_rbs", "OHRM_RBS");
052:
053: /**
054: * Namespace information for Harmonise workflow elements.
055: */
056: public static final NamespaceType OHRM_WORKFLOW = new NamespaceType(
057: "ohflw", "OHRM_WORKFLOW");
058:
059: /**
060: * Namespace information for Harmonise Document elements.
061: */
062: public static final NamespaceType OHRM_DOC = new NamespaceType(
063: "ohrmd", "http://www.openharmonise.org/harmonise/document");
064:
065: /**
066: * Namespace information for WebDAV elements.
067: */
068: public static final NamespaceType DAV = new NamespaceType("D",
069: "DAV:");
070:
071: /**
072: * Namespace information for XMLSchema elements.
073: */
074: public static final NamespaceType XML_SCHEMA = new NamespaceType(
075: "xsd", "http://www.w3.org/2001/XMLSchema");
076:
077: /**
078: * Namespace information for XML elements.
079: */
080: public static final NamespaceType XML = new NamespaceType("xml",
081: "http://www.w3.org/XML/1998/namespace");
082:
083: /**
084: * Namespace information for XML Schema Instance elements.
085: */
086: public static final NamespaceType XML_SCHEMA_INSTANCE = new NamespaceType(
087: "xsi", "http://www.w3.org/2001/XMLSchema-instance");
088:
089: /**
090: * Namespace information for LOM elements.
091: */
092: public static final NamespaceType LOM_XML = new NamespaceType(
093: "lom", "http://www.imsglobal.org/xsd/imsmd_v1p2");
094:
095: /**
096: * Namespace information for Curriculum Online elements.
097: */
098: public static final NamespaceType COL_RDF = new NamespaceType(
099: "col",
100: "hhttp://www.dfes.gov.uk/curriculumonline/ts/metadata/rdf/col#");
101:
102: /**
103: * Namespace information for LOM Classification elements.
104: */
105: public static final NamespaceType LOM_CLS = new NamespaceType(
106: "lom_cls",
107: "http://www.imsproject.org/rdf/imsmd_classificationv1p2#");
108:
109: /**
110: * Namespace information for RDF elements.
111: */
112: public static final NamespaceType RDF = new NamespaceType("rdf",
113: "http://www.w3.org/1999/02/22-rdf-syntax-ns#");
114:
115: /**
116: * Namespace information for RDFSchema elements.
117: */
118: public static final NamespaceType RDF_SCHEMA = new NamespaceType(
119: "rdfs", "http://www.w3.org/2000/01/rdf-schema#");
120:
121: /**
122: * Namespace information for XSL:T elements.
123: */
124: public static final NamespaceType XSLT = new NamespaceType("xsl",
125: "http://www.w3.org/1999/XSL/Transform");
126:
127: /**
128: * Namespace information for XSL:FO elements.
129: */
130: public static final NamespaceType XSLFO = new NamespaceType("fo",
131: "http://www.w3.org/1999/XSL/Format");
132:
133: /**
134: * Namespace information for SOAP Encoding elements.
135: */
136: public static final NamespaceType SOAP_ENCODING = new NamespaceType(
137: "enc", "http://www.w3.org/2003/05/soap-encoding");
138:
139: /**
140: * Namespace information for SVG (Scaleable Vector Graphics) elements.
141: */
142: public static final NamespaceType SVG = new NamespaceType("svg",
143: "http://www.w3.org/2000/svg");
144:
145: /**
146: * Namespace information for XInclude elements.
147: */
148: public static final NamespaceType XINCLUDE = new NamespaceType(
149: "xi", "http://www.w3.org/2001/XInclude");
150:
151: /**
152: * Constructs a new NamespaceType instance with a given prefix and uri.
153: *
154: * @param sPrefix namespace prefix
155: * @param sURI namespace URI
156: */
157: protected NamespaceType(String sPrefix, String sURI) {
158: super ();
159: this .m_sPrefix = sPrefix;
160: this .m_sURI = sURI;
161: }
162:
163: /**
164: * Returns an accepted prefix for this namespace.
165: *
166: * @return Prefix String for this namespace
167: */
168: public String getPrefix() {
169: return this .m_sPrefix;
170: }
171:
172: /**
173: * Returns the URI for this namespace.
174: *
175: * @return URI String for this namespace
176: */
177: public String getURI() {
178: return this .m_sURI;
179: }
180:
181: /* (non-Javadoc)
182: * @see java.lang.Object#toString()
183: */
184: public String toString() {
185: return new StringBuffer(this .m_sPrefix).append(":").append(
186: this.m_sURI).toString();
187: }
188:
189: }
|