|
| 1 | +<!DOCTYPE html> |
| 2 | +<html lang="en-us"> |
| 3 | + <head> |
| 4 | + <meta charset="UTF-8"> |
| 5 | + <title>JavaParser by javaparser</title> |
| 6 | + <meta name="viewport" content="width=device-width, initial-scale=1"> |
| 7 | + <link rel="stylesheet" type="text/css" href="stylesheets/normalize.css" media="screen"> |
| 8 | + <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'> |
| 9 | + <link rel="stylesheet" type="text/css" href="stylesheets/stylesheet.css" media="screen"> |
| 10 | + <link rel="stylesheet" type="text/css" href="stylesheets/github-light.css" media="screen"> |
| 11 | + <link href="https://fonts.googleapis.com/css?family=Courgette" rel="stylesheet"> |
| 12 | + </head> |
| 13 | + <body> |
| 14 | + <section class="page-header" > |
| 15 | + <h1 class="project-name title-font">JavaParser</h1> |
| 16 | + <!--<h2 class="project-tagline">Process Java code programmatically</h2>--> |
| 17 | + </section> |
| 18 | + |
| 19 | + <section class="main-content"> |
| 20 | + <h2> |
| 21 | +<a id="java-parser-and-abstract-syntax-tree" class="anchor" href="#java-parser-and-abstract-syntax-tree" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Java Parser and Abstract Syntax Tree</h2> |
| 22 | + |
| 23 | +<p>JavaParser is a set of tools to: |
| 24 | + <ul> |
| 25 | + <li>parse |
| 26 | + <li>analyze |
| 27 | + <li>transform |
| 28 | + <li>generate |
| 29 | + </ul> |
| 30 | + Java code |
| 31 | +</p> |
| 32 | + |
| 33 | +<h2 class="project-tagline">A set of tools to parse, analyze, transform and generate Java code</h2> |
| 34 | + |
| 35 | +<p>This package contains a Java 1.8 Parser with AST generation and visitor support.</p> |
| 36 | + |
| 37 | +<p>The AST records the source code structure. |
| 38 | +You can analyze source code for any purpose. |
| 39 | +It is possible to change the AST nodes or create new ones to modify the source code.</p> |
| 40 | + |
| 41 | +<p>When you need not only the text from the source code but you also need type information, |
| 42 | +you can use <a href="https://github.com/javaparser/javasymbolsolver">the Java Symbol Solver project.</a></p> |
| 43 | + |
| 44 | +<p><a href="http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.github.javaparser%22%20AND%20a%3A%22javaparser-core%22"><img src="https://img.shields.io/maven-central/v/com.github.javaparser/javaparser-core.svg" alt="Maven Central"></a> |
| 45 | +<a href="https://travis-ci.org/javaparser/javaparser"><img src="https://travis-ci.org/javaparser/javaparser.svg?branch=master" alt="Build Status"></a> |
| 46 | +<a href="https://coveralls.io/github/javaparser/javaparser?branch=master"><img src="https://coveralls.io/repos/javaparser/javaparser/badge.svg?branch=master&service=github" alt="Coverage Status"></a> |
| 47 | +<a href="https://gitter.im/javaparser/javaparser?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge"><img src="https://badges.gitter.im/Join%20Chat.svg" alt="Join the chat at https://gitter.im/javaparser/javaparser"></a></p> |
| 48 | + |
| 49 | +<h2> |
| 50 | +<a id="features" class="anchor" href="#features" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Features</h2> |
| 51 | + |
| 52 | +<ul> |
| 53 | +<li> Light weight</li> |
| 54 | +<li> Performant</li> |
| 55 | +<li> Easy to use</li> |
| 56 | +<li> Modifiable AST</li> |
| 57 | +<li> Code generation</li> |
| 58 | +<li> Support of comments</li> |
| 59 | +</ul> |
| 60 | + |
| 61 | +<h2> |
| 62 | +<a id="dependency-management" class="anchor" href="#dependency-management" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Dependency Management</h2> |
| 63 | + |
| 64 | +<p>The project binaries are available in Maven Central. Just add the following to your maven configuration or tailor to your own dependency management system.</p> |
| 65 | + |
| 66 | +<p>Suggested version (many fixes, new features, and mostly stable API):</p> |
| 67 | + |
| 68 | +<div class="highlight highlight-text-xml"><pre><<span class="pl-ent">dependency</span>> |
| 69 | + <<span class="pl-ent">groupId</span>>com.github.javaparser</<span class="pl-ent">groupId</span>> |
| 70 | + <<span class="pl-ent">artifactId</span>>javaparser-core</<span class="pl-ent">artifactId</span>> |
| 71 | + <<span class="pl-ent">version</span>>3.0.0-RC.1</<span class="pl-ent">version</span>> |
| 72 | +</<span class="pl-ent">dependency</span>></pre></div> |
| 73 | + |
| 74 | +<p>Current production release:</p> |
| 75 | + |
| 76 | +<div class="highlight highlight-text-xml"><pre><<span class="pl-ent">dependency</span>> |
| 77 | + <<span class="pl-ent">groupId</span>>com.github.javaparser</<span class="pl-ent">groupId</span>> |
| 78 | + <<span class="pl-ent">artifactId</span>>javaparser-core</<span class="pl-ent">artifactId</span>> |
| 79 | + <<span class="pl-ent">version</span>>2.5.1</<span class="pl-ent">version</span>> |
| 80 | +</<span class="pl-ent">dependency</span>></pre></div> |
| 81 | + |
| 82 | +<h2> |
| 83 | +<a id="how-to-compile-sources" class="anchor" href="#how-to-compile-sources" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>How To Compile Sources</h2> |
| 84 | + |
| 85 | +<p>If you have checkout the project from GitHub you can build the project with maven using:</p> |
| 86 | + |
| 87 | +<pre><code>mvn clean install |
| 88 | +</code></pre> |
| 89 | + |
| 90 | +<p>If you checkout the sources and want to view the project in an IDE, it is best to first generate some of the source files; otherwise you will get many compilation complaints in the IDE. (mvn clean install already does this for you.)</p> |
| 91 | + |
| 92 | +<pre><code>mvn javacc:javacc |
| 93 | +</code></pre> |
| 94 | + |
| 95 | +<h2> |
| 96 | +<a id="manual" class="anchor" href="#manual" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Manual</h2> |
| 97 | + |
| 98 | +<p>Examples of how to use the library can be found on the <a href="https://github.com/javaparser/javaparser/wiki/Manual">Manual</a> page of the wiki</p> |
| 99 | + |
| 100 | +<h2> |
| 101 | +<a id="troubleshooting" class="anchor" href="#troubleshooting" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Troubleshooting</h2> |
| 102 | + |
| 103 | +<p>First try the <a href="https://github.com/javaparser/javaparser/wiki">wiki</a>.</p> |
| 104 | + |
| 105 | +<p>Didn't find an answer? Try <a href="https://github.com/javaparser/javaparser/issues?utf8=%E2%9C%93&q=is%3Aissue%20">searching for existing issues</a></p> |
| 106 | + |
| 107 | +<p>Still nothing? <a href="https://github.com/javaparser/javaparser/issues/new">Open an issue</a> or <a href="https://gitter.im/javaparser/javaparser">come chat on Gitter</a></p> |
| 108 | + |
| 109 | +<h2> |
| 110 | +<a id="javadoc" class="anchor" href="#javadoc" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Javadoc</h2> |
| 111 | + |
| 112 | +<p>The libraries javadoc can be found <a href="http://www.javadoc.io/doc/com.github.javaparser/javaparser-core/">here</a></p> |
| 113 | + |
| 114 | +<h2> |
| 115 | +<a id="history" class="anchor" href="#history" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>History</h2> |
| 116 | + |
| 117 | +<p>This parser is based on work by Sreenivasa Viswanadha and Júlio Vilmar Gesser. The original project, now inactive, was originally hosted at <a href="http://code.google.com/p/javaparser/">Google Code</a> and supported only parsing Java 1.5.</p> |
| 118 | + |
| 119 | +<p>The project now supports parsing Java 1.8 and aims to continue support for features in future versions of the Java language.</p> |
| 120 | + |
| 121 | +<h2> |
| 122 | +<a id="related-projects" class="anchor" href="#related-projects" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Related projects</h2> |
| 123 | + |
| 124 | +<p><a href="https://github.com/javaparser/javasymbolsolver">JavaSymbolSolver</a> is a project from the same committers working on JavaParser. |
| 125 | +You can use it to calculate the type of JavaParser expressions and connecting references with their declarations. </p> |
| 126 | + |
| 127 | +<p>From JavaParser other projects have been derived:</p> |
| 128 | + |
| 129 | +<ul> |
| 130 | +<li> |
| 131 | +<a href="http://walkmod.com/">Walkmod</a>: a tool to automatically correct violations of code conventions</li> |
| 132 | +<li> |
| 133 | +<a href="http://jooby.org/doc/spec">jooby spec</a>: analyze and exports <a href="http://jooby.org">jooby routes</a> to <a href="http://raml.org">raml</a> and <a href="http://swagger.io">Swagger</a> |
| 134 | +</li> |
| 135 | +</ul> |
| 136 | + |
| 137 | +<h2> |
| 138 | +<a id="credits" class="anchor" href="#credits" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Credits</h2> |
| 139 | + |
| 140 | +<p>This project has been maintained thanks to the joint efforts of many contributors: we are extremely grateful to all of them.</p> |
| 141 | + |
| 142 | +<p>In particular we are thankful to the contributions we received by the <a href="http://walkmod.com/">Walkmod</a> 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.</p> |
| 143 | + |
| 144 | +<h2> |
| 145 | +<a id="license" class="anchor" href="#license" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>License</h2> |
| 146 | + |
| 147 | +<p>JavaParser 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.</p> |
| 148 | + |
| 149 | +<p>For details about the LGPL License please refer to LICENSE.LGPL.</p> |
| 150 | + |
| 151 | +<p>For details about the Apache License please refer to LICENSE.APACHE.</p> |
| 152 | + |
| 153 | + <footer class="site-footer"> |
| 154 | + <span class="site-footer-owner"><a href="https://github.com/javaparser/javaparser">JavaParser</a> is maintained by <a href="https://github.com/javaparser">javaparser</a>.</span> |
| 155 | + |
| 156 | + <span class="site-footer-credits">This page was generated by <a href="https://pages.github.com">GitHub Pages</a> using the <a href="https://github.com/jasonlong/cayman-theme">Cayman theme</a> by <a href="https://twitter.com/jasonlong">Jason Long</a>.</span> |
| 157 | + </footer> |
| 158 | + |
| 159 | + </section> |
| 160 | + |
| 161 | + <script type="text/javascript"> |
| 162 | + var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); |
| 163 | + document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); |
| 164 | + </script> |
| 165 | + <script type="text/javascript"> |
| 166 | + try { |
| 167 | + var pageTracker = _gat._getTracker("UA-41747754-5"); |
| 168 | + pageTracker._trackPageview(); |
| 169 | + } catch(err) {} |
| 170 | + </script> |
| 171 | + |
| 172 | + </body> |
| 173 | +</html> |
0 commit comments