You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2016/01/12 23:37:52 UTC

svn commit: r1724331 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationLink.java

Author: tilman
Date: Tue Jan 12 22:37:52 2016
New Revision: 1724331

URL: http://svn.apache.org/viewvc?rev=1724331&view=rev
Log:
PDFBOX-3190: fix javadoc, simplify up code

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationLink.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationLink.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationLink.java?rev=1724331&r1=1724330&r2=1724331&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationLink.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationLink.java Tue Jan 12 22:37:52 2016
@@ -78,11 +78,10 @@ public class PDAnnotationLink extends PD
     }
 
     /**
-     * Get the action to be performed when this annotation is to be activated.
+     * Get the action to be performed when this annotation is to be activated. Either this or the
+     * destination entry should be set, but not both.
      *
      * @return The action to be performed when this annotation is activated.
-     *
-     * TODO not all annotations have an A entry
      */
     public PDAction getAction()
     {
@@ -91,9 +90,10 @@ public class PDAnnotationLink extends PD
     }
 
     /**
-     * Set the annotation action. As of PDF 1.6 this is only used for Widget Annotations
-     * 
-     * @param action The annotation action. TODO not all annotations have an A entry
+     * Set the annotation action. Either this or the destination entry should be set, but not both.
+     *
+     * @param action The annotation action.
+     *
      */
     public void setAction(PDAction action)
     {
@@ -103,8 +103,8 @@ public class PDAnnotationLink extends PD
     /**
      * This will set the border style dictionary, specifying the width and dash pattern used in drawing the line.
      *
-     * @param bs the border style dictionary to set. TODO not all annotations may have a BS entry
-     *
+     * @param bs the border style dictionary to set. 
+     * 
      */
     public void setBorderStyle(PDBorderStyleDictionary bs)
     {
@@ -112,7 +112,8 @@ public class PDAnnotationLink extends PD
     }
 
     /**
-     * This will retrieve the border style dictionary, specifying the width and dash pattern used in drawing the line.
+     * This will retrieve the border style dictionary, specifying the width and dash pattern used in
+     * drawing the line.
      *
      * @return the border style dictionary.
      */
@@ -123,15 +124,12 @@ public class PDAnnotationLink extends PD
         {
             return new PDBorderStyleDictionary((COSDictionary) bs);
         }
-        else
-        {
-            return null;
-        }
+        return null;
     }
 
     /**
-     * Get the destination to be displayed when the annotation is activated. Either this or the A should be set but not
-     * both.
+     * Get the destination to be displayed when the annotation is activated. Either this or the
+     * action entry should be set, but not both.
      *
      * @return The destination for this annotation.
      *
@@ -140,13 +138,11 @@ public class PDAnnotationLink extends PD
     public PDDestination getDestination() throws IOException
     {
         COSBase base = getCOSObject().getDictionaryObject(COSName.DEST);
-        PDDestination retval = PDDestination.create(base);
-
-        return retval;
+        return PDDestination.create(base);
     }
 
     /**
-     * The new destination value.
+     * The new destination value. Either this or the action entry should be set, but not both.
      *
      * @param dest The updated destination.
      */
@@ -197,10 +193,7 @@ public class PDAnnotationLink extends PD
         {
             return new PDActionURI(pa);
         }
-        else
-        {
-            return null;
-        }
+        return null;
     }
 
     /**
@@ -227,9 +220,7 @@ public class PDAnnotationLink extends PD
         {
             return quadPoints.toFloatArray();
         }
-        else
-        {
-            return null; // Should never happen as this is a required item
-        }
+        // Should never happen as this is a required item
+        return null; 
     }
 }