|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.sql2java.UserCodeParser
public class UserCodeParser
Parses an existing source file for special sql2code comment blocks.
Stores the source code that it finds in between those blocks in a
hashtable. This allows CodeWriter classes to rewrite existing files
while preserving code written by the user.
Constructor Summary | |
---|---|
UserCodeParser(java.lang.String filename)
Constructs a new parser, and tells the parser to try to load the given filename. |
Method Summary | |
---|---|
java.lang.String |
getBlock(java.lang.String name)
Returns the comment+code block associated with this name. |
java.lang.String[] |
getBlockNames()
Returns an array of the block names parsed in the existing file. |
java.lang.String |
getFilename()
Returns the filename associated with this parser. |
boolean |
hasBlock(java.lang.String name)
Returns true if there is a block with the given name in the existing file that was parsed, otherwise returns false. |
boolean |
isNew()
Returns true if the file to parse did not exist. |
void |
parse(java.lang.String parsedFileName)
Parses the file passed in. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UserCodeParser(java.lang.String filename) throws java.lang.Exception
filename
- Full path to the existing file to parse.
java.lang.Exception
- if the existing file exists, but cannot be read,
or if there is an error while reading the fileMethod Detail |
---|
public java.lang.String getFilename()
public boolean isNew()
public void parse(java.lang.String parsedFileName) throws java.lang.Exception
java.lang.Exception
public boolean hasBlock(java.lang.String name)
name
- Name of the code block to check for.public java.lang.String getBlock(java.lang.String name)
name
- Name of the code block to return.public java.lang.String[] getBlockNames()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |