dol: initial dol commit
[jump.git] / dol / src / dol / util / SchemaLocation.java
1 /* $Id: SchemaLocation.java 1 2010-02-24 13:03:05Z haidw $ */
2 package dol.util;
3
4 /**
5  * Class to get the location of schemas.
6  */
7 public class SchemaLocation {
8
9     protected static final String PN_NAMESPACE =
10             "http://www.tik.ee.ethz.ch/~shapes/schema/PROCESSNETWORK";
11     protected static final String PN_LOCATION =
12             "http://www.tik.ee.ethz.ch/~shapes/schema/processnetwork.xsd";
13     protected static final String ARCH_NAMESPACE =
14             "http://www.tik.ee.ethz.ch/~shapes/schema/ARCHITECTURE";
15     protected static final String ARCH_LOCATION =
16             "http://www.tik.ee.ethz.ch/~shapes/schema/architecture.xsd";
17     protected static final String ARCH_NAMESPACE_OLD =
18             "http://www.tik.ee.ethz.ch/~shapes/schema/ARCHITECTURE_OLD";
19     protected static final String MAP_NAMESPACE =
20             "http://www.tik.ee.ethz.ch/~shapes/schema/MAPPING";
21     protected static final String MAP_LOCATION =
22             "http://www.tik.ee.ethz.ch/~shapes/schema/mapping.xsd";
23     protected static final String MAP_NAMESPACE_OLD =
24             "http://www.tik.ee.ethz.ch/~shapes/schema/MAPPING_OLD";
25
26     /** singleton instance */
27     protected final static SchemaLocation _schemaLocation =
28         new SchemaLocation();
29
30     /**
31      * Default constructor.
32      */
33     public SchemaLocation() {
34     }
35
36     /**
37      * Return the process network namespace.
38      *
39      * @return process network namespace
40      */
41     public static String getProcessNetworkNamespace() {
42         return PN_NAMESPACE;
43     }
44
45     /**
46      * Return the process network schema location.
47      *
48      * @return process network schema location
49      */
50     public static String getProcessNetworkSchemaLocation() {
51         return PN_LOCATION;
52     }
53
54     /**
55      * Return the architecture namespace.
56      *
57      * @return architecture namespace
58      */
59     public static String getArchitectureNamespace() {
60         return ARCH_NAMESPACE;
61     }
62
63     /**
64      * Return the architecture schema location.
65      *
66      * @return architecture schema location
67      */
68     public static String getArchitectureSchemaLocation() {
69         return ARCH_LOCATION;
70     }
71
72     /**
73      * Return the mapping namespace.
74      *
75      * @return mapping namespace
76      */
77     public static String getMappingNamespace() {
78         return MAP_NAMESPACE;
79     }
80
81     /**
82      * Return the mapping schema location.
83      *
84      * @return mapping schema location
85      */
86     public static String getMappingSchemaLocation() {
87         return MAP_LOCATION;
88     }
89
90     /**
91      * Return a string with the references to the external schema files.
92      *
93      * @return references to external schemas
94      */
95     public static String getExternalSchemaLocation() {
96         String loc = PN_NAMESPACE + " ";
97         loc += _schemaLocation.getClass().getResource(
98                 "/schema/processnetwork.xsd");
99         loc += " " + ARCH_NAMESPACE + " ";
100         loc += _schemaLocation.getClass().getResource(
101                 "/schema/architecture.xsd");
102         loc += " " + ARCH_NAMESPACE_OLD + " ";
103         loc += _schemaLocation.getClass().getResource(
104                 "/schema/architecture_old.xsd");
105         loc += " " + MAP_NAMESPACE + " ";
106         loc += _schemaLocation.getClass().getResource(
107                 "/schema/mapping.xsd");
108         return loc;
109     }
110
111     /**
112      * Return a string with the references to the internal schema files.
113      *
114      * @return references to internal schemas
115      */
116     public static String getInternalSchemaLocation() {
117         String loc = PN_NAMESPACE + " ";
118         loc += _schemaLocation.getClass().getResource(
119                 "/schema/internal/processnetwork_internal.xsd");
120         loc += " " + ARCH_NAMESPACE + " ";
121         loc += _schemaLocation.getClass().getResource(
122                 "/schema/internal/architecture_internal.xsd");
123         loc += " " + ARCH_NAMESPACE_OLD + " ";
124         loc += _schemaLocation.getClass().getResource(
125                 "/schema/internal/architecture_old_internal.xsd");
126         loc += " " + MAP_NAMESPACE + " ";
127         loc += _schemaLocation.getClass().getResource(
128                 "/schema/internal/mapping_internal.xsd");
129         loc += " " + MAP_NAMESPACE_OLD + " ";
130         loc += _schemaLocation.getClass().getResource(
131                "/schema/internal/mapping_old_internal.xsd");
132         return loc;
133     }
134 }
135
136
137