blob: 819832d4a101654db621807c1c48804429ba8b88 [file] [log] [blame] [view]
Nicholas Smith646793d2015-01-20 14:53:07 +00001## Java Parser and Abstract Syntax Tree
matozoid2cab70d2013-09-16 13:31:33 +02002
Nicholas Smith26c753d2015-01-14 10:02:55 +00003This package contains a Java 1.8 Parser with AST generation and visitor support.
Nicholas Smithcd1296d2015-01-20 14:22:40 +00004
5The AST records the source code structure, javadoc and comments. It is also possible to change the AST nodes or create new ones to modify the source code.
matozoid2d4deca2011-10-30 14:35:59 +01006
Nicholas Smithd7c51132015-09-02 13:14:42 +01007[![Maven Central](https://img.shields.io/maven-central/v/com.github.javaparser/javaparser-core.svg)](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.github.javaparser%22%20AND%20a%3A%22javaparser-core%22)
Nicholas Smith2b77f432015-02-23 11:01:28 +00008[![Build Status](https://travis-ci.org/javaparser/javaparser.svg?branch=master)](https://travis-ci.org/javaparser/javaparser)
Nicholas Smithcc80fc12015-08-17 15:15:26 +01009[![Coverage Status](https://coveralls.io/repos/javaparser/javaparser/badge.svg?branch=master&service=github)](https://coveralls.io/github/javaparser/javaparser?branch=master)
Nicholas Smithd6a80982015-08-17 15:25:32 +010010[![Join the chat at https://gitter.im/javaparser/javaparser](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/javaparser/javaparser?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
Nicholas Smithcc80fc12015-08-17 15:15:26 +010011
Nicholas Smithcd1296d2015-01-20 14:22:40 +000012## Features
13
14* Light weight
15* Performant
16* Easy to use
17* Modifiable AST
18* Create AST from scratch
19* Support of comments
20
21## Dependency Management
22
matozoid3c137e92016-04-06 19:37:37 +020023The project binaries are available in Maven Central. Just add the following to your maven configuration or tailor to your own dependency management system.
Federico Tomassetticf8d7b12014-07-30 19:00:26 +010024
Nicholas Smith15a23ae2015-01-14 10:27:51 +000025Current 1.8 Release
Nicholas Smithd7c51132015-09-02 13:14:42 +010026
Nicholas Smith15a23ae2015-01-14 10:27:51 +000027```xml
Federico Tomassetticf8d7b12014-07-30 19:00:26 +010028<dependency>
Nicholas Smith26c753d2015-01-14 10:02:55 +000029 <groupId>com.github.javaparser</groupId>
30 <artifactId>javaparser-core</artifactId>
matozoid3c137e92016-04-06 19:37:37 +020031 <version>2.4.0</version>
Federico Tomassetticf8d7b12014-07-30 19:00:26 +010032</dependency>
Federico Tomassetti2051f042014-07-30 19:01:19 +010033```
Federico Tomassetticf8d7b12014-07-30 19:00:26 +010034
Nicholas Smith15a23ae2015-01-14 10:27:51 +000035Final 1.7 Release
Nicholas Smithd7c51132015-09-02 13:14:42 +010036
Nicholas Smith15a23ae2015-01-14 10:27:51 +000037```xml
38<dependency>
39 <groupId>com.google.code.javaparser</groupId>
40 <artifactId>javaparser</artifactId>
41 <version>1.0.11</version>
42</dependency>
43```
44
Nicholas Smithcd1296d2015-01-20 14:22:40 +000045## How To Compile Sources
Nicholas Smith15a23ae2015-01-14 10:27:51 +000046
Nicholas Smithcd1296d2015-01-20 14:22:40 +000047If you have checkout the project from GitHub you can build the project with maven using:
Federico Tomassetticf8d7b12014-07-30 19:00:26 +010048
Federico Tomassetti2051f042014-07-30 19:01:19 +010049```
Federico Tomassetticf8d7b12014-07-30 19:00:26 +010050mvn clean install
Federico Tomassetti2051f042014-07-30 19:01:19 +010051```
Federico Tomassetticf8d7b12014-07-30 19:00:26 +010052
Nicholas Smith3e6e6202015-01-20 14:24:25 +000053If you checkout the sources and want to view the project in an IDE, it is best to generate the additional source files; otherwise you will get many compilation complaints in the IDE
Nicholas Smithcd1296d2015-01-20 14:22:40 +000054
55```
56mvn javacc:javacc
57```
58
59## Manual
60
61Examples of how to use the library can be found on the [Manual](https://github.com/javaparser/javaparser/wiki/Manual) page of the wiki
62
Nicholas Smith26c753d2015-01-14 10:02:55 +000063## Troubleshooting
64
Nicholas Smithcd1296d2015-01-20 14:22:40 +000065In the first instance try the [wiki](https://github.com/javaparser/javaparser/wiki)
Nicholas Smith26c753d2015-01-14 10:02:55 +000066
67In the second instance please feel free to open an [issue](https://github.com/javaparser/javaparser/issues).
Federico Tomassetticf8d7b12014-07-30 19:00:26 +010068
69## Javadoc
70
Nicholas Smithc86a9ff2015-08-12 13:20:26 +010071The libraries javadoc can be found [here](http://www.javadoc.io/doc/com.github.javaparser/javaparser-core/)
Federico Tomassetticf8d7b12014-07-30 19:00:26 +010072
73## History
74
Didier Villevaloisd5e88432015-03-16 14:23:45 +010075This parser is based on work by Sreenivasa Viswanadha and Jรบlio Vilmar Gesser. The original project, now inactive, was originally hosted at [Google Code](http://code.google.com/p/javaparser/) and supported only parsing Java 1.5.
matozoid2d4deca2011-10-30 14:35:59 +010076
Didier Villevaloisd5e88432015-03-16 14:23:45 +010077The project now supports parsing Java 1.8 and aims to continue support for features in future versions of the Java language.
Nicholas Smith26c753d2015-01-14 10:02:55 +000078
Federico Tomassetti43e1e412015-08-06 17:31:26 +020079## Related projects
80
81From JavaParser other projects have been derived:
82
83* [Walkmod](http://walkmod.com/): a tool to automatically correct violations of code conventions
Edgar Espina1986cf82016-02-29 09:40:38 -030084* [jooby spec](http://jooby.org/doc/spec): analyze and exports [jooby routes](http://jooby.org) to [raml](http://raml.org) and [Swagger](http://swagger.io)
Federico Tomassetti43e1e412015-08-06 17:31:26 +020085
86## Credits
87
88This project has been maintained thanks to the joint efforts of many contributors: we are extremely grateful to all of them.
89
90In particular we are thankful to the contributions we received by the [Walkmod](http://walkmod.com/) project which permitted to finalize support for Java 8. The author granted us the permissions to release that code also under the Apache License and we have greatly appreciated that.
91
Didier Villevaloisd5e88432015-03-16 14:23:45 +010092## License
Nicholas Smith26c753d2015-01-14 10:02:55 +000093
Federico Tomassetti2c7ba122015-08-12 08:06:33 +020094JavaParser is available either under the terms of the LGPL License or the Apache License. You as the user are entitled to choose the terms under which adopt JavaParser.
Federico Tomassettiee6a48a2015-07-25 14:42:17 +020095
96For details about the LGPL License please refer to [LICENSE.LGPL](ttps://github.com/javaparser/javaparser/blob/master/LICENSE.LGPL).
97
98For details about the Apache License please refer to [LICENSE.APACHE](ttps://github.com/javaparser/javaparser/blob/master/LICENSE.APACHE).