HTML Generator Readme
---------------------
Program Name ... : Java HTML Generator
Current Version : 0.9
Date ........... : 01/06/2000
Author ......... : Cyrille Artho (cartho@mordor.ch)
What is this HTML Generator?
It is a very simple, yet incredibly versatile HTML generator package for Java. All the handling of the data structures is done in the java.util.LinkedList class; this package only adds some HTML-ish properties to that. For more information, go to
http://artho.com/webtools/java-html-gen/
How do I install it?
Simply untar the sources into /tmp. A new directory (java) is created. Inside, there is the directory of the package (java/html). You can move that directory so it is in your CLASSPATH. E. g. by typing
cp -r java/html $CLASSPATH
The example programs java/example.html and java/calendar.html are already compiled. You can remove those files later or keep them for reference.
Where is the documentation?
The documentation is not finished yet, but there is an example program (java/HtmlExample.java) which is well documented and shows the basics of the usage. The second example (java/HtmlCalendar.java) is more elaborate and shows some bells and whistles (such as adding options to a tag after instantiation).
Why should I use this generator package?
- It's generic: any HTML code is supported; the library takes care of correct nesting.
- It's versatile: You cannot only add instances of the Tag class to the content of a tag for nesting, but anything that supports a toString() method, so you can add strings directly, or any other extension you can think of.
- It's flexible: you can "fill in" HTML content, e. g. a table, and manipulate - even remove - content later. This is especially useful for more complicated pages (see the calendar example).
- It's easy to learn: all the method to manipulate the tags are from java.util.List. If you know the Java 2 containers or have a good reference, then it will be quite easy to manipulate the content inside the tags.
- It's practical: you do not need to generate a neat data structure for all the attributes of a tag (though you can if you like). A parser is built-in, so you can simply pass all tag options as a string, e. g.: Tag td = new Tag("td", "align=left width=42%").