<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Bhavesh Shah&#039;s Blog</title>
	<atom:link href="http://dakbhavesh.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://dakbhavesh.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Sun, 28 Mar 2010 17:27:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='dakbhavesh.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Bhavesh Shah&#039;s Blog</title>
		<link>http://dakbhavesh.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://dakbhavesh.wordpress.com/osd.xml" title="Bhavesh Shah&#039;s Blog" />
	<atom:link rel='hub' href='http://dakbhavesh.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Hibernate3DtoCopier example</title>
		<link>http://dakbhavesh.wordpress.com/2010/03/28/hibernate3dtocopier-example/</link>
		<comments>http://dakbhavesh.wordpress.com/2010/03/28/hibernate3dtocopier-example/#comments</comments>
		<pubDate>Sun, 28 Mar 2010 17:27:58 +0000</pubDate>
		<dc:creator>dakbhavesh</dc:creator>
				<category><![CDATA[Core Java concepts]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://dakbhavesh.wordpress.com/?p=28</guid>
		<description><![CDATA[try { BeanOne one = new BeanOne(); one.setProp1(&#8220;Bhavesh&#8221;); one.setProp2(&#8220;Hayden&#8221;); one.setBeanOne(one); Class[] interestedEntityTypes = {BeanOne.class}; Class oneClass = one.getClass(); Hibernate3DtoCopier dto = new Hibernate3DtoCopier(); Object test = dto.hibernate2dto(com.nextenders.server.transformers.beanpack2.BeanOne.class, one); com.nextenders.server.transformers.beanpack2.BeanOne test1 = dto.hibernate2dto(com.nextenders.server.transformers.beanpack2.BeanOne.class, one, interestedEntityTypes, null); com.nextenders.server.transformers.beanpack2.BeanOne one2 = (com.nextenders.server.transformers.beanpack2.BeanOne) test; Transformer txmer = new Transformer(); txmer.replicate(one, com.nextenders.server.transformers.beanpack2.BeanOne.class); } catch (Exception e) { e.printStackTrace(); }<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dakbhavesh.wordpress.com&amp;blog=9124675&amp;post=28&amp;subd=dakbhavesh&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>try {<br />
		BeanOne one = new BeanOne();<br />
		one.setProp1(&#8220;Bhavesh&#8221;);<br />
		one.setProp2(&#8220;Hayden&#8221;);</p>
<p>		one.setBeanOne(one);</p>
<p>		Class[] interestedEntityTypes = {BeanOne.class};</p>
<p>		Class oneClass = one.getClass();</p>
<p>		Hibernate3DtoCopier dto = new Hibernate3DtoCopier();<br />
		Object test = dto.hibernate2dto(com.nextenders.server.transformers.beanpack2.BeanOne.class, one);<br />
		com.nextenders.server.transformers.beanpack2.BeanOne test1 = dto.hibernate2dto(com.nextenders.server.transformers.beanpack2.BeanOne.class,<br />
				one, interestedEntityTypes, null);<br />
		com.nextenders.server.transformers.beanpack2.BeanOne one2 = (com.nextenders.server.transformers.beanpack2.BeanOne) test;</p>
<p>		Transformer txmer = new Transformer();</p>
<p>			txmer.replicate(one, com.nextenders.server.transformers.beanpack2.BeanOne.class);<br />
		} catch (Exception e) {<br />
			e.printStackTrace();<br />
		}</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dakbhavesh.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dakbhavesh.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dakbhavesh.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dakbhavesh.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dakbhavesh.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dakbhavesh.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dakbhavesh.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dakbhavesh.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dakbhavesh.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dakbhavesh.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dakbhavesh.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dakbhavesh.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dakbhavesh.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dakbhavesh.wordpress.com/28/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dakbhavesh.wordpress.com&amp;blog=9124675&amp;post=28&amp;subd=dakbhavesh&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dakbhavesh.wordpress.com/2010/03/28/hibernate3dtocopier-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/688557d62e1449a83fc5b09cf9a283de?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dakbhavesh</media:title>
		</media:content>
	</item>
		<item>
		<title>Copy Property from one bean to another bean</title>
		<link>http://dakbhavesh.wordpress.com/2010/03/28/copy-property-from-one-bean-to-another-bean/</link>
		<comments>http://dakbhavesh.wordpress.com/2010/03/28/copy-property-from-one-bean-to-another-bean/#comments</comments>
		<pubDate>Sun, 28 Mar 2010 09:40:20 +0000</pubDate>
		<dc:creator>dakbhavesh</dc:creator>
				<category><![CDATA[Core Java concepts]]></category>

		<guid isPermaLink="false">http://dakbhavesh.wordpress.com/2010/03/28/copy-property-from-one-bean-to-another-bean/</guid>
		<description><![CDATA[// Code is still needs improvement and I am working on it. package com.nextenders.server.transformers; import java.lang.reflect.Method; import java.util.Properties; import java.util.StringTokenizer; import com.nextenders.server.transformers.beanpack1.BeanOne; public class Transformer { public Transformer() { // TODO Auto-generated constructor stub } public Object replicate(Object object, Class clazz) throws Exception{ System.out.println(&#8220;Replication Starts&#8221;); Method[] methods = object.getClass().getMethods(); for (Method method : methods) { [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dakbhavesh.wordpress.com&amp;blog=9124675&amp;post=27&amp;subd=dakbhavesh&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>// Code is still needs improvement and I am working on it.</p>
<p>package com.nextenders.server.transformers;</p>
<p>import java.lang.reflect.Method;<br />
import java.util.Properties;<br />
import java.util.StringTokenizer;</p>
<p>import com.nextenders.server.transformers.beanpack1.BeanOne;</p>
<p>public class Transformer {</p>
<p>	public Transformer() {<br />
		// TODO Auto-generated constructor stub<br />
	}</p>
<p>	public Object replicate(Object object, Class clazz) throws Exception{</p>
<p>		System.out.println(&#8220;Replication Starts&#8221;);</p>
<p>		Method[] methods = object.getClass().getMethods();</p>
<p>		for (Method method : methods) {<br />
			String methodName = method.getName();<br />
			System.out.println(&#8220;Method :&#8221; + methodName);<br />
			if(methodName.startsWith(&#8220;get&#8221;, 0)){<br />
				Class returnType = method.getReturnType();<br />
				String setMethodName = methodName.replaceFirst(&#8220;get&#8221;, &#8220;set&#8221;);<br />
				System.out.println(&#8220;Replaced Name :	&#8220;+setMethodName);<br />
				Object obj = clazz.newInstance();<br />
				Method[] functions = obj.getClass().getMethods();<br />
				for (Method function : functions) {<br />
					String functionName = function.getName();<br />
					if(functionName.equals(setMethodName)){<br />
						System.out.println(&#8220;Matched :&#8221; + functionName);</p>
<p>					}<br />
				}<br />
			}else{<br />
				System.out.println(&#8220;Setter Method :&#8221; + methodName);<br />
			}<br />
		}<br />
		System.out.println(&#8220;Replication Ends&#8221;);<br />
		return null;<br />
	}</p>
<p>	public static void main(String[] args) {</p>
<p>		BeanOne one = new BeanOne();<br />
		one.setProp1(&#8220;Bhavesh&#8221;);<br />
		one.setProp2(&#8220;Hayden&#8221;);</p>
<p>		Class oneClass = one.getClass();</p>
<p>		Transformer txmer = new Transformer();<br />
		try {<br />
			txmer.replicate(one, com.nextenders.server.transformers.beanpack2.BeanOne.class);<br />
		} catch (Exception e) {<br />
			e.printStackTrace();<br />
		}<br />
		System.out.println(&#8220;&#8212;&#8212;-&#8221;);<br />
	}</p>
<p>}</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dakbhavesh.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dakbhavesh.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dakbhavesh.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dakbhavesh.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dakbhavesh.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dakbhavesh.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dakbhavesh.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dakbhavesh.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dakbhavesh.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dakbhavesh.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dakbhavesh.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dakbhavesh.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dakbhavesh.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dakbhavesh.wordpress.com/27/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dakbhavesh.wordpress.com&amp;blog=9124675&amp;post=27&amp;subd=dakbhavesh&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dakbhavesh.wordpress.com/2010/03/28/copy-property-from-one-bean-to-another-bean/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/688557d62e1449a83fc5b09cf9a283de?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dakbhavesh</media:title>
		</media:content>
	</item>
		<item>
		<title>Front Controller Pattern</title>
		<link>http://dakbhavesh.wordpress.com/2010/03/14/front-controller-pattern/</link>
		<comments>http://dakbhavesh.wordpress.com/2010/03/14/front-controller-pattern/#comments</comments>
		<pubDate>Sun, 14 Mar 2010 12:58:01 +0000</pubDate>
		<dc:creator>dakbhavesh</dc:creator>
				<category><![CDATA[Design Patterns]]></category>

		<guid isPermaLink="false">http://dakbhavesh.wordpress.com/?p=17</guid>
		<description><![CDATA[This pattern centralizes logic of processing response and request through command pattern and returns the page to be navigated once the request and response are processed.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dakbhavesh.wordpress.com&amp;blog=9124675&amp;post=17&amp;subd=dakbhavesh&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div>
<p>This pattern centralizes logic of processing response and request through command pattern and returns the page to be navigated once the request and response are processed.</p>
<p><img src="http://dakbhavesh.files.wordpress.com/2010/03/frontcontroller4.jpg?w=497" alt="FrontController Pattern"></p>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dakbhavesh.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dakbhavesh.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dakbhavesh.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dakbhavesh.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dakbhavesh.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dakbhavesh.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dakbhavesh.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dakbhavesh.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dakbhavesh.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dakbhavesh.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dakbhavesh.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dakbhavesh.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dakbhavesh.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dakbhavesh.wordpress.com/17/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dakbhavesh.wordpress.com&amp;blog=9124675&amp;post=17&amp;subd=dakbhavesh&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dakbhavesh.wordpress.com/2010/03/14/front-controller-pattern/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/688557d62e1449a83fc5b09cf9a283de?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dakbhavesh</media:title>
		</media:content>

		<media:content url="http://dakbhavesh.files.wordpress.com/2010/03/frontcontroller4.jpg" medium="image">
			<media:title type="html">FrontController Pattern</media:title>
		</media:content>
	</item>
		<item>
		<title>View HTML in swing Component</title>
		<link>http://dakbhavesh.wordpress.com/2010/03/14/view-html-in-swing-component/</link>
		<comments>http://dakbhavesh.wordpress.com/2010/03/14/view-html-in-swing-component/#comments</comments>
		<pubDate>Sun, 14 Mar 2010 10:53:44 +0000</pubDate>
		<dc:creator>dakbhavesh</dc:creator>
				<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Swing]]></category>

		<guid isPermaLink="false">http://dakbhavesh.wordpress.com/?p=7</guid>
		<description><![CDATA[Following is the code which displays HTML file in a Swing component "JScrollPane"<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dakbhavesh.wordpress.com&amp;blog=9124675&amp;post=7&amp;subd=dakbhavesh&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div>
</p>
<p><em></p>
<p>Following is the code which displays HTML file in a Swing component &#8220;JScrollPane&#8221;</p>
<p></em></p>
<p></p>
<p><code><br />
import javax.swing.*;<br />
import javax.swing.event.*;<br />
import javax.swing.text.Document;<br />
import java.net.URL;<br />
import java.io.*;<br />
import java.awt.Cursor;<br />
class HTMLDisplay extends JScrollPane implements HyperlinkListener<br />
{<br />
	JEditorPane edit;<br />
	public HTMLDisplay(String fileName)<br />
	{<br />
		edit = new JEditorPane();<br />
		edit.setEditable(false);<br />
		edit.addHyperlinkListener(this);</p>
<p>		getViewport().add(edit);<br />
		File file = new File(fileName);<br />
		showURL("file:"+file.getAbsolutePath());<br />
	}</p>
<p>	public void hyperlinkUpdate(HyperlinkEvent e)<br />
	{<br />
		if (HyperlinkEvent.EventType.ACTIVATED == e.getEventType())<br />
		{<br />
	    		// when a link is cliked page display is differed slightly to ensure<br />
	    		// proper evet dispatch and paint<br />
	    	Cursor c = edit.getCursor();<br />
			Cursor waitCursor = Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR);<br />
			edit.setCursor(waitCursor);<br />
	    	SwingUtilities.invokeLater(new URLLoader(e.getURL(), c));<br />
		}<br />
	}</p>
<p>//******************************************************************************************<br />
// Function Name : showURL(String url)<br />
// Parameter : String url<br />
// Returns : None<br />
//<br />
// Displays the URL passed to it in the JEditorPane, in case of error, shows error message box<br />
//<br />
//******************************************************************************************</p>
<p>	public void showURL(String url)<br />
	{<br />
		Document doc = edit.getDocument();<br />
		try{<br />
				edit.setPage(url);<br />
		}catch(IOException e)<br />
		{<br />
			//edit.setDocument(doc);<br />
			System.out.println(e);<br />
			JOptionPane.showMessageDialog(this, "Couldn't open page : " + url);<br />
			getToolkit().beep();<br />
		}<br />
	}	</p>
<p>//******************************************************************************************<br />
// Inner Class : URLLoader<br />
//<br />
// The inner class which loads the URL in its run method. Implements runnable.<br />
// Used with SwingUtilities.invokeLater() method<br />
//<br />
//******************************************************************************************</p>
<p>	class URLLoader implements Runnable<br />
	{<br />
		private URL url;<br />
		private Cursor cursor;</p>
<p>		URLLoader(URL u, Cursor c)<br />
		{<br />
			this.url = u;<br />
			this.cursor = c;<br />
		}</p>
<p>		public void run()<br />
		{<br />
				//after PAINT is done<br />
			if(null == url)<br />
			{<br />
				edit.setCursor(cursor);<br />
			}<br />
			else<br />
			{<br />
				showURL(url.toString());<br />
				url = null;<br />
					// to show normal cursor<br />
				SwingUtilities.invokeLater(this);<br />
			}<br />
		}<br />
	}<br />
}<br />
</code>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dakbhavesh.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dakbhavesh.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dakbhavesh.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dakbhavesh.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dakbhavesh.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dakbhavesh.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dakbhavesh.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dakbhavesh.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dakbhavesh.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dakbhavesh.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dakbhavesh.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dakbhavesh.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dakbhavesh.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dakbhavesh.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dakbhavesh.wordpress.com&amp;blog=9124675&amp;post=7&amp;subd=dakbhavesh&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dakbhavesh.wordpress.com/2010/03/14/view-html-in-swing-component/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/688557d62e1449a83fc5b09cf9a283de?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dakbhavesh</media:title>
		</media:content>
	</item>
	</channel>
</rss>
