pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1821755 - in /pdfbox/trunk: pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/ preflight/src/main/java/org/apache/pdfbox/preflight/ preflight/src/main/java/org/apache/pdfbox/preflight/annotation/ preflight/src/...
Date Sat, 20 Jan 2018 15:54:44 GMT
Author: tilman
Date: Sat Jan 20 15:54:43 2018
New Revision: 1821755

URL: http://svn.apache.org/viewvc?rev=1821755&view=rev
Log:
PDFBOX-3353: Split highlight, underline, strikeout and squiggly from text markup annotation;
correct constant name; use correct type in freetext annotation validator; add //TODO about
calling COSStream() call; minor code cleanup

Added:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDHighlightAppearanceHandler.java
  (with props)
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDSquigglyAppearanceHandler.java
  (with props)
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDStrikeoutAppearanceHandler.java
  (with props)
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDUnderlineAppearanceHandler.java
  (with props)
    pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/HighlightAnnotationValidator.java
      - copied, changed from r1821699, pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/MarkupAnnotationValidator.java
    pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/SquigglyAnnotationValidator.java
      - copied, changed from r1821699, pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/MarkupAnnotationValidator.java
    pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/StrikeoutAnnotationValidator.java
      - copied, changed from r1821699, pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/MarkupAnnotationValidator.java
Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDAbstractAppearanceHandler.java
    pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/PreflightConstants.java
    pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/AnnotationValidator.java
    pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/FreeTextAnnotationValidator.java
    pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/MarkupAnnotationValidator.java
    pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/pdfa/PDFAbAnnotationFactory.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDAbstractAppearanceHandler.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDAbstractAppearanceHandler.java?rev=1821755&r1=1821754&r2=1821755&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDAbstractAppearanceHandler.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDAbstractAppearanceHandler.java
Sat Jan 20 15:54:43 2018
@@ -41,7 +41,7 @@ import org.apache.pdfbox.pdmodel.interac
  */
 public abstract class PDAbstractAppearanceHandler implements PDAppearanceHandler
 {
-    private PDAnnotation annotation;
+    private final PDAnnotation annotation;
     private PDAppearanceEntry appearanceEntry;
     private PDAppearanceContentStream contentStream;
     
@@ -50,10 +50,13 @@ public abstract class PDAbstractAppearan
         this.annotation = annotation;
     }
 
+    @Override
     public abstract void generateNormalAppearance();
 
+    @Override
     public abstract void generateRolloverAppearance();
 
+    @Override
     public abstract void generateDownAppearance();
 
     PDAnnotation getAnnotation()
@@ -124,6 +127,7 @@ public abstract class PDAbstractAppearan
 
         if (appearanceEntry.isSubDictionary())
         {
+            //TODO replace with "document.getDocument().createCOSStream()" 
             appearanceEntry = new PDAppearanceEntry(new COSStream());
             appearanceDictionary.setDownAppearance(appearanceEntry);
         }

Added: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDHighlightAppearanceHandler.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDHighlightAppearanceHandler.java?rev=1821755&view=auto
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDHighlightAppearanceHandler.java
(added)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDHighlightAppearanceHandler.java
Sat Jan 20 15:54:43 2018
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2018 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.pdfbox.pdmodel.interactive.annotation.handlers;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation;
+
+/**
+ *
+ */
+public class PDHighlightAppearanceHandler extends PDAbstractAppearanceHandler
+{
+    private static final Log LOG = LogFactory.getLog(PDHighlightAppearanceHandler.class);
+
+    public PDHighlightAppearanceHandler(PDAnnotation annotation)
+    {
+        super(annotation);
+    }
+
+    @Override
+    public void generateAppearanceStreams()
+    {
+        generateNormalAppearance();
+        generateRolloverAppearance();
+        generateDownAppearance();
+    }
+
+    @Override
+    public void generateNormalAppearance()
+    {
+        //TODO
+    }
+
+    @Override
+    public void generateRolloverAppearance()
+    {
+        // No rollover appearance generated
+    }
+
+    @Override
+    public void generateDownAppearance()
+    {
+        // No down appearance generated
+    }
+}

Propchange: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDHighlightAppearanceHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDSquigglyAppearanceHandler.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDSquigglyAppearanceHandler.java?rev=1821755&view=auto
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDSquigglyAppearanceHandler.java
(added)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDSquigglyAppearanceHandler.java
Sat Jan 20 15:54:43 2018
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2018 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.pdfbox.pdmodel.interactive.annotation.handlers;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation;
+
+/**
+ *
+ */
+public class PDSquigglyAppearanceHandler extends PDAbstractAppearanceHandler
+{
+    private static final Log LOG = LogFactory.getLog(PDSquigglyAppearanceHandler.class);
+
+    public PDSquigglyAppearanceHandler(PDAnnotation annotation)
+    {
+        super(annotation);
+    }
+
+    @Override
+    public void generateAppearanceStreams()
+    {
+        generateNormalAppearance();
+        generateRolloverAppearance();
+        generateDownAppearance();
+    }
+
+    @Override
+    public void generateNormalAppearance()
+    {
+        //TODO
+    }
+
+    @Override
+    public void generateRolloverAppearance()
+    {
+        // No rollover appearance generated
+    }
+
+    @Override
+    public void generateDownAppearance()
+    {
+        // No down appearance generated
+    }
+}

Propchange: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDSquigglyAppearanceHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDStrikeoutAppearanceHandler.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDStrikeoutAppearanceHandler.java?rev=1821755&view=auto
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDStrikeoutAppearanceHandler.java
(added)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDStrikeoutAppearanceHandler.java
Sat Jan 20 15:54:43 2018
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2018 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.pdfbox.pdmodel.interactive.annotation.handlers;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation;
+
+/**
+ *
+ */
+public class PDStrikeoutAppearanceHandler extends PDAbstractAppearanceHandler
+{
+    private static final Log LOG = LogFactory.getLog(PDStrikeoutAppearanceHandler.class);
+
+    public PDStrikeoutAppearanceHandler(PDAnnotation annotation)
+    {
+        super(annotation);
+    }
+
+    @Override
+    public void generateAppearanceStreams()
+    {
+        generateNormalAppearance();
+        generateRolloverAppearance();
+        generateDownAppearance();
+    }
+
+    @Override
+    public void generateNormalAppearance()
+    {
+        //TODO
+    }
+
+    @Override
+    public void generateRolloverAppearance()
+    {
+        // No rollover appearance generated
+    }
+
+    @Override
+    public void generateDownAppearance()
+    {
+        // No down appearance generated
+    }
+}

Propchange: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDStrikeoutAppearanceHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDUnderlineAppearanceHandler.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDUnderlineAppearanceHandler.java?rev=1821755&view=auto
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDUnderlineAppearanceHandler.java
(added)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDUnderlineAppearanceHandler.java
Sat Jan 20 15:54:43 2018
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2018 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.pdfbox.pdmodel.interactive.annotation.handlers;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotation;
+
+/**
+ *
+ */
+public class PDUnderlineAppearanceHandler extends PDAbstractAppearanceHandler
+{
+    private static final Log LOG = LogFactory.getLog(PDUnderlineAppearanceHandler.class);
+
+    public PDUnderlineAppearanceHandler(PDAnnotation annotation)
+    {
+        super(annotation);
+    }
+
+    @Override
+    public void generateAppearanceStreams()
+    {
+        generateNormalAppearance();
+        generateRolloverAppearance();
+        generateDownAppearance();
+    }
+
+    @Override
+    public void generateNormalAppearance()
+    {
+        //TODO
+    }
+
+    @Override
+    public void generateRolloverAppearance()
+    {
+        // No rollover appearance generated
+    }
+
+    @Override
+    public void generateDownAppearance()
+    {
+        // No down appearance generated
+    }
+}

Propchange: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/PDUnderlineAppearanceHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/PreflightConstants.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/PreflightConstants.java?rev=1821755&r1=1821754&r2=1821755&view=diff
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/PreflightConstants.java
(original)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/PreflightConstants.java
Sat Jan 20 15:54:43 2018
@@ -195,7 +195,7 @@ public interface PreflightConstants
     String ANNOT_DICTIONARY_VALUE_SUBTYPE_CIRCLE = "Circle";
     String ANNOT_DICTIONARY_VALUE_SUBTYPE_HIGHLIGHT = "Highlight";
     String ANNOT_DICTIONARY_VALUE_SUBTYPE_UNDERLINE = "Underline";
-    String ANNOT_DICTIONARY_VALUE_SUBTYPE_SQUILGGLY = "Squiggly";
+    String ANNOT_DICTIONARY_VALUE_SUBTYPE_SQUIGGLY = "Squiggly";
     String ANNOT_DICTIONARY_VALUE_SUBTYPE_STRIKEOUT = "StrikeOut";
     String ANNOT_DICTIONARY_VALUE_SUBTYPE_STAMP = "Stamp";
     String ANNOT_DICTIONARY_VALUE_SUBTYPE_INK = "Ink";

Modified: pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/AnnotationValidator.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/AnnotationValidator.java?rev=1821755&r1=1821754&r2=1821755&view=diff
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/AnnotationValidator.java
(original)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/AnnotationValidator.java
Sat Jan 20 15:54:43 2018
@@ -65,7 +65,6 @@ public abstract class AnnotationValidato
 
     public AnnotationValidator(PreflightContext context, COSDictionary annotDictionary)
     {
-        super();
         this.ctx = context;
         this.annotDictionary = annotDictionary;
         this.cosDocument = this.ctx.getDocument().getDocument();

Modified: pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/FreeTextAnnotationValidator.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/FreeTextAnnotationValidator.java?rev=1821755&r1=1821754&r2=1821755&view=diff
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/FreeTextAnnotationValidator.java
(original)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/FreeTextAnnotationValidator.java
Sat Jan 20 15:54:43 2018
@@ -23,7 +23,7 @@ package org.apache.pdfbox.preflight.anno
 
 import org.apache.pdfbox.cos.COSDictionary;
 import org.apache.pdfbox.cos.COSName;
-import org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationTextMarkup;
+import org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationMarkup;
 import org.apache.pdfbox.preflight.PreflightContext;
 
 /**
@@ -34,12 +34,12 @@ public class FreeTextAnnotationValidator
     /**
      * PDFBox object which wraps the Annotation dictionary
      */
-    protected PDAnnotationTextMarkup pdFreeText = null;
+    protected PDAnnotationMarkup pdFreeText = null;
 
     public FreeTextAnnotationValidator(PreflightContext ctx, COSDictionary annotDictionary)
     {
         super(ctx, annotDictionary);
-        this.pdFreeText = new PDAnnotationTextMarkup(annotDictionary);
+        this.pdFreeText = new PDAnnotationMarkup(annotDictionary);
         this.pdAnnot = this.pdFreeText;
     }
 

Copied: pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/HighlightAnnotationValidator.java
(from r1821699, pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/MarkupAnnotationValidator.java)
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/HighlightAnnotationValidator.java?p2=pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/HighlightAnnotationValidator.java&p1=pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/MarkupAnnotationValidator.java&r1=1821699&r2=1821755&rev=1821755&view=diff
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/MarkupAnnotationValidator.java
(original)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/HighlightAnnotationValidator.java
Sat Jan 20 15:54:43 2018
@@ -1,5 +1,5 @@
-/*****************************************************************************
- * 
+/** ***************************************************************************
+ *
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
@@ -7,47 +7,32 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- * 
- ****************************************************************************/
-
+ *
+ *************************************************************************** */
 package org.apache.pdfbox.preflight.annotation;
 
-import static org.apache.pdfbox.preflight.PreflightConstants.ANNOT_DICTIONARY_KEY_QUADPOINTS;
-
 import org.apache.pdfbox.cos.COSDictionary;
-import org.apache.pdfbox.cos.COSName;
-import org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationTextMarkup;
+import org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationHighlight;
 import org.apache.pdfbox.preflight.PreflightContext;
 
 /**
- * Validation class for the MarkupAnnotation
+ * Validation class for the Highlight Annotation
  */
-public class MarkupAnnotationValidator extends AnnotationValidator
+public class HighlightAnnotationValidator extends MarkupAnnotationValidator
 {
-    /**
-     * PDFBox object which wraps the annotation dictionary
-     */
-    protected PDAnnotationTextMarkup pdMarkup = null;
-
-    public MarkupAnnotationValidator(PreflightContext ctx, COSDictionary annotDictionary)
+    protected HighlightAnnotationValidator(PreflightContext ctx, COSDictionary annotDictionary)
     {
         super(ctx, annotDictionary);
-        this.pdMarkup = new PDAnnotationTextMarkup(annotDictionary);
+        this.pdMarkup = new PDAnnotationHighlight(annotDictionary);
         this.pdAnnot = this.pdMarkup;
     }
-
-    @Override
-    protected boolean checkSpecificMandatoryFields()
-    {
-        return this.annotDictionary.containsKey(COSName.getPDFName(ANNOT_DICTIONARY_KEY_QUADPOINTS));
-    }
 }

Modified: pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/MarkupAnnotationValidator.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/MarkupAnnotationValidator.java?rev=1821755&r1=1821754&r2=1821755&view=diff
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/MarkupAnnotationValidator.java
(original)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/MarkupAnnotationValidator.java
Sat Jan 20 15:54:43 2018
@@ -31,18 +31,16 @@ import org.apache.pdfbox.preflight.Prefl
 /**
  * Validation class for the MarkupAnnotation
  */
-public class MarkupAnnotationValidator extends AnnotationValidator
+abstract class MarkupAnnotationValidator extends AnnotationValidator
 {
     /**
      * PDFBox object which wraps the annotation dictionary
      */
     protected PDAnnotationTextMarkup pdMarkup = null;
 
-    public MarkupAnnotationValidator(PreflightContext ctx, COSDictionary annotDictionary)
+    protected MarkupAnnotationValidator(PreflightContext ctx, COSDictionary annotDictionary)
     {
         super(ctx, annotDictionary);
-        this.pdMarkup = new PDAnnotationTextMarkup(annotDictionary);
-        this.pdAnnot = this.pdMarkup;
     }
 
     @Override

Copied: pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/SquigglyAnnotationValidator.java
(from r1821699, pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/MarkupAnnotationValidator.java)
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/SquigglyAnnotationValidator.java?p2=pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/SquigglyAnnotationValidator.java&p1=pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/MarkupAnnotationValidator.java&r1=1821699&r2=1821755&rev=1821755&view=diff
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/MarkupAnnotationValidator.java
(original)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/SquigglyAnnotationValidator.java
Sat Jan 20 15:54:43 2018
@@ -1,5 +1,5 @@
-/*****************************************************************************
- * 
+/** ***************************************************************************
+ *
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
@@ -7,47 +7,32 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- * 
- ****************************************************************************/
-
+ *
+ *************************************************************************** */
 package org.apache.pdfbox.preflight.annotation;
 
-import static org.apache.pdfbox.preflight.PreflightConstants.ANNOT_DICTIONARY_KEY_QUADPOINTS;
-
 import org.apache.pdfbox.cos.COSDictionary;
-import org.apache.pdfbox.cos.COSName;
-import org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationTextMarkup;
+import org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationSquiggly;
 import org.apache.pdfbox.preflight.PreflightContext;
 
 /**
- * Validation class for the MarkupAnnotation
+ * Validation class for the Squiggly Annotation
  */
-public class MarkupAnnotationValidator extends AnnotationValidator
+public class SquigglyAnnotationValidator extends MarkupAnnotationValidator
 {
-    /**
-     * PDFBox object which wraps the annotation dictionary
-     */
-    protected PDAnnotationTextMarkup pdMarkup = null;
-
-    public MarkupAnnotationValidator(PreflightContext ctx, COSDictionary annotDictionary)
+    protected SquigglyAnnotationValidator(PreflightContext ctx, COSDictionary annotDictionary)
     {
         super(ctx, annotDictionary);
-        this.pdMarkup = new PDAnnotationTextMarkup(annotDictionary);
+        this.pdMarkup = new PDAnnotationSquiggly(annotDictionary);
         this.pdAnnot = this.pdMarkup;
     }
-
-    @Override
-    protected boolean checkSpecificMandatoryFields()
-    {
-        return this.annotDictionary.containsKey(COSName.getPDFName(ANNOT_DICTIONARY_KEY_QUADPOINTS));
-    }
 }

Copied: pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/StrikeoutAnnotationValidator.java
(from r1821699, pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/MarkupAnnotationValidator.java)
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/StrikeoutAnnotationValidator.java?p2=pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/StrikeoutAnnotationValidator.java&p1=pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/MarkupAnnotationValidator.java&r1=1821699&r2=1821755&rev=1821755&view=diff
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/MarkupAnnotationValidator.java
(original)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/StrikeoutAnnotationValidator.java
Sat Jan 20 15:54:43 2018
@@ -1,5 +1,5 @@
-/*****************************************************************************
- * 
+/** ***************************************************************************
+ *
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
@@ -7,47 +7,32 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- * 
- ****************************************************************************/
-
+ *
+ *************************************************************************** */
 package org.apache.pdfbox.preflight.annotation;
 
-import static org.apache.pdfbox.preflight.PreflightConstants.ANNOT_DICTIONARY_KEY_QUADPOINTS;
-
 import org.apache.pdfbox.cos.COSDictionary;
-import org.apache.pdfbox.cos.COSName;
-import org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationTextMarkup;
+import org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationStrikeout;
 import org.apache.pdfbox.preflight.PreflightContext;
 
 /**
- * Validation class for the MarkupAnnotation
+ * Validation class for the Strikeout Annotation
  */
-public class MarkupAnnotationValidator extends AnnotationValidator
+public class StrikeoutAnnotationValidator extends MarkupAnnotationValidator
 {
-    /**
-     * PDFBox object which wraps the annotation dictionary
-     */
-    protected PDAnnotationTextMarkup pdMarkup = null;
-
-    public MarkupAnnotationValidator(PreflightContext ctx, COSDictionary annotDictionary)
+    protected StrikeoutAnnotationValidator(PreflightContext ctx, COSDictionary annotDictionary)
     {
         super(ctx, annotDictionary);
-        this.pdMarkup = new PDAnnotationTextMarkup(annotDictionary);
+        this.pdMarkup = new PDAnnotationStrikeout(annotDictionary);
         this.pdAnnot = this.pdMarkup;
     }
-
-    @Override
-    protected boolean checkSpecificMandatoryFields()
-    {
-        return this.annotDictionary.containsKey(COSName.getPDFName(ANNOT_DICTIONARY_KEY_QUADPOINTS));
-    }
 }

Modified: pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/pdfa/PDFAbAnnotationFactory.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/pdfa/PDFAbAnnotationFactory.java?rev=1821755&r1=1821754&r2=1821755&view=diff
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/pdfa/PDFAbAnnotationFactory.java
(original)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/annotation/pdfa/PDFAbAnnotationFactory.java
Sat Jan 20 15:54:43 2018
@@ -30,7 +30,7 @@ import static org.apache.pdfbox.prefligh
 import static org.apache.pdfbox.preflight.PreflightConstants.ANNOT_DICTIONARY_VALUE_SUBTYPE_POPUP;
 import static org.apache.pdfbox.preflight.PreflightConstants.ANNOT_DICTIONARY_VALUE_SUBTYPE_PRINTERMARK;
 import static org.apache.pdfbox.preflight.PreflightConstants.ANNOT_DICTIONARY_VALUE_SUBTYPE_SQUARE;
-import static org.apache.pdfbox.preflight.PreflightConstants.ANNOT_DICTIONARY_VALUE_SUBTYPE_SQUILGGLY;
+import static org.apache.pdfbox.preflight.PreflightConstants.ANNOT_DICTIONARY_VALUE_SUBTYPE_SQUIGGLY;
 import static org.apache.pdfbox.preflight.PreflightConstants.ANNOT_DICTIONARY_VALUE_SUBTYPE_STAMP;
 import static org.apache.pdfbox.preflight.PreflightConstants.ANNOT_DICTIONARY_VALUE_SUBTYPE_STRIKEOUT;
 import static org.apache.pdfbox.preflight.PreflightConstants.ANNOT_DICTIONARY_VALUE_SUBTYPE_TEXT;
@@ -41,18 +41,22 @@ import static org.apache.pdfbox.prefligh
 import org.apache.pdfbox.preflight.annotation.AnnotationValidatorFactory;
 import org.apache.pdfbox.preflight.annotation.CircleAnnotationValidator;
 import org.apache.pdfbox.preflight.annotation.FreeTextAnnotationValidator;
+import org.apache.pdfbox.preflight.annotation.HighlightAnnotationValidator;
 import org.apache.pdfbox.preflight.annotation.InkAnnotationValidator;
 import org.apache.pdfbox.preflight.annotation.LineAnnotationValidator;
 import org.apache.pdfbox.preflight.annotation.LinkAnnotationValidator;
-import org.apache.pdfbox.preflight.annotation.MarkupAnnotationValidator;
 import org.apache.pdfbox.preflight.annotation.PopupAnnotationValidator;
 import org.apache.pdfbox.preflight.annotation.PrintMarkAnnotationValidator;
 import org.apache.pdfbox.preflight.annotation.RubberStampAnnotationValidator;
 import org.apache.pdfbox.preflight.annotation.SquareAnnotationValidator;
+import org.apache.pdfbox.preflight.annotation.SquigglyAnnotationValidator;
+import org.apache.pdfbox.preflight.annotation.StrikeoutAnnotationValidator;
 import org.apache.pdfbox.preflight.annotation.TextAnnotationValidator;
 import org.apache.pdfbox.preflight.annotation.TrapNetAnnotationValidator;
+import org.apache.pdfbox.preflight.annotation.UnderlineAnnotationValidator;
 import org.apache.pdfbox.preflight.annotation.WidgetAnnotationValidator;
 
+
 /**
  * Factory to instantiate AnnotationValidator for a PDF/A-1b validation.
  */
@@ -70,10 +74,10 @@ public class PDFAbAnnotationFactory exte
         this.validatorClasses.put(ANNOT_DICTIONARY_VALUE_SUBTYPE_SQUARE, SquareAnnotationValidator.class);
         this.validatorClasses.put(ANNOT_DICTIONARY_VALUE_SUBTYPE_CIRCLE, CircleAnnotationValidator.class);
 
-        this.validatorClasses.put(ANNOT_DICTIONARY_VALUE_SUBTYPE_HIGHLIGHT, MarkupAnnotationValidator.class);
-        this.validatorClasses.put(ANNOT_DICTIONARY_VALUE_SUBTYPE_UNDERLINE, MarkupAnnotationValidator.class);
-        this.validatorClasses.put(ANNOT_DICTIONARY_VALUE_SUBTYPE_STRIKEOUT, MarkupAnnotationValidator.class);
-        this.validatorClasses.put(ANNOT_DICTIONARY_VALUE_SUBTYPE_SQUILGGLY, MarkupAnnotationValidator.class);
+        this.validatorClasses.put(ANNOT_DICTIONARY_VALUE_SUBTYPE_HIGHLIGHT, HighlightAnnotationValidator.class);
+        this.validatorClasses.put(ANNOT_DICTIONARY_VALUE_SUBTYPE_UNDERLINE, UnderlineAnnotationValidator.class);
+        this.validatorClasses.put(ANNOT_DICTIONARY_VALUE_SUBTYPE_STRIKEOUT, StrikeoutAnnotationValidator.class);
+        this.validatorClasses.put(ANNOT_DICTIONARY_VALUE_SUBTYPE_SQUIGGLY, SquigglyAnnotationValidator.class);
 
         this.validatorClasses.put(ANNOT_DICTIONARY_VALUE_SUBTYPE_STAMP, RubberStampAnnotationValidator.class);
         this.validatorClasses.put(ANNOT_DICTIONARY_VALUE_SUBTYPE_INK, InkAnnotationValidator.class);



Mime
View raw message