background preloader

Java

Facebook Twitter

Benchmark

Create dynamic applications with javax.tools. Introduction The javax.tools package, added to Java SE 6 as a standard API for compiling Java source, lets you add dynamic capabilities to extend static applications. This article provides an overview of the major classes in the package and demonstrates how to use them to create a façade for compiling Java source from Java Strings, StringBuffers, or other CharSequences, instead of files.

It then uses this façade to build an interactive plotting application that lets the user express a numeric function y = f(x) using any valid numeric Java expression. Finally, it discusses the possible security risks associated with dynamic source compilation and ways to deal with those risks. The idea of extending applications via compiling and loading Java extensions isn't new, and several existing frameworks support this capability. JavaServer Pages (JSP) technology in Java Platform, Enterprise Edition (Java EE) is a widely known example of a dynamic framework that generates and compiles Java classes. Comparing the Google Collections Library with the Apache Commons. Hen I first learned about the Google Collections Library, I was puzzled.

The Google Collections Library enhances the JDK's Java Collections Framework, and its developers plan to make it part of JDK 7. As a user of Apache's Jakarta Commons Collections, I didn't understand why Google created an API to enhance the Java Collections Framework when Apache had already done so. I read in an interview with one of the Google Collections Library creators that a motivation for creating a new library was to provide JDK 5 Generics support, which Jakarta Commons Collections lacks.

I also read that Jakarta Commons Collections contains a few classes that violate the Java Collections Framework specification. Upon investigating these claims I found that Jakarta Commons Collections indeed doesn't support JDK 5 Generics—a definite flaw. However, I found this SourceForge project, which claims to be a JDK 5 Generics-enabled version of Jakarta Commons Collections. JavaRebel. Corner Articles. Summary The Abstract Syntax Tree is the base framework for many powerful tools of the Eclipse IDE, including refactoring, Quick Fix and Quick Assist. The Abstract Syntax Tree maps plain Java source code in a tree form.

This tree is more convenient and reliable to analyse and modify programmatically than text-based source. This article shows how you can use the Abstract Syntax Tree for your own applications. By Thomas Kuhn, Eye Media GmbHOlivier Thomann, IBM Ottawa Lab Copyright ©2006 Thomas Kuhn, Olivier Thomann. Made available under the EPL v1.0 November 20, 2006 Are you wondering how Eclipse is doing all the magic like jumping conveniently to a declaration, when you press "F3" on a reference to a field or method? Well, these—and a big portion of the other source code modification and generation tools—are based upon the Abstract Syntax Tree (AST). This article refers to an example application which covers most of the interesting AST-related topics. Removal of unnecessary declaration. Debasish Ghosh: Hello, 2008! Will Java Strike Back? The ServerSide Interoperability Blog » Mini-Guide: REST (Represe.