Java Reference
In-Depth Information
ByteArrayOutputStream buffer #
new ByteArrayOutputStream();
P.serialize( new PrintStream(buffer));
String[] expected # {
"<BODY","bgcolor # \"white\"",
"<H1>","This is a test","</H1>",
"This is plain text",
"<A HREF # \"\"", "Click here...",
"</A>", "</BODY>", "</HTML>"
protected void assertContainsInOrder(String output,
String[] strings){
int lastIndex # -1;
int currentIndex # -1;
output # output.toUpperCase();
for ( int i # 0; i < strings.length; i !! ) {
currentIndex # output.indexOf(strings[i].
toUpperCase(),lastIndex ! 1);
assertTrue("Couldn't find [" ! i ! "]:" ! strings[i]
lastIndex # currentIndex;
Prototype 2: Language front end
The analysis and design of the language front end component will be carried
out for the sample documentation case laid out in the specification section.
The front-end module has the purpose of parsing the source code of a Java
class and to generate the corresponding HTML documentation.
Looking at Figure 8.11, the parsing task consists of finding out the name
of the class and then, inside the class, identifying the declarations of the
public members. Since we are interested only in the signature of methods
and of variables, the parser must extract only a part of the members. In
particular, all the text following the “public” keyword and preceding either a
Search WWH ::

Custom Search