- From: Thomas Gambet via cvs-syncmail <cvsmail@w3.org>
- Date: Mon, 17 Aug 2009 14:11:36 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/2006/unicorn/src/org/w3c/unicorn/contract In directory hutz:/tmp/cvs-serv8922/src/org/w3c/unicorn/contract Modified Files: Tag: dev2 Observer.java Log Message: throws an UnknownParserException in case a contract specify an unknown parser Index: Observer.java =================================================================== RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/contract/Attic/Observer.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -d -r1.1.2.1 -r1.1.2.2 --- Observer.java 11 Aug 2009 16:05:32 -0000 1.1.2.1 +++ Observer.java 17 Aug 2009 14:11:33 -0000 1.1.2.2 @@ -11,7 +11,9 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.w3c.unicorn.exceptions.UnknownParserException; import org.w3c.unicorn.util.LocalizedString; +import org.w3c.unicorn.util.Property; /** * Observer<br /> @@ -261,7 +263,10 @@ return responseType; } - public void setResponseType(String responseType) { + public void setResponseType(String responseType) throws UnknownParserException { + if (!Property.getProps("responseParsers.properties").containsKey(responseType)) + throw new UnknownParserException("Unknown parser: " + responseType + ". Check observer contract or responseParsers.properties."); + this.responseType = responseType; }
Received on Monday, 17 August 2009 14:11:46 UTC