Example usage of the ExceptionMessagesDoclet from ANT

<target name="exception" depends="compile" 
    description="Collect all exception message texts in the fb6 software into one file"
>
    
    <property name="ExceptionResourcesFile" 
        value="${CLASS_DESTINATION}/ExceptionResources.properties"
    />
    <echo file="${ExceptionResourcesFile}" append="false">
    #Generated by ANT-Target _resources. Do not edit.
multex.MsgText.causeMarker = Ursache: 
    #From here are following the message texts for the exceptions in the software system.
    #They are all collected from the main Javadoc texts of each exception declaration.
</echo>
    <javadoc
        access="private"
        classpathref="compile.classpath"
        doclet="multex.tool.ExceptionMessagesDoclet"
        docletpathref="compile.classpath"
        source="1.6"
        useexternalfile="yes"
        encoding="ISO-8859-1"
    >
        <arg value="-out"/> 
        <!--Message texts will be appended to this file.-->
        <arg file="${ExceptionResourcesFile}"/>
        
        <!--All exceptions in all Java files in this directory will be processed.-->
        <fileset dir="java"/>
    </javadoc>
</target>

The former example works as follows. The echo element creates a file ExceptionResources.properties with a string resource for the key multex.MsgText.causeMarker. This defines the german translation for the default cause marker CAUSE:. Then the multex.tool.ExceptionMessagesDoclet appends all exception message text patterns for all exceptions declared in all Java files in the directory java to the .properties file. The given encoding is used to interpret the Java source files. For writing to the -out file always encoding ISO-8859-1 is used, as .properties files must use it.