<commit_before><?xml version="1.0" ?>
<notes>
UMLGraph's input follows the Java syntax and semantics.
However,
since the main purpose of UMLGraph is the declarative specification of
UML diagrams there is no need to flesh-out each class's methods,
to completely specify each class, or to specify package information.
You only specify the details you want to appear on the graph.
If you wish your (Java) implementation to evolve together with the
design feel free to include code or additional details.
You can hide these details from the UML diagram using the <em>javadoc</em>
<code>@hidden</code> tag applied to classes, methods, and fields.
In theory you can also use UMLGraph to reverse engineer existing
Java code.
Note however that UMLGraph was not originally designed for this purpose;
the resulting graphs may be large and unwieldy.
<p />
There are various ways to invoke UMLGraph,
each providing a different balance between convenience and flexibility.
<h2>Option 1: Using the Supplied Script</h2>
This is the simplest option.
If <code>umlgraph</code> (or <code>umlgraph.bat</code>) is correctly
installed,
you can run UMLGraph by simply specifying the basename of
the Java file containing the diagram specification and the file type of
the generated diagram (e.g. gif, ps, png, svg).
Example:
<fmtcode ext="sh">
umlgraph Test png
</fmtcode>
Any additional UMLGraph or <em>javadoc</em> arguments can be added at
the end of the command line.
This command will read the specification file (e.g. Test.java) and
generate directly a diagram of the appropriate type
(e.g. Test.png).
<h2>Option 2: Running Java</h2>
This option provides the maximum flexibility.
In order to run, <em>javadoc</em> needs to access <code>tools.jar</code>.
You can accomplish this in two ways.
<ol>
<li>
Specify the location of <code>tools.jar</code> as a part of Java's classpath
and specify the full name of the UMLGraph doclet as an argument to Java.
This is an invocation example under Windows
<fmtcode ext="bat">
java -classpath "lib/UmlGraph.jar;c:\program files\java\jdk1.6.0_02\lib\Tools.jar"
    org.umlgraph.doclet.UmlGraph -package Test.java
</fmtcode>
and under Unix
<fmtcode ext="sh">
java -classpath '/usr/share/lib/UmlGraph.jar:/opt/Java-1.6/lib/tools.jar' \
org.umlgraph.doclet.UmlGraph -package Test.java
</fmtcode>
</li>
<li> Place the <code>UmlGraph.jar</code>
file in a directory that also contains the Java SDK <code>tools.jar</code> file.
You can accomplish this either by copying <code>UmlGraph.jar</code> to the SDK
<code>lib</code> directory where <code>tools.jar</code> resides,
or by copying the JDK <code>tools.jar</code> file into the directory
where you installed UMLGraph.
You then run
<fmtcode ext="sh">
java -jar /path/to/UmlGraph.jar yourfile1.java ...
</fmtcode>
</li>
</ol>
You can use any of the <em>javadoc</em> general options;
<code>-private</code> is usually needed to avoid having to explicitly
specify public elements.
Example:
<fmtcode ext="sh">
java -jar /usr/jvm/java-1.5.0/lib/UmlGraph.jar -private Simple.java
</fmtcode>
<p />
Specifying some packages before the list of source files will designate
those packages as <em>local</em>.
When you specify a package list,
the SVG output UMLgraph generates will contain
local hyperlinks for the local classes
and hyperlinks to the Sun Java API documentation for all other classes.
<p />

<h2>Option 3: Running Javadoc</h2>
Alternatively, you can also run <em>UMLGraph</em> from within <em>javadoc</em>.
This can be useful if your IDE provides additional support for running <em>javadoc</em>.
In this case you run
<em>javadoc</em> with arguments <code>-doclet org.umlgraph.doclet.UmlGraph</code>
<code>-docletpath /path/to/UmlGraph.jar</code>
and append at the end the file(s) that contain your diagram
specification.
Example:
<fmtcode ext="sh">
javadoc -docletpath UmlGraph.jar -doclet org.umlgraph.doclet.UmlGraph -private Simple.java
</fmtcode>

<h2>Running Dot</h2>
The last two options, will generate the UML diagram in
<em>Graphviz</em> <em>dot</em> format.<commit_msg>Document package diagram generation<commit_after><?xml version="1.0" ?>
<notes>
UMLGraph's input follows the Java syntax and semantics.
However,
since the main purpose of UMLGraph is the declarative specification of
UML diagrams there is no need to flesh-out each class's methods,
to completely specify each class, or to specify package information.
You only specify the details you want to appear on the graph.
If you wish your (Java) implementation to evolve together with the
design feel free to include code or additional details.
You can hide these details from the UML diagram using the <em>javadoc</em>
<code>@hidden</code> tag applied to classes, methods, and fields.
In theory you can also use UMLGraph to reverse engineer existing
Java code.
Note however that UMLGraph was not originally designed for this purpose;
the resulting graphs may be large and unwieldy.
<p />
There are various ways to invoke UMLGraph,
each providing a different balance between convenience and flexibility.
<h2>Option 1: Using the Supplied Script</h2>
This is the simplest option.
If <code>umlgraph</code> (or <code>umlgraph.bat</code>) is correctly
installed,
you can run UMLGraph by simply specifying the basename of
the Java file containing the diagram specification and the file type of
the generated diagram (e.g. gif, ps, png, svg).
Example:
<fmtcode ext="sh">
umlgraph Test png
</fmtcode>
Any additional UMLGraph or <em>javadoc</em> arguments can be added at
the end of the command line.
This command will read the specification file (e.g. Test.java) and
generate directly a diagram of the appropriate type
(e.g. Test.png).
<h2>Option 2: Running Java</h2>
This option provides the maximum flexibility.
In order to run, <em>javadoc</em> needs to access <code>tools.jar</code>.
You can accomplish this in two ways.
<ol>
<li>
Specify the location of <code>tools.jar</code> as a part of Java's classpath
and specify the full name of the UMLGraph doclet as an argument to Java.
This is an invocation example under Windows
<fmtcode ext="bat">
java -classpath "lib/UmlGraph.jar;c:\program files\java\jdk1.6.0_02\lib\Tools.jar"
    org.umlgraph.doclet.UmlGraph -package Test.java
</fmtcode>
and under Unix
<fmtcode ext="sh">
java -classpath '/usr/share/lib/UmlGraph.jar:/opt/Java-1.6/lib/tools.jar' \
org.umlgraph.doclet.UmlGraph -package Test.java
</fmtcode>
</li>
<li> Place the <code>UmlGraph.jar</code>
file in a directory that also contains the Java SDK <code>tools.jar</code> file.
You can accomplish this either by copying <code>UmlGraph.jar</code> to the SDK
<code>lib</code> directory where <code>tools.jar</code> resides,
or by copying the JDK <code>tools.jar</code> file into the directory
where you installed UMLGraph.
You then run
<fmtcode ext="sh">
java -jar /path/to/UmlGraph.jar yourfile1.java ...
</fmtcode>
</li>
</ol>
You can use any of the <em>javadoc</em> general options;
<code>-private</code> is usually needed to avoid having to explicitly
specify public elements.
Example:
<fmtcode ext="sh">
java -jar /usr/jvm/java-1.5.0/lib/UmlGraph.jar -private Simple.java
</fmtcode>
<p />
To generate a diagram of all classes in the package specify as arguments
to the Java invocation the name of the package and the directory where
it resides.
The following example generates a diagram of all UMLGraph classes.
<fmtcode ext="sh">
java -classpath ... org.umlgraph.doclet.UmlGraph -sourcepath src/main/java org.umlgraph.doclet
</fmtcode>
<p />
Specifying some packages before the list of source files will designate
those packages as <em>local</em>.
When you specify a package list,
the SVG output UMLgraph generates will contain
local hyperlinks for the local classes
and hyperlinks to the Sun Java API documentation for all other classes.
<p />

<h2>Option 3: Running Javadoc</h2>
Alternatively, you can also run <em>UMLGraph</em> from within <em>javadoc</em>.
This can be useful if your IDE provides additional support for running <em>javadoc</em>.
In this case you run
<em>javadoc</em> with arguments <code>-doclet org.umlgraph.doclet.UmlGraph</code>
<code>-docletpath /path/to/UmlGraph.jar</code>
and append at the end the file(s) that contain your diagram
specification.
Example:
<fmtcode ext="sh">
javadoc -docletpath UmlGraph.jar -doclet org.umlgraph.doclet.UmlGraph -private Simple.java
</fmtcode>

<h2>Running Dot</h2>
The last two options, will generate the UML diagram in
<em>Graphviz</em> <em>dot</em> format.
{'fraction_non_alphanumeric': 0.0955812854442344, 'fraction_numerical': 0.005671077504725898, 'mean_word_length': 4.758503401360544, 'pattern_counts': {'":': 0, '<': 168, '<?xml version=': 2, '>': 168, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7270783', 'n_tokens_mistral': 2632, 'n_tokens_neox': 2541, 'n_words': 1112}