mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-15 02:17:12 +00:00
Fixed javadoc problems, and added a javadoc target to the build script.
This commit is contained in:
1 parent
527b992a07
commit
8534a8e0a5
17 files changed
+54
-42
No files matched your search
@@ -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 © 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">
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
api
|
||||
|
||||
@@ -30,12 +30,12 @@ import java.lang.annotation.Target;
|
||||
* 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);
|
||||
* @Cleanup FileInputStream inStream = new FileInputStream(in);
|
||||
* @Cleanup FileOutputStream outStream = new FileOutputStream(out);
|
||||
* byte[] b = new byte[65536];
|
||||
* while (true) {
|
||||
* int r = inStream.read(b);
|
||||
@@ -48,9 +48,9 @@ import java.lang.annotation.Target;
|
||||
* Will generate:
|
||||
* <pre>
|
||||
* public void copyFile(String in, String out) throws IOException {
|
||||
* @Cleanup FileInputStream inStream = new FileInputStream(in);
|
||||
* @Cleanup FileInputStream inStream = new FileInputStream(in);
|
||||
* try {
|
||||
* @Cleamup FileOutputStream outStream = new FileOutputStream(out);
|
||||
* @Cleanup FileOutputStream outStream = new FileOutputStream(out);
|
||||
* try {
|
||||
* byte[] b = new byte[65536];
|
||||
* while (true) {
|
||||
@@ -71,7 +71,7 @@ import java.lang.annotation.Target;
|
||||
* 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)
|
||||
|
||||
@@ -29,10 +29,10 @@ import java.lang.annotation.Target;
|
||||
/**
|
||||
* 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
|
||||
|
||||
@@ -44,7 +44,7 @@ import java.lang.annotation.Target;
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
@@ -28,17 +28,17 @@ public class Lombok {
|
||||
/**
|
||||
* 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> -
|
||||
|
||||
@@ -28,7 +28,7 @@ import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* Put on any field to make lombok build a standard setter.
|
||||
*
|
||||
* <p>
|
||||
* Example:
|
||||
* <pre>
|
||||
* private @Setter int foo;
|
||||
|
||||
@@ -27,13 +27,13 @@ import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* Sneaky throw will avoid javac's insistence that you either catch or throw onward any checked exceptions that
|
||||
* @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>
|
||||
* @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 @@ import java.lang.annotation.Target;
|
||||
* <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)
|
||||
* @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)
|
||||
|
||||
@@ -30,7 +30,7 @@ import java.lang.annotation.Target;
|
||||
* 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.
|
||||
|
||||
@@ -205,9 +205,9 @@ public abstract class AST<N> {
|
||||
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);
|
||||
|
||||
@@ -287,7 +287,7 @@ public class AnnotationValues<A extends Annotation> {
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 class AnnotationValues<A extends Annotation> {
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
||||
@@ -355,7 +355,7 @@ public class EclipseAST extends AST<ASTNode> {
|
||||
/**
|
||||
* Convenient shortcut to the owning EclipseAST object's isCompleteParse method.
|
||||
*
|
||||
* @see JavacAST#isCompleteParse()
|
||||
* @see EclipseAST#isCompleteParse()
|
||||
*/
|
||||
public boolean isCompleteParse() {
|
||||
return completeParse;
|
||||
|
||||
@@ -124,7 +124,7 @@ public interface EclipseASTVisitor {
|
||||
/**
|
||||
* @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()
|
||||
*/
|
||||
|
||||
@@ -146,11 +146,11 @@ public class HandlerLibrary {
|
||||
*
|
||||
* 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 class HandlerLibrary {
|
||||
* 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;
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ public class Installer {
|
||||
|
||||
/**
|
||||
* 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()));
|
||||
|
||||
@@ -151,7 +151,7 @@ public class HandlerLibrary {
|
||||
/**
|
||||
* 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 class HandlerLibrary {
|
||||
* 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;
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ public interface JavacASTVisitor {
|
||||
/**
|
||||
* @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()
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user