org.apache.ws.jaxme.js.util

Class JavaParser


public class JavaParser
extends java.lang.Object

The JavaParser is a utility class, that reads Java sources and converts them into instances of JavaSource.

Constructor Summary

JavaParser(JavaSourceFactory pFactory)
Creates a new instance of JavaParser, that will use the given JavaSourceFactory for creating instances of JavaSource.

Method Summary

JavaSourceFactory
getFactory()
Returns the factory.
String
getPackageName()
Returns the package name.
static void
main(String[] args)
For tests
List
parse(File pFile)
Parses the given file.
List
parse(Reader pReader)
Parses the input read from the given Reader pReader.
List
parse(TokenStream pStream)
Parses the given TokenStream pStream.
void
setPackageName(String pPackageName)
Sets the package name.

Constructor Details

JavaParser

public JavaParser(JavaSourceFactory pFactory)
Creates a new instance of JavaParser, that will use the given JavaSourceFactory for creating instances of JavaSource.

Method Details

getFactory

public JavaSourceFactory getFactory()
Returns the factory.

getPackageName

public String getPackageName()
Returns the package name.

main

public static void main(String[] args)
            throws Exception
For tests

parse

public List parse(File pFile)
            throws RecognitionException,
                   TokenStreamException,
                   FileNotFoundException
Parses the given file.
Returns:
List of classes, that have been read.

parse

public List parse(Reader pReader)
            throws RecognitionException,
                   TokenStreamException
Parses the input read from the given Reader pReader.
Returns:
List of classes, that have been read.

parse

public List parse(TokenStream pStream)
            throws RecognitionException,
                   TokenStreamException
Parses the given TokenStream pStream.
Returns:
List of classes, that have been read.

setPackageName

public void setPackageName(String pPackageName)
Sets the package name.