japa.parser

## Class JavaParser

- java.lang.Object
- - japa.parser.JavaParser

    public final class JavaParser
    extends Object

This class was generated automatically by javacc, do not edit.

Parse Java 1.5 source code and creates Abstract Syntax Tree classes.

Note: To use this parser asynchronously, disable de parser cache by calling the method `setCacheParser` with `false` as argument.

### Method Summary

Methods
`static CompilationUnit` `parse(File file)` Parses the Java code contained in a `File` and returns a `CompilationUnit` that represents it.
`static CompilationUnit` `parse(File file, String encoding)` Parses the Java code contained in a `File` and returns a `CompilationUnit` that represents it.
`static CompilationUnit` `parse(InputStream in)` Parses the Java code contained in the `InputStream` and returns a `CompilationUnit` that represents it.
`static CompilationUnit` `parse(InputStream in, String encoding)` Parses the Java code contained in the `InputStream` and returns a `CompilationUnit` that represents it.
`static void` `setCacheParser(boolean value)` Changes the way that the parser acts when starts to parse.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### setCacheParser

    public static void setCacheParser(boolean value)

Changes the way that the parser acts when starts to parse. If the parser cache is enabled, only one insance of this object will be used in every call to parse methods. If this parser is intend to be used asynchonously, the cache must be disabled setting this flag to `false`. By default, the cache is enabled.

Parameters:
  `value` - `false` to disable the parser instance cache.

#### parse

    public static CompilationUnit parse(InputStream in,
                        String encoding)
                                 throws ParseException

Parses the Java code contained in the `InputStream` and returns a `CompilationUnit` that represents it.

Parameters:
  `in` - `InputStream` containing Java source code
  `encoding` - encoding of the source code
Returns:
  CompilationUnit representing the Java source code
Throws:
  `ParseException` - if the source code has parser errors

#### parse

    public static CompilationUnit parse(InputStream in)
                                 throws ParseException

Parses the Java code contained in the `InputStream` and returns a `CompilationUnit` that represents it.

Parameters:
  `in` - `InputStream` containing Java source code
Returns:
  CompilationUnit representing the Java source code
Throws:
  `ParseException` - if the source code has parser errors

#### parse

    public static CompilationUnit parse(File file,
                        String encoding)
                                 throws ParseException,
                                        IOException

Parses the Java code contained in a `File` and returns a `CompilationUnit` that represents it.

Parameters:
  `file` - `File` containing Java source code
  `encoding` - encoding of the source code
Returns:
  CompilationUnit representing the Java source code
Throws:
  `ParseException` - if the source code has parser errors
  `IOException`

#### parse

    public static CompilationUnit parse(File file)
                                 throws ParseException,
                                        IOException

Parses the Java code contained in a `File` and returns a `CompilationUnit` that represents it.

Parameters:
  `file` - `File` containing Java source code
Returns:
  CompilationUnit representing the Java source code
Throws:
  `ParseException` - if the source code has parser errors
  `IOException`