W3C home > Mailing lists > Public > www-validator-cvs@w3.org > June 2010

commit: removed initUnmarshaller from initialization tasks

From: Mercurial notifier <nobody@w3.org>
Date: Mon, 14 Jun 2010 09:22:35 -0400
To: Unicorn Updates <www-validator-cvs@w3.org>
Message-Id: <E1OO9cZ-00068S-0q@blinky.w3.org>
changeset:   1221:7ddad082142b
user:        Thomas Gambet <tgambet@w3.org>
date:        Sun Jun 13 16:07:38 2010 -0400
files:       src/org/w3c/unicorn/Framework.java src/org/w3c/unicorn/contract/WADLUnmarshallerXPath.java
description:
removed initUnmarshaller from initialization tasks


diff -r c010b0ff74ac -r 7ddad082142b src/org/w3c/unicorn/Framework.java
--- a/src/org/w3c/unicorn/Framework.java	Sun Jun 13 00:50:01 2010 -0400
+++ b/src/org/w3c/unicorn/Framework.java	Sun Jun 13 16:07:38 2010 -0400
@@ -12,12 +12,10 @@
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.Hashtable;
-import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.Map;
 import java.util.Properties;
 
-import javax.xml.namespace.NamespaceContext;
 import javax.xml.parsers.ParserConfigurationException;
 
 import org.apache.commons.lang.StringUtils;
@@ -113,7 +111,6 @@
 		try {
 			initCore();
 			initConfig();
-			initUnmarshallers();
 			initResponseImplementations();
 			initObservers();
 			initLanguages();
@@ -176,34 +173,6 @@
 				throw new InitializationFailedException("Error reading \"" + fileName + "\": " + e.getMessage());
 			}
 		}
-	}
-	
-	public static void initUnmarshallers() {
-		// Initialize WADLUnmarshallerXPath (Gets the Namespace URI and the prefix)
-		WADLUnmarshallerXPath.setNamespaceContext(new NamespaceContext() {
-			public String getNamespaceURI(final String sPrefix) {
-				if ("xs".equals(sPrefix)) {
-					return "http://www.w3.org/2001/XMLSchema";
-				} else if ("uco".equals(sPrefix)) {
-					return "http://www.w3.org/unicorn/observationresponse";
-				} else {
-					return null;
-				}
-			}
-			public String getPrefix(final String sNamespaceURI) {
-				if ("http://www.w3.org/2001/XMLSchema".equals(sNamespaceURI)) {
-					return "xs";
-				} else if ("http://www.w3.org/unicorn/observationresponse"
-						.equals(sNamespaceURI)) {
-					return "uco";
-				} else {
-					return null;
-				}
-			}
-			public Iterator<String> getPrefixes(final String sNamespaceURI) {
-				return null;
-			}
-		});
 	}
 	
 	@SuppressWarnings("unchecked")
diff -r c010b0ff74ac -r 7ddad082142b src/org/w3c/unicorn/contract/WADLUnmarshallerXPath.java
--- a/src/org/w3c/unicorn/contract/WADLUnmarshallerXPath.java	Sun Jun 13 00:50:01 2010 -0400
+++ b/src/org/w3c/unicorn/contract/WADLUnmarshallerXPath.java	Sun Jun 13 16:07:38 2010 -0400
@@ -6,6 +6,7 @@
 import java.io.IOException;
 import java.net.URL;
 import java.util.ArrayList;
+import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
@@ -48,7 +49,30 @@
 	/**
 	 * Namespace for the context
 	 */
-	private static NamespaceContext aNamespaceContext;
+	private static NamespaceContext aNamespaceContext = new NamespaceContext() {
+		public String getNamespaceURI(final String sPrefix) {
+			if ("xs".equals(sPrefix)) {
+				return "http://www.w3.org/2001/XMLSchema";
+			} else if ("uco".equals(sPrefix)) {
+				return "http://www.w3.org/unicorn/observationresponse";
+			} else {
+				return null;
+			}
+		}
+		public String getPrefix(final String sNamespaceURI) {
+			if ("http://www.w3.org/2001/XMLSchema".equals(sNamespaceURI)) {
+				return "xs";
+			} else if ("http://www.w3.org/unicorn/observationresponse"
+					.equals(sNamespaceURI)) {
+				return "uco";
+			} else {
+				return null;
+			}
+		}
+		public Iterator<String> getPrefixes(final String sNamespaceURI) {
+			return null;
+		}
+	};
 
 	/**
 	 * List of the different call method
Received on Monday, 14 June 2010 13:25:09 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 26 April 2012 12:55:20 GMT