You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
some code blocks were missing the code styling, and in all code blocks I've added the java syntax highlighting (not sure how this will look once it passes through jekyll pre-processing steps to become html, but it looks fine in the preview)
* The quick API consists of all the static methods on the `StaticJavaParser` class.
23
25
* All these methods throw an unchecked `ParseProblemException` if anything goes wrong. This exception contains a list of the problem(s) encountered.
24
26
* The static methods called `parse` and `parseResource` offer various ways of reading Java code for parsing. They all expect a full Java file. So, even though the example parses a `String`, you could pass an `InputStream`, a `File` or various other inputs.
25
27
* The remaining static methods parse a fragment of source code in a `String`. Here is one that parses just an expression:
26
-
28
+
```java
27
29
Expression e = parseExpression("1+1");
30
+
```
28
31
29
32
* `parseJavadoc` is a special case. Comments normally remaing unparsed, including Javadoc comments. This method is a separate parser for a `JavadocComment` node.
30
33
*Changing configuration is done by modifying the `staticConfiguration` field.
* The full API consists of the `JavaParser` constructors, and the whole suite of parse methods, with one extra - the one that does the actual parsing work.
57
65
*_Never_ does it throw an exception. `ParseResult` can tell you if parsing went fine, and if not what problems were encountered.
@@ -63,7 +71,7 @@ or, thanks to the fake builder pattern:
63
71
* Parsing Javadoc is an exception again. You need the `JavadocParser` for that.
0 commit comments