Java Code Geeks » Dustin Marx http://www.javacodegeeks.com/ Java 2 Java Developers Resource Center Tue, 03 Mar 2015 14:00:32 +0000 en-US hourly 1 http://wordpress.org/?v=4.1.1 Joining Strings in JDK 8http://www.javacodegeeks.com/2015/02/joining-strings-in-jdk-8.html http://www.javacodegeeks.com/2015/02/joining-strings-in-jdk-8.html#comments Fri, 27 Feb 2015 11:00:11 +0000 http://www.javacodegeeks.com/?p=37462 JDK 8 introduced language features such as lambda expressions, streams, and even the new Date/Time API that will change the way we write Java applications. However, there are also several new APIs and features that might be less “game changing,” but still bring greater convenience and expressiveness to the Java programming language. In this post, […]

 

]]>
http://www.javacodegeeks.com/2015/02/joining-strings-in-jdk-8.html/feed/ 1
Determining File Types in Javahttp://www.javacodegeeks.com/2015/02/determining-file-types-java.html http://www.javacodegeeks.com/2015/02/determining-file-types-java.html#comments Mon, 23 Feb 2015 14:00:45 +0000 http://www.javacodegeeks.com/?p=37368 Programmatically determining the type of a file can be surprisingly tricky and there have been many content-based file identification approaches proposed and implemented. There are several implementations available in Java for detecting file types and most of them are largely or solely based on files’ extensions. This post looks at some of the most commonly […]

 

]]>
http://www.javacodegeeks.com/2015/02/determining-file-types-java.html/feed/ 0
Using JDK 8 Streams to Convert Between Collections of Wrapped Objects and Collections of Wrapper Objectshttp://www.javacodegeeks.com/2015/02/using-jdk-8-streams-convert-collections-wrapped-objects-collections-wrapper-objects.html http://www.javacodegeeks.com/2015/02/using-jdk-8-streams-convert-collections-wrapped-objects-collections-wrapper-objects.html#comments Mon, 23 Feb 2015 11:00:22 +0000 http://www.javacodegeeks.com/?p=37342 I have found Decorators and Adapters to be useful from time to time as I have worked with Java-based applications. These “wrappers” work well in a variety of situations and are fairly easy to understand and implement, but things can become a bit more tricky when a hierarchy of objects rather than a single object […]

 

]]>
http://www.javacodegeeks.com/2015/02/using-jdk-8-streams-convert-collections-wrapped-objects-collections-wrapper-objects.html/feed/ 1
A JAXB Nuance: String Versus Enum from Enumerated Restricted XSD Stringhttp://www.javacodegeeks.com/2015/02/jaxb-nuance-string-versus-enum-enumerated-restricted-xsd-string.html http://www.javacodegeeks.com/2015/02/jaxb-nuance-string-versus-enum-enumerated-restricted-xsd-string.html#comments Fri, 20 Feb 2015 17:00:23 +0000 http://www.javacodegeeks.com/?p=37121 Although Java Architecture for XML Binding (JAXB) is fairly easy to use in nominal cases (especially since Java SE 6), it also presents numerous nuances. Some of the common nuances are due to the inability to exactly match (bind) XML Schema Definition (XSD) types to Java types. This post looks at one specific example of […]

 

]]>
http://www.javacodegeeks.com/2015/02/jaxb-nuance-string-versus-enum-enumerated-restricted-xsd-string.html/feed/ 0
Writing Groovy’s groovy.util.slurpersupport.GPathResult (XmlSlurper) Content as XMLhttp://www.javacodegeeks.com/2015/02/writing-groovys-groovy-util-slurpersupport-gpathresult-xmlslurper-content-xml.html http://www.javacodegeeks.com/2015/02/writing-groovys-groovy-util-slurpersupport-gpathresult-xmlslurper-content-xml.html#comments Thu, 19 Feb 2015 23:00:43 +0000 http://www.javacodegeeks.com/?p=37116 In a previous blog post, I described using XmlNodePrinter to present XML parsed with XmlParser in a nice format to standard output, as a Java String, and in a new file. Because XmlNodePrinter works with groovy.util.Node instances, it works well with XmlParser, but doesn’t work so well with XmlSlurper because XmlSlurper deals with instances of […]

 

]]>
http://www.javacodegeeks.com/2015/02/writing-groovys-groovy-util-slurpersupport-gpathresult-xmlslurper-content-xml.html/feed/ 0
Writing Groovy’s groovy.util.Node (XmlParser) Content as XMLhttp://www.javacodegeeks.com/2015/02/writing-groovys-groovy-util-node-xmlparser-content-xml.html http://www.javacodegeeks.com/2015/02/writing-groovys-groovy-util-node-xmlparser-content-xml.html#comments Wed, 18 Feb 2015 05:00:41 +0000 http://www.javacodegeeks.com/?p=37198 Groovy‘s XmlParser makes it easy to parse an XML file, XML input stream, or XML string using one its overloaded parse methods (or parseText in the case of the String). The XML content parsed with any of these methods is made available as a groovy.util.Node instance. This blog post describes how to make the return […]

 

]]>
http://www.javacodegeeks.com/2015/02/writing-groovys-groovy-util-node-xmlparser-content-xml.html/feed/ 0
Programmatically Determining Java Class’s JDK Compilation Versionhttp://www.javacodegeeks.com/2015/02/programmatically-determining-java-classs-jdk-compilation-version.html http://www.javacodegeeks.com/2015/02/programmatically-determining-java-classs-jdk-compilation-version.html#comments Tue, 03 Feb 2015 11:00:34 +0000 http://www.javacodegeeks.com/?p=36465 When it is necessary to determine which JDK version was used to compile a particular Java .class file, an approach that is often used is to use javap and to look for the listed “major version” in the javap output. I referenced this approach in my blog post Autoboxing, Unboxing, and NoSuchMethodError, but describe it […]

 

]]>
http://www.javacodegeeks.com/2015/02/programmatically-determining-java-classs-jdk-compilation-version.html/feed/ 0
Reason for Slower Reading of Large Lines in JDK 7 and JDK 8http://www.javacodegeeks.com/2015/01/reason-for-slower-reading-of-large-lines-in-jdk-7-and-jdk-8.html http://www.javacodegeeks.com/2015/01/reason-for-slower-reading-of-large-lines-in-jdk-7-and-jdk-8.html#comments Thu, 29 Jan 2015 11:00:52 +0000 http://www.javacodegeeks.com/?p=36287 I earlier posted the blog post Reading Large Lines Slower in JDK 7 and JDK 8 and there were some useful comments on the post describing the issue. This post provides more explanation regarding why the file reading demonstrated in that post (and used by Ant‘s LineContainsRegExp) is so much slower in Java 7 and […]

 

]]>
http://www.javacodegeeks.com/2015/01/reason-for-slower-reading-of-large-lines-in-jdk-7-and-jdk-8.html/feed/ 0
Total Bummer: Pivotal Drops Groovyhttp://www.javacodegeeks.com/2015/01/total-bummer-pivotal-drops-groovy.html http://www.javacodegeeks.com/2015/01/total-bummer-pivotal-drops-groovy.html#comments Fri, 23 Jan 2015 08:00:36 +0000 http://www.javacodegeeks.com/?p=36080 Pivotal announced today that Groovy 2.4 And Grails 3.0 will be the last major releases under Pivotal sponsorship. This is big news that has not surprisingly created a lot of buzz in the blogosphere. In this post, I describe some of the questions that others and I are wondering about and speculate on Groovy‘s future. […]

 

]]>
http://www.javacodegeeks.com/2015/01/total-bummer-pivotal-drops-groovy.html/feed/ 0
2015 Starts Off Strong for Java 8http://www.javacodegeeks.com/2015/01/2015-starts-off-strong-for-java-8.html http://www.javacodegeeks.com/2015/01/2015-starts-off-strong-for-java-8.html#comments Fri, 16 Jan 2015 11:58:57 +0000 http://www.javacodegeeks.com/?p=35862 JDK 8 is starting 2015 with a surge in popularity in terms of blog posts and articles. This is coinciding with Java being automatically upgraded to JDK 8 this month. In this post, I list and briefly describe some of the numerous articles and posts on JDK 8 that have been published already in 2015. […]

 

]]>
http://www.javacodegeeks.com/2015/01/2015-starts-off-strong-for-java-8.html/feed/ 0