public class UserCodeParser extends Object
| Constructor and Description |
|---|
UserCodeParser(String filename)
Constructs a new parser, and tells the parser to try to load the
given filename.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getBlock(String name)
Returns the comment+code block associated with this name.
|
String[] |
getBlockNames()
Returns an array of the block names parsed in the existing file.
|
String |
getFilename()
Returns the filename associated with this parser.
|
boolean |
hasBlock(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(String filename)
Parses the file passed in.
|
public UserCodeParser(String filename) throws Exception
filename - Full path to the existing file to parse.Exception - if the existing file exists, but cannot be read,
or if there is an error while reading the filepublic String getFilename()
public boolean isNew()
public void parse(String filename) throws Exception
Exceptionpublic boolean hasBlock(String name)
name - Name of the code block to check for.public String getBlock(String name)
name - Name of the code block to return.public String[] getBlockNames()
Copyright © 2014. All Rights Reserved.