- From: Thomas Gambet via cvs-syncmail <cvsmail@w3.org>
- Date: Fri, 23 Oct 2009 13:40:11 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/2006/unicorn/src/org/w3c/unicorn/response/impl In directory hutz:/tmp/cvs-serv25643/src/org/w3c/unicorn/response/impl Modified Files: OldMessageXBeans.java OldResponseXBeans.java Log Message: implemented lang attribute for old schema too Index: OldMessageXBeans.java =================================================================== RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/response/impl/OldMessageXBeans.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- OldMessageXBeans.java 23 Oct 2009 12:36:12 -0000 1.7 +++ OldMessageXBeans.java 23 Oct 2009 13:40:08 -0000 1.8 @@ -19,6 +19,7 @@ private String title; private String description; private List<Context> contexts = new ArrayList<Context>(); + private String lang; public OldMessageXBeans(Error error) { type = ERROR; @@ -157,7 +158,11 @@ } public String getLang() { - return null; + return lang; + } + + public void setLang(String lang) { + this.lang = lang; } } Index: OldResponseXBeans.java =================================================================== RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/response/impl/OldResponseXBeans.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- OldResponseXBeans.java 23 Oct 2009 13:24:41 -0000 1.9 +++ OldResponseXBeans.java 23 Oct 2009 13:40:08 -0000 1.10 @@ -24,6 +24,7 @@ import org.w3c.unicorn.response.Group; import org.w3c.unicorn.response.Message; import org.w3c.unicorn.response.Response; +import org.w3c.unicorn.util.Property; public class OldResponseXBeans implements Response { @@ -63,6 +64,12 @@ } if (or.getResult().getErrors() != null) { + String lang; + if (or.getResult().getErrors().getLang() != null) { + lang = or.getResult().getErrors().getLang(); + } else { + lang = Property.get("DEFAULT_LANGUAGE"); + } for (Errorlist errorList : or.getResult().getErrors().getErrorlistList()) { for (Error error : errorList.getErrorList()) { OldMessageXBeans mess = new OldMessageXBeans(error); @@ -70,12 +77,19 @@ mess.setURI(errorList.getUri()); else mess.setURI(or.getUri()); + mess.setLang(lang); messages.add(mess); errorCount++; } } } if (or.getResult().getInformations() != null) { + String lang; + if (or.getResult().getInformations().getLang() != null) { + lang = or.getResult().getInformations().getLang(); + } else { + lang = Property.get("DEFAULT_LANGUAGE"); + } for (Infolist infoList : or.getResult().getInformations().getInfolistList()) { for (Info info : infoList.getInfoList()) { OldMessageXBeans mess = new OldMessageXBeans(info); @@ -83,12 +97,19 @@ mess.setURI(infoList.getUri()); else mess.setURI(or.getUri()); + mess.setLang(lang); messages.add(mess); infoCount++; } } } if (or.getResult().getWarnings() != null) { + String lang; + if (or.getResult().getWarnings().getLang() != null) { + lang = or.getResult().getWarnings().getLang(); + } else { + lang = Property.get("DEFAULT_LANGUAGE"); + } for (Warninglist warningList : or.getResult().getWarnings().getWarninglistList()) { for (Warning warning : warningList.getWarningList()) { OldMessageXBeans mess = new OldMessageXBeans(warning); @@ -96,6 +117,7 @@ mess.setURI(warningList.getUri()); else mess.setURI(or.getUri()); + mess.setLang(lang); messages.add(mess); warningCount++; } @@ -304,7 +326,7 @@ } public String getLang() { - return null; + return Property.get("DEFAULT_LANGUAGE"); } }
Received on Friday, 23 October 2009 13:40:14 UTC