<?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/"
	>

<channel>
	<title>indiWiz.com &#187; Java</title>
	<atom:link href="http://indiwiz.com/tag/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://indiwiz.com</link>
	<description>Subhash&#039;s Tech Log</description>
	<lastBuildDate>Sun, 29 Apr 2012 15:11:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Guava Libraries from Google</title>
		<link>http://indiwiz.com/2009/10/15/guava-libraries-from-google/</link>
		<comments>http://indiwiz.com/2009/10/15/guava-libraries-from-google/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 08:35:04 +0000</pubDate>
		<dc:creator>Subhash Chandran</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[google]]></category>

		<guid isPermaLink="false">http://indiwiz.com/?p=538</guid>
		<description><![CDATA[Discovered from a blog post Apache Commons-like Java library from Google: Guava Libraries. Check out their presentation which briefs the functionality.]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p>Discovered from a blog post Apache Commons-like Java library from Google: <a href="http://code.google.com/p/guava-libraries/">Guava Libraries</a>. Check out <a href="http://guava-libraries.googlecode.com/files/Guava_a_sketchy_overview.pdf">their presentation</a> which briefs the functionality.</p>
<div class="shr-publisher-538"></div><!-- Start Shareaholic LikeButtonSetBottom --><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://indiwiz.com/2009/10/15/guava-libraries-from-google/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New releases in Java space</title>
		<link>http://indiwiz.com/2009/10/13/new-releases-in-java-space/</link>
		<comments>http://indiwiz.com/2009/10/13/new-releases-in-java-space/#comments</comments>
		<pubDate>Tue, 13 Oct 2009 07:38:42 +0000</pubDate>
		<dc:creator>Subhash Chandran</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[news]]></category>

		<guid isPermaLink="false">http://indiwiz.com/?p=525</guid>
		<description><![CDATA[There have been some prominent releases in the past few weeks: Apache POI 3.5-FINAL: For reading/writing Microsoft Office format files from Java. Jetty 7.0: A servlet container akin to Tomcat. Easily embeddable and ideal for use in testing. XOM 1.2.3: New version of the XML parser written by Elliotte Rusty Harold.]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p>There have been some prominent releases in the past few weeks:</p>
<ul>
<li><a href="http://poi.apache.org/">Apache POI 3.5-FINAL</a>: For reading/writing Microsoft Office format files from Java.</li>
<li><a href="http://www.mortbay.org/jetty/">Jetty 7.0</a>: A servlet container akin to Tomcat. Easily embeddable and ideal for use in testing.</li>
<li><a href="http://xom.nu/">XOM 1.2.3</a>: New version of the XML parser written by <a href="http://www.elharo.com/">Elliotte Rusty Harold</a>.</li>
</ul>
<div class="shr-publisher-525"></div><!-- Start Shareaholic LikeButtonSetBottom --><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://indiwiz.com/2009/10/13/new-releases-in-java-space/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reduce Java boiler-plate code using Lombok</title>
		<link>http://indiwiz.com/2009/10/08/reduce-java-boiler-plate-code-using-lombok/</link>
		<comments>http://indiwiz.com/2009/10/08/reduce-java-boiler-plate-code-using-lombok/#comments</comments>
		<pubDate>Thu, 08 Oct 2009 07:25:02 +0000</pubDate>
		<dc:creator>Subhash Chandran</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[lombok]]></category>

		<guid isPermaLink="false">http://indiwiz.com/?p=519</guid>
		<description><![CDATA[We all hate the verbocity of Java. We all hate getters and setters and toString and hashCode and equals. We also hate the lack of closure support for proper resource handling. Now you can still love your favorite language without doing these manual chores! There is a fine OpenSource project, oddly named as Project Lombok [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p>We all hate the verbocity of Java. We all hate getters and setters and toString and hashCode and equals. We also hate the lack of closure support for proper resource handling. Now you can still love your favorite language without doing these manual chores!</p>
<p>There is a fine OpenSource project, oddly named as <a href="http://projectlombok.org/">Project Lombok</a> which fixes the boiler plate code writing (or generation) using annotations. Beautifully designed, this is some thing which could save you lot of time. Checkout their video (available in the <a href="http://projectlombok.org/">home page</a>).</p>
<div class="shr-publisher-519"></div><!-- Start Shareaholic LikeButtonSetBottom --><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://indiwiz.com/2009/10/08/reduce-java-boiler-plate-code-using-lombok/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XSL Transform using Java</title>
		<link>http://indiwiz.com/2009/09/14/xsl-transform-using-java/</link>
		<comments>http://indiwiz.com/2009/09/14/xsl-transform-using-java/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 11:26:42 +0000</pubDate>
		<dc:creator>Subhash Chandran</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[xsl]]></category>
		<category><![CDATA[xslt]]></category>

		<guid isPermaLink="false">http://indiwiz.com/?p=496</guid>
		<description><![CDATA[Have a look at the StreamSource API and StreamResult API to understand the various ways by which it can be instantiated.]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><pre class="brush: java; title: ; notranslate">
import javax.xml.transform.Templates;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;

...

// The XSL source:
StreamSource xsl = new StreamSource(...);

// Create the transformer:
TransformerFactory factory = TransformerFactory.newInstance();
Templates template = factory.newTemplates(xsl); // can throw TransformerConfigurationException (parent exception is: TransformerException)
Transformer transformer = template.newTransformer(); // can throw TransformerConfigurationException

// The data XML source
StreamSource data = new StreamSource(...);

// The transformed output:
StreamResult out = new StreamResult(...);

// Transform using the Transformer instance:
transformer.transform(data, out); // can throw TransformerException
</pre>
<p>Have a look at the <a href="http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/transform/stream/StreamSource.html">StreamSource API</a> and <a href="http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/transform/stream/StreamResult.html">StreamResult API</a> to understand the various ways by which it can be instantiated.</p>
<div class="shr-publisher-496"></div><!-- Start Shareaholic LikeButtonSetBottom --><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://indiwiz.com/2009/09/14/xsl-transform-using-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Maven Profiles</title>
		<link>http://indiwiz.com/2009/09/01/maven-profiles/</link>
		<comments>http://indiwiz.com/2009/09/01/maven-profiles/#comments</comments>
		<pubDate>Tue, 01 Sep 2009 10:16:54 +0000</pubDate>
		<dc:creator>Subhash Chandran</dc:creator>
				<category><![CDATA[build]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[maven]]></category>

		<guid isPermaLink="false">http://indiwiz.com/?p=453</guid>
		<description><![CDATA[Thanks to Arun Jeganath for making me understand Maven Profiles. Often we are forced to specify different build parameters in different environments. In the ages of Make, these parameters used to be specified as environment variables. In the world of Maven, we have profiles. Profiles: Introduction A sample profile information: Quick learning from the above [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p><i>Thanks to <a href="http://www.linkedin.com/in/arunjeganath">Arun Jeganath</a> for making me understand Maven Profiles.</i></p>
<p>Often we are forced to specify different build parameters in different environments. In the ages of <em>Make</em>, these parameters used to be specified as environment variables. In the world of Maven, we have profiles.</p>
<h4>Profiles: Introduction</h4>
<p>A sample profile information:</p>
<pre class="brush: xml; title: ; notranslate">
  &lt;profiles&gt;

    &lt;!-- DEV Profile (Default) --&gt;
    &lt;profile&gt;
      &lt;id&gt;dev-profile&lt;/id&gt;
      &lt;activation&gt;
        &lt;property&gt;
          &lt;name&gt;env&lt;/name&gt;
          &lt;value&gt;dev&lt;/value&gt;
        &lt;/property&gt;
        &lt;activeByDefault&gt;true&lt;/activeByDefault&gt; &lt;!-- Note this --&gt;
      &lt;/activation&gt;
      &lt;!-- Liferay Home in DEV --&gt;
      &lt;properties&gt;
        &lt;liferay-home&gt;${user.home}/apps/liferay-portal-tomcat-6.0-5.1.2&lt;/liferay-home&gt;
      &lt;/properties&gt;
    &lt;/profile&gt;

    &lt;!-- TEST Profile --&gt;
    &lt;profile&gt;
      &lt;id&gt;test-profile&lt;/id&gt;
      &lt;activation&gt;
        &lt;property&gt;
          &lt;name&gt;env&lt;/name&gt;
          &lt;value&gt;test&lt;/value&gt;
        &lt;/property&gt;
      &lt;/activation&gt;
      &lt;!-- Liferay Home in TEST --&gt;
      &lt;properties&gt;
        &lt;liferay-home&gt;/opt/apps/liferay-portal-tomcat-6.0-5.1.2&lt;/liferay-home&gt;
      &lt;/properties&gt;
    &lt;/profile&gt;
  &lt;/profiles&gt;
</pre>
<p>Quick learning from the above example:</p>
<ul>
<li>There can be number of profiles defined.</li>
<li>A profile can be marked as <em>&lt;activeByDefault&gt;</em>. This will enforce the configuration defined in the activated profile to take effect during build.</li>
<li>To enable a specific profile during build, the value defined in XPath <em>/profiles/profile/activation/property</em> needs to be passed the Maven as System Property (in our case: <strong>-Denv=test</strong>).</li>
<li>The property defined in the profile (<em>liferay-home</em>) can be referenced elsewhere in the <em>pom.xml</em> as <em>${liferay-home}</em>.</li>
</ul>
<h4>Placing profile information</h4>
<p>Profile information is generally placed in:</p>
<ol>
<li>In the project POM itself.</li>
<li>Inside <em>{user.home}/.m2/settings.xml</em>.</li>
</ol>
<p>In the first case (in this particular example), the deployment information is placed in the project&#8217;s POM. This, some might feel improper because the module/project build has hardcoded environment dependencies which might not work in other systems. The second option externalizes the platform specific build information. But a new developer checking out the project will not be aware of this external dependency causing his build to fail. Both these problems might be addressed using documentation: some projects have README and BUILD files explaining environment setup for build.</p>
<p>As we saw, both methods have advantages and disadvantages. Choose the method appropriate to your situation.</p>
<h4>Parameters that can be overridden in profiles</h4>
<p><em>Note</em>: This list is shamelessly copied from the <a href="http://maven.apache.org/guides/introduction/introduction-to-profiles.html">official Maven profiles guide</a>. Refer to this guide for detailed information.</p>
<ul>
<li><tt>&lt;repositories&gt;</tt></li>
<li><tt>&lt;pluginRepositories&gt;</tt></li>
<li><tt>&lt;dependencies&gt;</tt></li>
<li><tt>&lt;plugins&gt;</tt></li>
<li><tt>&lt;properties&gt;</tt> (not actually available in the main POM, but used behind the scenes)</li>
<li><tt>&lt;modules&gt;</tt></li>
<li><tt>&lt;reporting&gt;</tt></li>
<li><tt>&lt;dependencyManagement&gt;</tt></li>
<li><tt>&lt;distributionManagement&gt;</tt></li>
<li>a subset of the <tt>&lt;build&gt;</tt> element, which consists of:
<ul>
<li><tt>&lt;defaultGoal&gt;</tt></li>
<li><tt>&lt;resources&gt;</tt></li>
<li><tt>&lt;testResources&gt;</tt></li>
<li><tt>&lt;finalName&gt;</tt></li>
</ul>
<div class="shr-publisher-453"></div><!-- Start Shareaholic LikeButtonSetBottom --><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://indiwiz.com/2009/09/01/maven-profiles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Netbeans, Eclipse new releases</title>
		<link>http://indiwiz.com/2009/06/30/netbeans-eclipse-new-releases/</link>
		<comments>http://indiwiz.com/2009/06/30/netbeans-eclipse-new-releases/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 05:11:36 +0000</pubDate>
		<dc:creator>Subhash Chandran</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[news]]></category>
		<category><![CDATA[ide]]></category>

		<guid isPermaLink="false">http://indiwiz.com/?p=366</guid>
		<description><![CDATA[Eclipse Foundation released Eclipse Galileo on 24th June. Netbeans released version 6.7 on 29th June. Nice to see healthy competition from both sides . Download the latest versions of Netbeans and Eclipse.]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p>Eclipse Foundation <a href="http://www.eclipse.org/org/press-release/20090624_galileo.php">released Eclipse Galileo on 24<sup>th</sup> June</a>. Netbeans released <a href="http://www.netbeans.org/servlets/NewsItemView?newsItemID=1399">version 6.7 on 29<sup>th</sup> June</a>. Nice to see healthy competition from both sides <img src='http://indiwiz.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> . Download the latest versions of <a href="http://www.netbeans.org/downloads/index.html">Netbeans</a> and <a href="http://www.eclipse.org/downloads/">Eclipse</a>.</p>
<div class="shr-publisher-366"></div><!-- Start Shareaholic LikeButtonSetBottom --><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://indiwiz.com/2009/06/30/netbeans-eclipse-new-releases/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Maven managed projects: Generating dependency graph</title>
		<link>http://indiwiz.com/2009/06/22/maven-managed-projects-generating-dependency-graph/</link>
		<comments>http://indiwiz.com/2009/06/22/maven-managed-projects-generating-dependency-graph/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 01:38:18 +0000</pubDate>
		<dc:creator>Subhash Chandran</dc:creator>
				<category><![CDATA[build]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[netbeans]]></category>

		<guid isPermaLink="false">http://indiwiz.com/?p=342</guid>
		<description><![CDATA[When using Maven from commandline, use this command: If you are using Netbeans 6.7, you can generate a much more visual graph: For bringing up this graph, just right click on the project and select Show Dependency Graph. The screenshots above show the dependency graph for my project WizTools.org RESTClient.]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p>When using Maven from commandline, use this command:</p>
<p><a href="http://www.flickr.com/photos/subwiz/3649142396/" title="Maven Dependency Graph by subWiz, on Flickr"><img src="http://farm4.static.flickr.com/3552/3649142396_de89338f89.jpg" width="480" height="500" alt="Maven Dependency Graph" /></a></p>
<p>If you are using Netbeans 6.7, you can generate a much more visual graph:</p>
<p><a href="http://www.flickr.com/photos/subwiz/3649142964/" title="Netbeans Maven Dependency Graph by subWiz, on Flickr"><img src="http://farm3.static.flickr.com/2442/3649142964_43a9893c18.jpg" width="500" height="303" alt="Netbeans Maven Dependency Graph" /></a></p>
<p>For bringing up this graph, just right click on the project and select <em>Show Dependency Graph</em>.</p>
<p>The screenshots above show the dependency graph for my project <a href="http://rest-client.googlecode.com/">WizTools.org RESTClient</a>.</p>
<div class="shr-publisher-342"></div><!-- Start Shareaholic LikeButtonSetBottom --><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://indiwiz.com/2009/06/22/maven-managed-projects-generating-dependency-graph/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaFX 1.2 for Linux, Mac and Solaris</title>
		<link>http://indiwiz.com/2009/06/04/javafx-12-for-linux-mac-and-solaris/</link>
		<comments>http://indiwiz.com/2009/06/04/javafx-12-for-linux-mac-and-solaris/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 05:11:22 +0000</pubDate>
		<dc:creator>Subhash Chandran</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[news]]></category>
		<category><![CDATA[javafx]]></category>

		<guid isPermaLink="false">http://indiwiz.com/?p=313</guid>
		<description><![CDATA[JavaFX is now available for Linux, Solaris and Mac. Finally, now I can try this technology (I use Linux at work and home)!]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p><a href="http://javafx.com/">JavaFX</a> is <a href="http://javafx.com/downloads/all.jsp">now available</a> for Linux, Solaris and Mac. Finally, now I can try this technology (I use Linux at work and home)!</p>
<div class="shr-publisher-313"></div><!-- Start Shareaholic LikeButtonSetBottom --><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://indiwiz.com/2009/06/04/javafx-12-for-linux-mac-and-solaris/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java Multi-touch API</title>
		<link>http://indiwiz.com/2009/06/01/java-multi-touch-api/</link>
		<comments>http://indiwiz.com/2009/06/01/java-multi-touch-api/#comments</comments>
		<pubDate>Mon, 01 Jun 2009 10:51:03 +0000</pubDate>
		<dc:creator>Subhash Chandran</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[news]]></category>
		<category><![CDATA[hci]]></category>
		<category><![CDATA[multitouch]]></category>

		<guid isPermaLink="false">http://indiwiz.com/?p=305</guid>
		<description><![CDATA[Multi-touch is one of the areas where there is no standard in Java. I believe some of the vendors might have developed custom multi-touch APIs for Java. But wouldn&#8217;t we, as developers, prefer some standard API which would work across multiple vendors? Richard Monson-Haefel, an eccentric genius whose work spans Java and multi-touch world, has [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p>Multi-touch is one of the areas where there is no standard in Java. I believe some of the vendors might have developed custom multi-touch APIs for Java. But wouldn&#8217;t we, as developers, prefer some standard API which would work across multiple vendors? Richard Monson-Haefel, an <a href="http://www.monson-haefel.com/work.html">eccentric genius</a> whose work spans Java and multi-touch world, has taken the initiative to <a href="http://theclevermonkey.blogspot.com/2009/05/java-multitouch-api-standard.html">call for participation in this standardization process</a>. Interested people, please join him in creating history!</p>
<div class="shr-publisher-305"></div><!-- Start Shareaholic LikeButtonSetBottom --><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://indiwiz.com/2009/06/01/java-multi-touch-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JDK 6 Update 14 Released</title>
		<link>http://indiwiz.com/2009/06/01/jdk-6-update-14-released/</link>
		<comments>http://indiwiz.com/2009/06/01/jdk-6-update-14-released/#comments</comments>
		<pubDate>Mon, 01 Jun 2009 05:58:10 +0000</pubDate>
		<dc:creator>Subhash Chandran</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[news]]></category>

		<guid isPermaLink="false">http://indiwiz.com/?p=303</guid>
		<description><![CDATA[The important feature update in this release is the inclusion of Garbage-First Garbage Collector (aka G1). Download JDK 6 update 14.]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop --><!-- End Shareaholic LikeButtonSetTop --><p>The important feature update in this release is the inclusion of <a href="http://developers.sun.com/learning/javaoneonline/j1sessn.jsp?sessn=TS-5419&#038;yr=2008&#038;track=javase">Garbage-First Garbage Collector</a> (aka G1). <a href="http://java.sun.com/javase/downloads/index.jsp">Download JDK 6 update 14</a>.</p>
<div class="shr-publisher-303"></div><!-- Start Shareaholic LikeButtonSetBottom --><!-- End Shareaholic LikeButtonSetBottom -->]]></content:encoded>
			<wfw:commentRss>http://indiwiz.com/2009/06/01/jdk-6-update-14-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

