pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1759347 - in /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form: PDField.java PDNonTerminalField.java PDTerminalField.java
Date Mon, 05 Sep 2016 19:34:32 GMT
Author: tilman
Date: Mon Sep  5 19:34:32 2016
New Revision: 1759347

URL: http://svn.apache.org/viewvc?rev=1759347&view=rev
Log:
PDFBOX-2852: clarify javadoc

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDField.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDNonTerminalField.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDTerminalField.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDField.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDField.java?rev=1759347&r1=1759346&r2=1759347&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDField.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDField.java
Mon Sep  5 19:34:32 2016
@@ -131,7 +131,10 @@ public abstract class PDField implements
      * For {@link PDNonTerminalField} the list will be empty as non terminal fields
      * have no visual representation in the form.
      * 
-     * @return a List of {@link PDAnnotationWidget} annotations.
+     * @return a List of {@link PDAnnotationWidget} annotations. Be aware that this list
is
+     * <i>not</i> backed by the actual widget collection of the field, so adding
or deleting has no
+     * effect on the PDF document until you call {@link #setWidgets(java.util.List) setWidgets()}
+     * with the modified list.
      */
     public abstract List<PDAnnotationWidget> getWidgets();
     

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDNonTerminalField.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDNonTerminalField.java?rev=1759347&r1=1759346&r2=1759347&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDNonTerminalField.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDNonTerminalField.java
Mon Sep  5 19:34:32 2016
@@ -122,11 +122,15 @@ public class PDNonTerminalField extends
     
     /**
      * Returns this field's children. These may be either terminal or non-terminal fields.
-     * 
-     * @return he list of child fields.
+     *
+     * @return the list of child fields. Be aware that this list is <i>not</i>
backed by the
+     * children of the field, so adding or deleting has no effect on the PDF document until
you call
+     * {@link #setChildren(java.util.List) setChildren()} with the modified list.
      */
     public List<PDField> getChildren()
     {
+        //TODO: why not return a COSArrayList like in PDPage.getAnnotations() ?
+ 
         List<PDField> children = new ArrayList<PDField>();
         COSArray kids = (COSArray)getCOSObject().getDictionaryObject(COSName.KIDS);
         for (int i = 0; i < kids.size(); i++)
@@ -193,6 +197,8 @@ public class PDNonTerminalField extends
      *
      * <p><b>Note:</b> while non-terminal fields <b>do</b>
inherit field values, this method returns
      * the local value, without inheritance.
+     * @param object
+     * @throws java.io.IOException
      */
     public void setValue(COSBase object) throws IOException
     {
@@ -207,6 +213,7 @@ public class PDNonTerminalField extends
      * @param value Plain text
      * @throws IOException if the value could not be set
      */
+    @Override
     public void setValue(String value) throws IOException
     {
         getCOSObject().setString(COSName.V, value);
@@ -232,6 +239,7 @@ public class PDNonTerminalField extends
      *
      * <p><b>Note:</b> while non-terminal fields <b>do</b>
inherit field values, this method returns
      * the local value, without inheritance.
+     * @param value
      */
     public void setDefaultValue(COSBase value)
     {
@@ -241,6 +249,7 @@ public class PDNonTerminalField extends
     @Override
     public List<PDAnnotationWidget> getWidgets()
     {
+        //TODO shouldn't we return a non modifiable list?
         return Collections.emptyList();
     }
 }

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDTerminalField.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDTerminalField.java?rev=1759347&r1=1759346&r2=1759347&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDTerminalField.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDTerminalField.java
Mon Sep  5 19:34:32 2016
@@ -155,8 +155,11 @@ public abstract class PDTerminalField ex
 
     /**
      * Returns the widget annotations associated with this field.
-     * 
-     * @return The list of widget annotations.
+     *
+     * @return The list of widget annotations. Be aware that this list is <i>not</i>
backed by the
+     * actual widget collection of the field, so adding or deleting has no effect on the
PDF
+     * document until you call {@link #setWidgets(java.util.List) setWidgets()} with the
modified
+     * list.
      */
     @Override
     public List<PDAnnotationWidget> getWidgets()



Mime
View raw message