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 and Description |
---|
JavaParser(JavaSourceFactory pFactory)
Creates a new instance of
JavaParser ,
that will use the given JavaSourceFactory for
creating instances of JavaSource . |
Modifier and Type | Method and Description |
---|---|
JavaSourceFactory |
getFactory()
Returns the factory.
|
java.lang.String |
getPackageName()
Returns the package name.
|
static void |
main(java.lang.String[] args)
For tests
|
java.util.List |
parse(java.io.File pFile)
Parses the given file.
|
java.util.List |
parse(java.io.Reader pReader)
Parses the input read from the given
Reader pReader . |
java.util.List |
parse(antlr.TokenStream pStream)
Parses the given
TokenStream pStream . |
void |
setPackageName(java.lang.String pPackageName)
Sets the package name.
|
public JavaParser(JavaSourceFactory pFactory)
Creates a new instance of JavaParser
,
that will use the given JavaSourceFactory
for
creating instances of JavaSource
.
public JavaSourceFactory getFactory()
public java.lang.String getPackageName()
public void setPackageName(java.lang.String pPackageName)
public java.util.List parse(java.io.File pFile) throws antlr.RecognitionException, antlr.TokenStreamException, java.io.FileNotFoundException
Parses the given file.
antlr.RecognitionException
antlr.TokenStreamException
java.io.FileNotFoundException
public java.util.List parse(java.io.Reader pReader) throws antlr.RecognitionException, antlr.TokenStreamException
Parses the input read from the given
Reader
pReader
.
antlr.RecognitionException
antlr.TokenStreamException
public java.util.List parse(antlr.TokenStream pStream) throws antlr.RecognitionException, antlr.TokenStreamException
TokenStream
pStream
.antlr.RecognitionException
antlr.TokenStreamException
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception