X-Git-Url: http://sraa.de/git/?a=blobdiff_plain;f=dol%2Fsrc%2Fdol%2Futil%2FSchemaLocation.java;fp=dol%2Fsrc%2Fdol%2Futil%2FSchemaLocation.java;h=de46cef44a475c326162800602590c513c4c468a;hb=8c411cf24ed0eb889191aaeafd8fa1e69081df42;hp=0000000000000000000000000000000000000000;hpb=dea7a4fb1ed110d3ce6e6d9255103d724bd66c0e;p=jump.git diff --git a/dol/src/dol/util/SchemaLocation.java b/dol/src/dol/util/SchemaLocation.java new file mode 100644 index 0000000..de46cef --- /dev/null +++ b/dol/src/dol/util/SchemaLocation.java @@ -0,0 +1,137 @@ +/* $Id: SchemaLocation.java 1 2010-02-24 13:03:05Z haidw $ */ +package dol.util; + +/** + * Class to get the location of schemas. + */ +public class SchemaLocation { + + protected static final String PN_NAMESPACE = + "http://www.tik.ee.ethz.ch/~shapes/schema/PROCESSNETWORK"; + protected static final String PN_LOCATION = + "http://www.tik.ee.ethz.ch/~shapes/schema/processnetwork.xsd"; + protected static final String ARCH_NAMESPACE = + "http://www.tik.ee.ethz.ch/~shapes/schema/ARCHITECTURE"; + protected static final String ARCH_LOCATION = + "http://www.tik.ee.ethz.ch/~shapes/schema/architecture.xsd"; + protected static final String ARCH_NAMESPACE_OLD = + "http://www.tik.ee.ethz.ch/~shapes/schema/ARCHITECTURE_OLD"; + protected static final String MAP_NAMESPACE = + "http://www.tik.ee.ethz.ch/~shapes/schema/MAPPING"; + protected static final String MAP_LOCATION = + "http://www.tik.ee.ethz.ch/~shapes/schema/mapping.xsd"; + protected static final String MAP_NAMESPACE_OLD = + "http://www.tik.ee.ethz.ch/~shapes/schema/MAPPING_OLD"; + + /** singleton instance */ + protected final static SchemaLocation _schemaLocation = + new SchemaLocation(); + + /** + * Default constructor. + */ + public SchemaLocation() { + } + + /** + * Return the process network namespace. + * + * @return process network namespace + */ + public static String getProcessNetworkNamespace() { + return PN_NAMESPACE; + } + + /** + * Return the process network schema location. + * + * @return process network schema location + */ + public static String getProcessNetworkSchemaLocation() { + return PN_LOCATION; + } + + /** + * Return the architecture namespace. + * + * @return architecture namespace + */ + public static String getArchitectureNamespace() { + return ARCH_NAMESPACE; + } + + /** + * Return the architecture schema location. + * + * @return architecture schema location + */ + public static String getArchitectureSchemaLocation() { + return ARCH_LOCATION; + } + + /** + * Return the mapping namespace. + * + * @return mapping namespace + */ + public static String getMappingNamespace() { + return MAP_NAMESPACE; + } + + /** + * Return the mapping schema location. + * + * @return mapping schema location + */ + public static String getMappingSchemaLocation() { + return MAP_LOCATION; + } + + /** + * Return a string with the references to the external schema files. + * + * @return references to external schemas + */ + public static String getExternalSchemaLocation() { + String loc = PN_NAMESPACE + " "; + loc += _schemaLocation.getClass().getResource( + "/schema/processnetwork.xsd"); + loc += " " + ARCH_NAMESPACE + " "; + loc += _schemaLocation.getClass().getResource( + "/schema/architecture.xsd"); + loc += " " + ARCH_NAMESPACE_OLD + " "; + loc += _schemaLocation.getClass().getResource( + "/schema/architecture_old.xsd"); + loc += " " + MAP_NAMESPACE + " "; + loc += _schemaLocation.getClass().getResource( + "/schema/mapping.xsd"); + return loc; + } + + /** + * Return a string with the references to the internal schema files. + * + * @return references to internal schemas + */ + public static String getInternalSchemaLocation() { + String loc = PN_NAMESPACE + " "; + loc += _schemaLocation.getClass().getResource( + "/schema/internal/processnetwork_internal.xsd"); + loc += " " + ARCH_NAMESPACE + " "; + loc += _schemaLocation.getClass().getResource( + "/schema/internal/architecture_internal.xsd"); + loc += " " + ARCH_NAMESPACE_OLD + " "; + loc += _schemaLocation.getClass().getResource( + "/schema/internal/architecture_old_internal.xsd"); + loc += " " + MAP_NAMESPACE + " "; + loc += _schemaLocation.getClass().getResource( + "/schema/internal/mapping_internal.xsd"); + loc += " " + MAP_NAMESPACE_OLD + " "; + loc += _schemaLocation.getClass().getResource( + "/schema/internal/mapping_old_internal.xsd"); + return loc; + } +} + + +