r7504 - dumbhippo/trunk/server/src/com/dumbhippo/server/views



Author: marinaz
Date: 2008-09-02 17:13:09 -0500 (Tue, 02 Sep 2008)
New Revision: 7504

Added:
   dumbhippo/trunk/server/src/com/dumbhippo/server/views/OnlineAccountTypeView.java
Log:
Add OnlineAccountTypeView which implements writeToXmlBuilder() for an online account type.


Added: dumbhippo/trunk/server/src/com/dumbhippo/server/views/OnlineAccountTypeView.java
===================================================================
--- dumbhippo/trunk/server/src/com/dumbhippo/server/views/OnlineAccountTypeView.java	2008-09-02 22:11:40 UTC (rev 7503)
+++ dumbhippo/trunk/server/src/com/dumbhippo/server/views/OnlineAccountTypeView.java	2008-09-02 22:13:09 UTC (rev 7504)
@@ -0,0 +1,26 @@
+package com.dumbhippo.server.views;
+
+import com.dumbhippo.XmlBuilder;
+import com.dumbhippo.persistence.OnlineAccountType;
+
+public class OnlineAccountTypeView {
+	private OnlineAccountType onlineAccountType;
+	
+    public OnlineAccountTypeView(OnlineAccountType onlineAccountType) {
+    	this.onlineAccountType = onlineAccountType;
+    }
+    
+	/**
+	 *  we are not using lang at the moment
+	 */
+	public void writeToXmlBuilder(XmlBuilder builder, String lang) {
+		builder.openElement("onlineAccountType",
+				            "name", onlineAccountType.getName(),
+				            "fullName", onlineAccountType.getFullName(),				                
+				            "siteName", onlineAccountType.getSiteName(),
+				            "site", onlineAccountType.getSite(),
+				            "userInfoType", onlineAccountType.getUserInfoType(),
+				            "supported", Boolean.toString(onlineAccountType.isSupported()));
+		builder.closeElement();
+	}
+}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]