japa.parser
Class Parser

java.lang.Object
  extended by japa.parser.Parser

public final class Parser
extends java.lang.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.

Author:
Julio Vilmar Gesser

Method Summary
static CompilationUnit parse(java.io.File file)
          Parses the Java code contained in a File and returns a CompilationUnit that represents it.
static CompilationUnit parse(java.io.File file, java.lang.String encoding)
          Parses the Java code contained in a File and returns a CompilationUnit that represents it.
static CompilationUnit parse(java.io.InputStream in)
          Parses the Java code contained in the InputStream and returns a CompilationUnit that represents it.
static CompilationUnit parse(java.io.InputStream in, java.lang.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(java.io.InputStream in,
                                    java.lang.String encoding)
                             throws japa.parser.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(java.io.InputStream in)
                             throws japa.parser.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(java.io.File file,
                                    java.lang.String encoding)
                             throws japa.parser.ParseException,
                                    java.io.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
java.io.IOException

parse

public static CompilationUnit parse(java.io.File file)
                             throws japa.parser.ParseException,
                                    java.io.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
java.io.IOException


Copyright © 2014 eXo Platform SAS. All Rights Reserved.