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 {@link org.apache.ws.jaxme.js.JavaSource}.

Constructor Summary
JavaParser(JavaSourceFactory pFactory)

Creates a new instance of JavaParser, that will use the given {@link JavaSourceFactory} for creating instances of {@link 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 {@link Reader} pReader.

Listparse(TokenStream pStream)
Parses the given {@link 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 {@link JavaSourceFactory} for creating instances of {@link 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 {@link Reader} pReader.

Returns: List of classes, that have been read.

parse

public List parse(TokenStream pStream)
Parses the given {@link TokenStream} pStream.

Returns: List of classes, that have been read.

setPackageName

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