<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to ReflectionExample</title><link>https://sourceforge.net/p/jtype/wiki/ReflectionExample/</link><description>Recent changes to ReflectionExample</description><atom:link href="https://sourceforge.net/p/jtype/wiki/ReflectionExample/feed" rel="self"/><language>en</language><lastBuildDate>Wed, 21 Sep 2011 14:03:46 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/jtype/wiki/ReflectionExample/feed" rel="self" type="application/rss+xml"/><item><title>WikiPage ReflectionExample modified by Benjamin Hoskins</title><link>https://sourceforge.net/p/jtype/wiki/ReflectionExample/</link><description>&lt;pre&gt;--- v4 
+++ v5 
@@ -1,11 +1,18 @@
 ### Simple Built-In Example ###
 
     :::java
-        @Test public void serializeObject() throws Exception {
-    	Person person = new Person(1001,"Mr","Forrest", Arrays.asList("Winston","Groom","Gump"), true);
-    	String output = Convert(person).to(String.class);
-    	assertThat(output, is("id=1001&amp;title=Mr&amp;firstName=Forrest&amp;lastNames=Winston%2CGroom%2CGump&amp;male=true"));
-    }
+    @Test public void autoConvertToAppropriateTypes() throws Exception {
+		Person person = Convert("id=1001&amp;title=Mr&amp;firstName=Forrest&amp;lastNames=Winston%2CGroom%2CGump&amp;male=true").to(Person.class);
+		assertThat(person.getTitle(), is("Mr"));
+		assertThat(person.getFirstName(), is("Forrest"));
+		List&lt;String&gt; lastNames = person.getLastNames();
+		assertThat(lastNames.get(0), is("Winston"));
+		assertThat(lastNames.get(1), is("Groom"));
+		assertThat(lastNames.get(2), is("Gump"));
+		assertThat(person.getId(), is(1001));
+		assertThat(person.isMale(), is(true));
+	}
+	
 
 
 
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Benjamin Hoskins</dc:creator><pubDate>Wed, 21 Sep 2011 14:03:46 -0000</pubDate><guid>https://sourceforge.net9b786883bba1cf83b19003c1acea9bd27da9bdc1</guid></item><item><title>WikiPage ReflectionExample modified by Benjamin Hoskins</title><link>https://sourceforge.net/p/jtype/wiki/ReflectionExample/</link><description>&lt;pre&gt;--- v3 
+++ v4 
@@ -1,33 +1,57 @@
-    :::java
+### Simple Built-In Example ###
+
+    :::java
+        @Test public void serializeObject() throws Exception {
+    	Person person = new Person(1001,"Mr","Forrest", Arrays.asList("Winston","Groom","Gump"), true);
+    	String output = Convert(person).to(String.class);
+    	assertThat(output, is("id=1001&amp;title=Mr&amp;firstName=Forrest&amp;lastNames=Winston%2CGroom%2CGump&amp;male=true"));
+    }
+
+
+
+### Hand-Rolled Example ###
+
+
+    :::java
     @Test public void autoConvertToAppropriateTypes() throws Exception {
 		Map&lt;String, String&gt; map = Convert("id=1001&amp;title=Mr&amp;firstName=Forrest&amp;lastNames=Winston,Groom,Gump&amp;male=true").to(Map.class);
 		Person person = Person.class.newInstance();
 		Field[] personFields = person.getClass().getDeclaredFields();
 		for (Field personField : personFields) {
 			personField.setAccessible(true);
 	        personField.set(person, Convert(map.get(personField.getName())).to(personField.getType()));
         }
 		assertThat(person.getTitle(), is("Mr"));
 		assertThat(person.getFirstName(), is("Forrest"));
 		List&lt;String&gt; lastNames = person.getLastNames();
 		assertThat(lastNames.get(0), is("Winston"));
 		assertThat(lastNames.get(1), is("Groom"));
 		assertThat(lastNames.get(2), is("Gump"));
 		assertThat(person.getId(), is(1001));
 		assertThat(person.isMale(), is(true));
 	}
 	
 	
-	static class Person {
-		private Integer id;
-		private String title;
-		private String firstName;
-		private List&lt;String&gt; lastNames;
-		private Boolean male;
-		
-		public String getTitle() { return title; }
-		public Boolean isMale() { return male; }
-		public String getFirstName() { return firstName; }
-		public List&lt;String&gt; getLastNames() { return lastNames; }
-		public Integer getId() { return id; }
-	}
+    public class Person {
+	private Integer id;
+	private String title;
+	private String firstName;
+	private List&lt;String&gt; lastNames;
+	private Boolean male;
+	
+	public Person() {}
+
+	public Person(int id, String title, String firstName, List&lt;String&gt; lastNames, boolean male) {
+		this.id = id;
+		this.title = title;
+		this.firstName = firstName;
+		this.lastNames = lastNames;
+		this.male = male;
+    }
+	
+	public String getTitle() { return title; }
+	public Boolean isMale() { return male; }
+	public String getFirstName() { return firstName; }
+	public List&lt;String&gt; getLastNames() { return lastNames; }
+	public Integer getId() { return id; }
+    }
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Benjamin Hoskins</dc:creator><pubDate>Wed, 21 Sep 2011 13:59:46 -0000</pubDate><guid>https://sourceforge.netcaee86665dfb93e200a3be597b7249e183f9fdec</guid></item><item><title>WikiPage ReflectionExample modified by Benjamin Hoskins</title><link>https://sourceforge.net/p/jtype/wiki/ReflectionExample/</link><description>&lt;pre&gt;--- v2 
+++ v3 
@@ -1,6 +1,6 @@
     :::java
     @Test public void autoConvertToAppropriateTypes() throws Exception {
-		Map&lt;String, String&gt; map = Convert("id=1001&amp;title=Mr&amp;firstName=Forrest&amp;lastNames=Winston,Groom,Gump&amp;male=1").to(Map.class);
+		Map&lt;String, String&gt; map = Convert("id=1001&amp;title=Mr&amp;firstName=Forrest&amp;lastNames=Winston,Groom,Gump&amp;male=true").to(Map.class);
 		Person person = Person.class.newInstance();
 		Field[] personFields = person.getClass().getDeclaredFields();
 		for (Field personField : personFields) {
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Benjamin Hoskins</dc:creator><pubDate>Wed, 21 Sep 2011 12:32:13 -0000</pubDate><guid>https://sourceforge.net1dcbcef32cb64266ba7772ac77495bcce7bd1e5f</guid></item><item><title>WikiPage ReflectionExample modified by Benjamin Hoskins</title><link>https://sourceforge.net/p/jtype/wiki/ReflectionExample/</link><description>&lt;pre&gt;--- v1 
+++ v2 
@@ -1,32 +1,33 @@
-
     :::java
     @Test public void autoConvertToAppropriateTypes() throws Exception {
-		Map&lt;String, String&gt; map = Convert("id=1001&amp;title=Mr&amp;firstName=Forrest&amp;lastName=Gump&amp;male=1").to(Map.class);
+		Map&lt;String, String&gt; map = Convert("id=1001&amp;title=Mr&amp;firstName=Forrest&amp;lastNames=Winston,Groom,Gump&amp;male=1").to(Map.class);
 		Person person = Person.class.newInstance();
 		Field[] personFields = person.getClass().getDeclaredFields();
 		for (Field personField : personFields) {
 			personField.setAccessible(true);
 	        personField.set(person, Convert(map.get(personField.getName())).to(personField.getType()));
         }
 		assertThat(person.getTitle(), is("Mr"));
 		assertThat(person.getFirstName(), is("Forrest"));
-		assertThat(person.getLastName(), is("Gump"));
+		List&lt;String&gt; lastNames = person.getLastNames();
+		assertThat(lastNames.get(0), is("Winston"));
+		assertThat(lastNames.get(1), is("Groom"));
+		assertThat(lastNames.get(2), is("Gump"));
 		assertThat(person.getId(), is(1001));
 		assertThat(person.isMale(), is(true));
 	}
 	
 	
 	static class Person {
 		private Integer id;
 		private String title;
 		private String firstName;
-		private String lastName;
+		private List&lt;String&gt; lastNames;
 		private Boolean male;
 		
 		public String getTitle() { return title; }
 		public Boolean isMale() { return male; }
 		public String getFirstName() { return firstName; }
-		public String getLastName() { return lastName; }
+		public List&lt;String&gt; getLastNames() { return lastNames; }
 		public Integer getId() { return id; }
 	}
- 
&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Benjamin Hoskins</dc:creator><pubDate>Wed, 21 Sep 2011 12:20:10 -0000</pubDate><guid>https://sourceforge.netae102bb1344621da8284e7ce58a627991840cdb2</guid></item><item><title>WikiPage ReflectionExample modified by Benjamin Hoskins</title><link>https://sourceforge.net/p/jtype/wiki/ReflectionExample/</link><description>
    :::java
    @Test public void autoConvertToAppropriateTypes() throws Exception {
		Map&lt;String, String&gt; map = Convert("id=1001&amp;title=Mr&amp;firstName=Forrest&amp;lastName=Gump&amp;male=1").to(Map.class);
		Person person = Person.class.newInstance();
		Field[] personFields = person.getClass().getDeclaredFields();
		for (Field personField : personFields) {
			personField.setAccessible(true);
	        personField.set(person, Convert(map.get(personField.getName())).to(personField.getType()));
        }
		assertThat(person.getTitle(), is("Mr"));
		assertThat(person.getFirstName(), is("Forrest"));
		assertThat(person.getLastName(), is("Gump"));
		assertThat(person.getId(), is(1001));
		assertThat(person.isMale(), is(true));
	}
	
	
	static class Person {
		private Integer id;
		private String title;
		private String firstName;
		private String lastName;
		private Boolean male;
		
		public String getTitle() { return title; }
		public Boolean isMale() { return male; }
		public String getFirstName() { return firstName; }
		public String getLastName() { return lastName; }
		public Integer getId() { return id; }
	}
 </description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Benjamin Hoskins</dc:creator><pubDate>Wed, 21 Sep 2011 12:15:14 -0000</pubDate><guid>https://sourceforge.netaebafd8d08451512ebe1757814b83aa1262b5d91</guid></item></channel></rss>