|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.objectwave.sourceParser.SourceCodeReader
Will parse Java 1.1 source code to turn it into our meta model. This, hopefully, correctly deals with comments and every possible legal class definition. Unfortunately this implementation is very specific to java source code. Most notably the 1.1 sources.
Nested Class Summary | |
static class |
SourceCodeReader.Test
Unit tests for SourceCodeReader |
Constructor Summary | |
SourceCodeReader(java.io.Reader rdr)
Provide the source at instantiantion time. |
Method Summary | |
java.io.BufferedReader |
getSource()
|
static void |
main(java.lang.String[] argv)
Test routine: Currently only verifies nextJavaIdentifier() method. |
static java.lang.StringBuffer |
nextBlockPair(java.lang.StringBuffer buf,
java.io.Reader rdr,
char openChar,
char closeChar)
|
static java.lang.StringBuffer |
nextBlockPairStarting(java.lang.StringBuffer buf,
java.io.Reader rdr,
char openChar,
char closeChar,
boolean start,
boolean checkComments)
Used to get 'blocks' of code. |
static java.lang.StringBuffer |
nextJavaIdentifier(java.lang.StringBuffer buf,
java.io.Reader rdr)
This will scan for the next valid java identifier. |
protected static void |
parseIt(java.lang.String[] files,
boolean verbose)
|
ClassElement[] |
parseSource()
Parse the source found in the instance variable 'theSource'. |
protected void |
parseSource(java.util.Vector elements)
The acutal work horse method for parseSource(); This will fill the parameter 'elements' with all of the found ClassElements. |
static ClassElement |
parseSourceFor(java.io.StringReader rdr,
ClassParser def)
Parse the paramter 'rdr' looking for a particular type of definition. |
void |
setSource(java.io.BufferedReader rdr)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SourceCodeReader(java.io.Reader rdr)
rdr
- Description of ParameterMethod Detail |
public void setSource(java.io.BufferedReader rdr)
rdr
- The new Source valuepublic java.io.BufferedReader getSource()
public ClassElement[] parseSource() throws java.io.IOException
java.io.IOException
- Description of Exceptionprotected void parseSource(java.util.Vector elements) throws java.io.IOException
elements
- Description of Parameter
java.io.IOException
- Description of ExceptionparseSource()
,
ClassElement
public static void main(java.lang.String[] argv)
argv
- The command line argumentspublic static java.lang.StringBuffer nextBlockPair(java.lang.StringBuffer buf, java.io.Reader rdr, char openChar, char closeChar) throws java.io.IOException
buf
- Description of Parameterrdr
- Description of ParameteropenChar
- Description of ParametercloseChar
- Description of Parameter
java.io.IOException
- Description of Exceptionpublic static java.lang.StringBuffer nextBlockPairStarting(java.lang.StringBuffer buf, java.io.Reader rdr, char openChar, char closeChar, boolean start, boolean checkComments) throws java.io.IOException
buf
- Description of Parameterrdr
- Description of ParameteropenChar
- Description of ParametercloseChar
- Description of Parameterstart
- Description of ParametercheckComments
- Description of Parameter
java.io.IOException
- Description of Exception#isMySpecialIdent
public static java.lang.StringBuffer nextJavaIdentifier(java.lang.StringBuffer buf, java.io.Reader rdr) throws java.io.IOException
buf
- Description of Parameterrdr
- Description of Parameter
java.io.IOException
- Description of Exceptionpublic static ClassElement parseSourceFor(java.io.StringReader rdr, ClassParser def)
rdr
- Description of Parameterdef
- Description of Parameter
protected static void parseIt(java.lang.String[] files, boolean verbose) throws java.io.IOException
files
- Description of Parameterverbose
- Description of Parameter
java.io.IOException
- Description of Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |