The current version (version 0.8) already provides components for creating EMF models from java source code (see this older post). In next version, new components will be dedicated to JSP reverse-engineering. They have been developped by Fabien Giquel and Nicolas Guyomar of Mia-Software.
They are composed of:
- a metamodel for describing a JSP
- a discoverer for creating a model from a set of JSP pages
- a generator for generating JSP pages from a model
The JSP metamodel (defined with Ecore) is an extention of the XML metamodel (also provided by MoDisco) which contains types such as Page, JSPScriptlet, JSPExpression, JSPTagLib, etc.
The discoverer, is a component which analyzes JSP pages and creates an EMF model conforming to the JSP metamodel.
It can be launched from a project, or directly from JSP pages.
The result is an EMF model which can be opened with the MoDisco Model Browser.
The generator allows regenerating JSP files from an EMF model (conforming to the JSP metamodel). While it still needs to be improved to support a better formatting, yet it can already be used to produce JSP files.
With these new components, you can reverse-enginer JSP files and use EMF APIs in order to control coding norms, detect patterns, document existing pages or refactor them by applying transformation at the model level (and then use the generator to get a new version of your JSPs).