Skip to content
Browse files

Fixed javadoc problems, and added a javadoc target to the build script.

  • Loading branch information...
1 parent 527b992 commit 8534a8e0a552f21ad6479e94fad8db36e67d44d5 Reinier Zwitserloot committed Jul 6, 2009
View
10 build.xml
@@ -105,6 +105,16 @@
<echo level="info">Lombok version: ${lombok.version}</echo>
</target>
+ <target name="javadoc">
+ <delete dir="doc/api" quiet="true" />
+ <mkdir dir="doc/api" />
+ <javadoc sourcepath="src" defaultexcludes="yes" destdir="doc/api" windowtitle="Lombok">
+ <classpath refid="lombok.deps.path" />
+ <classpath refid="lombok.libs.path" />
+ <bottom><![CDATA[<i>Copyright &#169; 2009 Reinier Zwitserloot and Roel Spilker. See LICENCE for more information.]]></bottom>
+ </javadoc>
+ </target>
+
<target name="dist" depends="clean, compile, getVersion, unpackLibs">
<mkdir dir="dist" />
<jar basedir="build/eclipse.agent" destfile="dist/lombok.eclipse.agent-${lombok.version}.jar">
View
2 doc/.gitignore
@@ -0,0 +1,2 @@
+api
+
View
12 src/lombok/Cleanup.java
@@ -30,12 +30,12 @@
* Ensures the variable declaration that you annotate will be cleaned up by calling its close method, regardless
* of what happens. Implemented by wrapping all statements following the local variable declaration to the
* end of your scope into a try block that, as a finally action, closes the resource.
- *
+ * <p>
* Example:
* <pre>
* public void copyFile(String in, String out) throws IOException {
- * @Cleanup FileInputStream inStream = new FileInputStream(in);
- * @Cleamup FileOutputStream outStream = new FileOutputStream(out);
+ * &#64;Cleanup FileInputStream inStream = new FileInputStream(in);
+ * &#64;Cleanup FileOutputStream outStream = new FileOutputStream(out);
* byte[] b = new byte[65536];
* while (true) {
* int r = inStream.read(b);
@@ -48,9 +48,9 @@
* Will generate:
* <pre>
* public void copyFile(String in, String out) throws IOException {
- * @Cleanup FileInputStream inStream = new FileInputStream(in);
+ * &#64;Cleanup FileInputStream inStream = new FileInputStream(in);
* try {
- * @Cleamup FileOutputStream outStream = new FileOutputStream(out);
+ * &#64;Cleanup FileOutputStream outStream = new FileOutputStream(out);
* try {
* byte[] b = new byte[65536];
* while (true) {
@@ -71,7 +71,7 @@
* in the main body of the generated try block. You should NOT rely on this behaviour - future versions of
* lombok intend to silently swallow any exception thrown by the cleanup method <i>_IF</i> the main body
* throws an exception as well, as the earlier exception is usually far more useful.
- *
+ * <p>
* However, in java 1.6, generating the code to do this is prohibitively complicated.
*/
@Target(ElementType.LOCAL_VARIABLE)
View
4 src/lombok/Data.java
@@ -29,10 +29,10 @@
/**
* Generates getters for all fields, a useful toString method, and hashCode and equals implementations that check
* all non-transient fields. Will also generate setters for all non-final fields, as well as a constructor.
- *
+ * <p>
* If any method to be generated already exists (in name - the return type or parameters are not relevant), then
* that method will not be generated by the Data annotation.
- *
+ * <p>
* <code>toString</code>, <code>equals</code>, and <code>hashCode</code> use the deepX variants in the
* <code>java.util.Arrays</code> utility class. Therefore, if your class has arrays that contain themselves,
* these methods will just loop endlessly until the inevitable <code>StackOverflowError</code>. This behaviour
View
2 src/lombok/Getter.java
@@ -44,7 +44,7 @@
*
* Note that fields of type <code>boolean</code> (but not <code>java.lang.Boolean</code>) will result in an
* <code>isFoo</code> name instead of <code>getFoo</code>.
- *
+ * <p>
* If any method named <code>getFoo</code>/<code>isFoo</code> exists, regardless of return type or parameters, no method is generated,
* and instead a compiler warning is emitted.
*/
View
8 src/lombok/Lombok.java
@@ -28,17 +28,17 @@
/**
* Throws any throwable 'sneakily' - you don't need to catch it, nor declare that you throw it onwards.
* The exception is still thrown - javac will just stop whining about it.
- *
+ * <p>
* Example usage:
- *
+ * <p>
* <pre>public void run() {
* throw sneakyThrow(new IOException("You don't need to catch me!"));
* }</pre>
- *
+ * <p>
* NB: The exception is not wrapped, ignored, swallowed, or redefined. The JVM actually does not know or care
* about the concept of a 'checked exception'. All this method does is hide the act of throwing a checked exception
* from the java compiler.
- *
+ * <p>
* Note that this method has a return type of <code>RuntimeException</code> it is advised you always call this
* method as argument to the <code>throw</code> statement to avoid compiler errors regarding no return
* statement and similar problems. This method won't of course return an actual <code>RuntimeException</code> -
View
2 src/lombok/Setter.java
@@ -28,7 +28,7 @@
/**
* Put on any field to make lombok build a standard setter.
- *
+ * <p>
* Example:
* <pre>
* private @Setter int foo;
View
22 src/lombok/SneakyThrows.java
@@ -27,13 +27,13 @@
import java.lang.annotation.Target;
/**
- * Sneaky throw will avoid javac's insistence that you either catch or throw onward any checked exceptions that
+ * &#64;SneakyThrow will avoid javac's insistence that you either catch or throw onward any checked exceptions that
* statements in your method body declare they generate.
- *
- * Sneaky throw does not silently swallow, wrap into RuntimeException, or otherwise modify any exceptions of the listed
+ * <p>
+ * &#64;SneakyThrow does not silently swallow, wrap into RuntimeException, or otherwise modify any exceptions of the listed
* checked exception types. The JVM does not check for the consistency of the checked exception system; javac does,
* and this annotation lets you opt out of its mechanism.
- *
+ * <p>
* You should use this annotation ONLY in the following two cases:<ol>
* <li>You are certain the listed exception can't actually ever happen, or only in vanishingly rare situations.
* You don't try to catch OutOfMemoryError on every statement either. Examples:<br>
@@ -42,23 +42,23 @@
* <li>You know for certain the caller can handle the exception (for example, because the caller is
* an app manager that will handle all throwables that fall out of your method the same way), but due
* to interface restrictions you can't just add these exceptions to your 'throws' clause.
- *
+ * <p>
* Note that, as SneakyThrow is an implementation detail and <i>NOT</i> part of your method signature, it is
* a compile time error if none of the statements in your method body can throw a listed exception.
- *
+ * <p>
* <b><i>WARNING: </b></i>You must have lombok.jar available at the runtime of your app if you use SneakyThrows,
- * because your code is rewritten to use {@link Lombok.sneakyThrow(Throwable)}.
- *
- *
+ * because your code is rewritten to use {@link Lombok#sneakyThrow(Throwable)}.
+ * <p>
+ * <p>
* Example:
* <pre>
- * @SneakyThrows(UnsupportedEncodingException.class)
+ * &#64;SneakyThrows(UnsupportedEncodingException.class)
* public void utf8ToString(byte[] bytes) {
* return new String(bytes, "UTF-8");
* }
* </pre>
*
- * @see Lombok.sneakyThrow(Throwable)
+ * @see Lombok#sneakyThrow(Throwable)
*/
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR})
@Retention(RetentionPolicy.SOURCE)
View
2 src/lombok/Synchronized.java
@@ -30,7 +30,7 @@
* Almost exactly like putting the 'synchronized' keyword on a method, except will synchronize on a private internal
* Object, so that other code not under your control doesn't meddle with your thread management by locking on
* your own instance.
- *
+ * <p>
* For non-static methods, a field named <code>$lock</code> is used, and for static methods,
* <code>$LOCK</code> is used. These will be generated if needed and if they aren't already present. The contents
* of the fields will be serializable.
View
4 src/lombok/core/AST.java
@@ -205,9 +205,9 @@ public String getPackageDeclaration() {
protected abstract boolean calculateIsStructurallySignificant();
/**
- * Convenient shortcut to the owning JavacAST object's getNodeFor method.
+ * Convenient shortcut to the owning JavacAST object's get method.
*
- * @see AST#getNodeFor()
+ * @see AST#get(Object)
*/
public Node getNodeFor(N obj) {
return AST.this.get(obj);
View
4 src/lombok/core/AnnotationValues.java
@@ -287,7 +287,7 @@ private Object guessToType(Object guess, Class<?> expected, AnnotationValue v, i
}
/**
- * Convenience method to return the first result in a {@link getRawExpressions(String)} call.
+ * Convenience method to return the first result in a {@link #getRawExpressions(String)} call.
*
* You should use this method if the annotation method is not an array type.
*/
@@ -311,7 +311,7 @@ public String getRawExpression(String annotationMethodName) {
}
/**
- * Convenience method to return the first result in a {@link getProbableFQType(String)} call.
+ * Convenience method to return the first result in a {@link #getProbableFQType(String)} call.
*
* You should use this method if the annotation method is not an array type.
*/
View
2 src/lombok/eclipse/EclipseAST.java
@@ -355,7 +355,7 @@ public Node directUp() {
/**
* Convenient shortcut to the owning EclipseAST object's isCompleteParse method.
*
- * @see JavacAST#isCompleteParse()
+ * @see EclipseAST#isCompleteParse()
*/
public boolean isCompleteParse() {
return completeParse;
View
2 src/lombok/eclipse/EclipseASTVisitor.java
@@ -124,7 +124,7 @@ public Printer(boolean printContent) {
/**
* @param printContent if true, method and initializer bodies are printed directly, as java code,
* instead of a tree listing of every AST node inside it.
- * @param PrintStream write output to this stream. You must close it yourself. flush() is called after every line.
+ * @param out write output to this stream. You must close it yourself. flush() is called after every line.
*
* @see java.io.PrintStream#flush()
*/
View
10 src/lombok/eclipse/HandlerLibrary.java
@@ -146,11 +146,11 @@ private static void loadVisitorHandlers(HandlerLibrary lib) {
*
* The HandlerLibrary will attempt to guess if the given annotation node represents a lombok annotation.
* For example, if <code>lombok.*</code> is in the import list, then this method will guess that
- * <code>Getter</code> refers to <code>lombok.Getter</code>, presuming that {@link lombok.javac.handlers.HandleGetter}
+ * <code>Getter</code> refers to <code>lombok.Getter</code>, presuming that {@link lombok.eclipse.handlers.HandleGetter}
* has been loaded.
*
- * @param unit The Compilation Unit that contains the Annotation AST Node.
- * @param node The Lombok AST Node representing the Annotation AST Node.
+ * @param ast The Compilation Unit that contains the Annotation AST Node.
+ * @param annotationNode The Lombok AST Node representing the Annotation AST Node.
* @param annotation 'node.get()' - convenience parameter.
*/
public boolean handle(CompilationUnitDeclaration ast, EclipseAST.Node annotationNode,
@@ -198,13 +198,13 @@ public void callASTVisitors(EclipseAST ast) {
* random right now. This lack of order is particularly annoying for the <code>PrintAST</code> annotation,
* which is almost always intended to run last. Hence, this hack, which lets it in fact run last.
*
- * {@see #skipAllButPrintAST}
+ * @see #skipAllButPrintAST()
*/
public void skipPrintAST() {
skipPrintAST = true;
}
- /** {@see #skipPrintAST} */
+ /** @see #skipPrintAST() */
public void skipAllButPrintAST() {
skipPrintAST = false;
}
View
2 src/lombok/installer/Installer.java
@@ -136,7 +136,7 @@ private static void printHeadlessInfo() {
/**
* Creates a new installer that starts out invisible.
- * Call the {@see #show()} method on a freshly created installer to render it.
+ * Call the {@link #show()} method on a freshly created installer to render it.
*/
public Installer() {
appWindow = new JFrame(String.format("Project Lombok v%s - Installer", Version.getVersion()));
View
6 src/lombok/javac/HandlerLibrary.java
@@ -151,7 +151,7 @@ public void javacError(String message, Throwable t) {
/**
* Handles the provided annotation node by first finding a qualifying instance of
* {@link JavacAnnotationHandler} and if one exists, calling it with a freshly cooked up
- * instance of {@link AnnotationValues}.
+ * instance of {@link lombok.core.AnnotationValues}.
*
* Note that depending on the printASTOnly flag, the {@link lombok.core.PrintAST} annotation
* will either be silently skipped, or everything that isn't <code>PrintAST</code> will be skipped.
@@ -203,13 +203,13 @@ public void callASTVisitors(JavacAST ast) {
* random right now. This lack of order is particularly annoying for the <code>PrintAST</code> annotation,
* which is almost always intended to run last. Hence, this hack, which lets it in fact run last.
*
- * {@see #skipAllButPrintAST}
+ * @see #skipAllButPrintAST()
*/
public void skipPrintAST() {
skipPrintAST = true;
}
- /** {@see #skipPrintAST} */
+ /** @see #skipPrintAST() */
public void skipAllButPrintAST() {
skipPrintAST = false;
}
View
2 src/lombok/javac/JavacASTVisitor.java
@@ -114,7 +114,7 @@ public Printer(boolean printContent) {
/**
* @param printContent if true, method and initializer bodies are printed directly, as java code,
* instead of a tree listing of every AST node inside it.
- * @param PrintStream write output to this stream. You must close it yourself. flush() is called after every line.
+ * @param out write output to this stream. You must close it yourself. flush() is called after every line.
*
* @see java.io.PrintStream#flush()
*/

0 comments on commit 8534a8e

Please sign in to comment.
Something went wrong with that request. Please try again.