Class PageParser
java.lang.Object
fc.web.page.PageParser
Parses a page and writes out the corresponding java file to the specified output. The
parser and scanner is combined into one class here for simplicity (a seperate scanner is
overkill for a simple LL(1) grammar such as molly pages).
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic StringThe name ("buffersize") of the [page buffersize=....] directivestatic StringThe name ("encoding") of the [page encoding=....] directive.static StringThe name ("mimetype") of the[@ mimetype=....] directive.static StringThe name ("out") of the [page out=....] directivestatic StringA value ("outputstream") of the [page out=outputstream] directivestatic StringA value ("outputstream") of the [page out=stream] directivestatic StringA value ("writer") of the [page out=writer] directivestatic StringThe name of the ("remove-initial-whitespace") directivestatic StringThe name ("src-encoding") of the [page src-encoding=....] directive.static String -
Constructor Summary
ConstructorsConstructorDescriptionPageParser(File contextRoot, File input, File output, String classname) Creates a new page parser that will use the default log obtained byLog.getDefault()Creates a new page parser. -
Method Summary
-
Field Details
-
d_mimetype
The name ("mimetype") of the[@ mimetype=....] directive. The value of none or an empty string will turn off writing any mimetype entirely (the user can then write a mimetype via themethod manually).invalid reference
jakarta.servlet.ServletResponse.setContentTypeNote, from
invalid reference
ServletResponseNote that the character encoding cannot be communicated via HTTP headers if the servlet does not specify a content type; however, it is still used to encode text written via the servlet response's writer.
-
mimetype_none
-
d_encoding
The name ("encoding") of the [page encoding=....] directive. -
d_src_encoding
The name ("src-encoding") of the [page src-encoding=....] directive. -
d_buffersize
The name ("buffersize") of the [page buffersize=....] directive -
d_out
-
d_out_stream1
A value ("outputstream") of the [page out=outputstream] directive -
d_out_stream2
A value ("outputstream") of the [page out=stream] directive -
d_out_writer
A value ("writer") of the [page out=writer] directive -
d_remove_initial_whitespace
The name of the ("remove-initial-whitespace") directive
-
-
Constructor Details
-
PageParser
Creates a new page parser that will use the default log obtained byLog.getDefault()- Parameters:
contextRoot- absolute path to the webapp context root directoryinput- absolute path to the input page fileclassname- classname to give to the generated java class.input- absolute path to the output file (to be written to).- Throws:
IOException
-
PageParser
public PageParser(File contextRoot, File input, File output, String classname, Log log) throws IOException Creates a new page parser.- Parameters:
contextRoot- absolute path to the webapp context root directoryinput- absolute path to the input page fileoutput- absolute path to the output file (to be written to).classname- classname to give to the generated java class.- Throws:
IOException
-
-
Method Details
-
parse
Parses the page. If the parse is successful, the java source will be generated.- Throws:
IOException- a parse failure occurred. The java source file may or may not be properly generated or written in this case.
-
main
- Throws:
IOException
-