W3C home > Mailing lists > Public > www-validator-cvs@w3.org > October 2009

2006/unicorn/src/org/w3c/unicorn/response/impl DefaultGroupXBeans.java,1.3,1.4 OldMessageXBeans.java,1.6,1.7 DefaultResponseXBeans.java,1.10,1.11 DefaultMessageXBeans.java,1.3,1.4 OldResponseXBeans.java,1.7,1.8

From: Thomas Gambet via cvs-syncmail <cvsmail@w3.org>
Date: Fri, 23 Oct 2009 12:36:15 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1N1JNP-0003xw-7k@lionel-hutz.w3.org>
Update of /sources/public/2006/unicorn/src/org/w3c/unicorn/response/impl
In directory hutz:/tmp/cvs-serv15204/src/org/w3c/unicorn/response/impl

Modified Files:
	DefaultGroupXBeans.java OldMessageXBeans.java 
	DefaultResponseXBeans.java DefaultMessageXBeans.java 
	OldResponseXBeans.java 
Log Message:
added getLang() on Response, Message, and Group interfaces
+ implementations

Index: DefaultMessageXBeans.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/response/impl/DefaultMessageXBeans.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- DefaultMessageXBeans.java	20 Oct 2009 12:41:46 -0000	1.3
+++ DefaultMessageXBeans.java	23 Oct 2009 12:36:13 -0000	1.4
@@ -30,10 +30,14 @@
 	
 	private String group;
 	
+	private String lang;
+	
 	public DefaultMessageXBeans(MessageType message) {
 		
 		title = message.getTitle();
 		
+		lang = message.getLang();
+		
 		if (message.isSetRef())
 			uri = message.getRef();
 		
@@ -93,4 +97,8 @@
 	public void setGroupName(String group) {
 		this.group = group;
 	}
+
+	public String getLang() {
+		return lang;
+	}
 }

Index: DefaultResponseXBeans.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/response/impl/DefaultResponseXBeans.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- DefaultResponseXBeans.java	22 Oct 2009 17:11:58 -0000	1.10
+++ DefaultResponseXBeans.java	23 Oct 2009 12:36:12 -0000	1.11
@@ -44,8 +44,6 @@
 	
 	private String observerID;
 	
-	//TODO lang information is missing here, something must be added to the schema
-	
 	public DefaultResponseXBeans(InputStream is, String charset) throws UnicornException {
 		
 		if (charset == null)
@@ -65,11 +63,16 @@
 			throw new UnicornException(new org.w3c.unicorn.util.Message(e));
 		}
 		
-		for (GroupType group : or.getGroupList())
+		for (GroupType group : or.getGroupList()) {
+			if (group.getLang() == null)
+				group.setLang(getLang());
 			groups.add(new DefaultGroupXBeans(group));
+		}
 		
 		for (ListType list : or.getListList()) {
 			for (MessageType message : list.getMessageList()) {
+				if (message.getLang() == null)
+					message.setLang(getLang());
 				DefaultMessageXBeans m = new DefaultMessageXBeans(message);
 				if (m.getURI() == null) {
 					if (list.isSetRef())
@@ -95,6 +98,8 @@
 		}
 		
 		for (MessageType message : or.getMessageList()) {
+			if (message.getLang() == null)
+				message.setLang(getLang());
 			DefaultMessageXBeans m = new DefaultMessageXBeans(message);
 			
 			if (m.getURI() == null)
@@ -384,4 +389,8 @@
 		return false;
 	}
 
+	public String getLang() {
+		return or.isSetLang() ? or.getLang() : Property.get("DEFAULT_LANGUAGE");
+	}
+
 }

Index: OldMessageXBeans.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/response/impl/OldMessageXBeans.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- OldMessageXBeans.java	22 Oct 2009 09:49:57 -0000	1.6
+++ OldMessageXBeans.java	23 Oct 2009 12:36:12 -0000	1.7
@@ -156,4 +156,8 @@
 		this.uri = uri;
 	}
 
+	public String getLang() {
+		return null;
+	}
+
 }

Index: OldResponseXBeans.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/response/impl/OldResponseXBeans.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- OldResponseXBeans.java	21 Oct 2009 16:22:28 -0000	1.7
+++ OldResponseXBeans.java	23 Oct 2009 12:36:13 -0000	1.8
@@ -300,5 +300,9 @@
 			return true;
 		return false;
 	}
+
+	public String getLang() {
+		return null;
+	}
 	
 }

Index: DefaultGroupXBeans.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/response/impl/DefaultGroupXBeans.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- DefaultGroupXBeans.java	20 Oct 2009 12:41:46 -0000	1.3
+++ DefaultGroupXBeans.java	23 Oct 2009 12:36:12 -0000	1.4
@@ -18,6 +18,8 @@
 	
 	private String parent;
 	
+	private String lang;
+	
 	public DefaultGroupXBeans(GroupType group) {
 		if (group.isSetDescription() && group.getDescription().validate())
 			description = group.getDescription().xmlText(new XmlOptions().setUseDefaultNamespace()
@@ -26,6 +28,7 @@
 		name = group.getName();
 		if (group.isSetParent())
 			parent = group.getParent();
+		lang = group.getLang();
 	}
 
 	public String getDescription() {
@@ -50,4 +53,8 @@
 		return false;
 	}
 
+	public String getLang() {
+		return lang;
+	}
+
 }
Received on Friday, 23 October 2009 12:36:19 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:17:39 UTC