You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ms...@apache.org on 2015/09/20 19:58:17 UTC
svn commit: r1704172 - in
/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form:
PDField.java PDFieldFactory.java
Author: msahyoun
Date: Sun Sep 20 17:58:12 2015
New Revision: 1704172
URL: http://svn.apache.org/viewvc?rev=1704172&view=rev
Log:
PDFBOX-2852: rearrange fields and constructors to comply with coding conventions
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/PDFieldFactory.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=1704172&r1=1704171&r2=1704172&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 Sun Sep 20 17:58:12 2015
@@ -33,24 +33,11 @@ public abstract class PDField implements
private static final int FLAG_READ_ONLY = 1;
private static final int FLAG_REQUIRED = 1 << 1;
private static final int FLAG_NO_EXPORT = 1 << 2;
-
- /**
- * Creates a COSField subclass from the given COS field. This is for reading fields from PDFs.
- *
- * @param form the form that the field is part of
- * @param field the dictionary representing a field element
- * @param parent the parent node of the node to be created, or null if root.
- * @return a new PDField instance
- */
- static PDField fromDictionary(PDAcroForm form, COSDictionary field, PDNonTerminalField parent)
- {
- return PDFieldFactory.createField(form, field, parent);
- }
private final PDAcroForm acroForm;
private final PDNonTerminalField parent;
private final COSDictionary dictionary;
-
+
/**
* Constructor.
*
@@ -75,6 +62,19 @@ public abstract class PDField implements
}
/**
+ * Creates a COSField subclass from the given COS field. This is for reading fields from PDFs.
+ *
+ * @param form the form that the field is part of
+ * @param field the dictionary representing a field element
+ * @param parent the parent node of the node to be created, or null if root.
+ * @return a new PDField instance
+ */
+ static PDField fromDictionary(PDAcroForm form, COSDictionary field, PDNonTerminalField parent)
+ {
+ return PDFieldFactory.createField(form, field, parent);
+ }
+
+ /**
* Returns the given attribute, inheriting from parent nodes if necessary.
*
* @param key the key to look up
Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDFieldFactory.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDFieldFactory.java?rev=1704172&r1=1704171&r2=1704172&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDFieldFactory.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDFieldFactory.java Sun Sep 20 17:58:12 2015
@@ -25,15 +25,16 @@ import org.apache.pdfbox.cos.COSName;
*/
final class PDFieldFactory
{
- private PDFieldFactory()
- {
- }
-
+
private static final String FIELD_TYPE_TEXT = "Tx";
private static final String FIELD_TYPE_BUTTON = "Btn";
private static final String FIELD_TYPE_CHOICE = "Ch";
private static final String FIELD_TYPE_SIGNATURE = "Sig";
-
+
+ private PDFieldFactory()
+ {
+ }
+
/**
* Creates a COSField subclass from the given field.
*