org.apache.ws.jaxme.js.util

Class JavaParser

public class JavaParser extends 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
JavaSourceFactorygetFactory()
Returns the factory.
StringgetPackageName()
Returns the package name.
static voidmain(String[] args)
For tests
Listparse(File pFile)

Parses the given file.

Listparse(Reader pReader)

Parses the input read from the given Reader pReader.

Listparse(TokenStream pStream)
Parses the given TokenStream pStream.
voidsetPackageName(String pPackageName)
Sets the package name.

Constructor Detail

JavaParser

public JavaParser(JavaSourceFactory pFactory)

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

Method Detail

getFactory

public JavaSourceFactory getFactory()
Returns the factory.

getPackageName

public String getPackageName()
Returns the package name.

main

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

parse

public List parse(File pFile)

Parses the given file.

Returns: List of classes, that have been read.

parse

public List parse(Reader pReader)

Parses the input read from the given Reader pReader.

Returns: List of classes, that have been read.

parse

public List parse(TokenStream pStream)
Parses the given TokenStream pStream.

Returns: List of classes, that have been read.

setPackageName

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