code-g


Flexible pattern based java code generator

Code-g is a flexible pattern based code generator.

Motivation

Interfaces are very powerful, in many cases using commonly known naming convention, design pattern, they indicate intention of implementation to be used. If that is the case why bother writing boiler-plate code, why not just generated full or partial implementation automatically. Naming convention is a powerful tool, in addition of data types, annotation it provides enough information to automate most of the common use cases.

Features

Automatic code generation

Code-g analyses source classes and where applicable generates source code.

Bulk code generation

Code-g can provide implementation to the whole package tree, individual packages, or classes.

Flexible code generation plugin

A code generator is simply a plugin, it is easily to extend or create new one, with re-using any existing pattern matching implementation.

Method pattern matching

Convenient methods pattern matcher utility to simply match any method groups based on their result and argument types, naming convention etc.

Dynamic class loading

Code-g has ability to load at runtime just generated code.

Maven integration

All code generation can by flexibly integrated with you maven project. Classes generated by one plugin can be used by another plugin in the same run. Partial source compilation is supported to avoid circular dependencies within a project.

References

GetStarted

Project Information

The project was created on Feb 12, 2012.

Labels:
CodeGeneration Java Automation Design Pattern Plugin Runtime