A tool for extracting and documenting information related to the site structure of a
Stripes application. SiteStructureTool is an AnnotationProcessor (and it's own
factory) for use with apt, the Annotation Processing Tool. It is capable of processing
several of the annotations used with Stripes to extract information about what bean is bound
to which URL, the set of events handled and the possible resolutions. This information can
then be printed to the screen, or output to a file in either text or xml format.
The SiteStructureTool can be run through the command line, though it is somewhat awkward with
a large number of files, or a large classpath - it's command line is extremely similar to javac.
A command line might look like this:
SiteStructureTool modifies its behaviour based on two options. (Custom options are always
passed to apt prefixed with -A). The first is stripes.output.file. This
names the file into which the output will be written. If this option is omitted then the output
is simply printed to the screen. The second option is stripes.output.format which
controls (not surprisingly) the output format. Valid values are 'text' and 'xml'. If this
value is omitted the default format is 'text' unless a filename is supplied which ends in
'.xml', in which case xml output will be produced.
The easiest way to run the SiteStructureTool is with ant. Unfortunately the latest release
of ant at the time of writing does not yet include an apt task. When it does, running apt
through ant should become much simpler. Until then, you can run apt using an ant target like
the example below:
A tool for extracting and documenting information related to the site structure of a Stripes application. SiteStructureTool is an AnnotationProcessor (and it's own factory) for use with apt, the Annotation Processing Tool. It is capable of processing several of the annotations used with Stripes to extract information about what bean is bound to which URL, the set of events handled and the possible resolutions. This information can then be printed to the screen, or output to a file in either text or xml format.
The SiteStructureTool can be run through the command line, though it is somewhat awkward with a large number of files, or a large classpath - it's command line is extremely similar to javac. A command line might look like this:
apt -classpath $CLASSPATH -nocompile \ -factory net.sourceforge.stripes.tools.SiteStructureTool \ -Astripes.output.file=sitemap.txt \ -Astripes.output.format=text \ src/net/sourceforge/stripes/examples/bugzooky/web/*.javaSiteStructureTool modifies its behaviour based on two options. (Custom options are always passed to apt prefixed with -A). The first is stripes.output.file. This names the file into which the output will be written. If this option is omitted then the output is simply printed to the screen. The second option is stripes.output.format which controls (not surprisingly) the output format. Valid values are 'text' and 'xml'. If this value is omitted the default format is 'text' unless a filename is supplied which ends in '.xml', in which case xml output will be produced.
The easiest way to run the SiteStructureTool is with ant. Unfortunately the latest release of ant at the time of writing does not yet include an apt task. When it does, running apt through ant should become much simpler. Until then, you can run apt using an ant target like the example below:
<target name="apt" depends="compile"> <pathconvert property="cp" refid="build.class.path"/> <path id="srcfiles"> <fileset dir="${src.dir}" includes="**/*.java"/> </path> <pathconvert property="srcfiles" refid="srcfiles" pathsep=" "/> <exec executable="apt"> <arg line="-classpath ${cp} -nocompile"/> <arg line="-factory net.sourceforge.stripes.tools.SiteStructureTool"/> <arg line="-Astripes.output.file=sitemap.xml"/> <arg line="${srcfiles}"/> </exec> </target>