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 2020/02/19 18:56:20 UTC
svn commit: r1874210 -
/pdfbox/branches/1.8/preflight/src/main/java/org/apache/pdfbox/preflight/metadata/RDFAboutAttributeConcordanceValidation.java
Author: tilman
Date: Wed Feb 19 18:56:20 2020
New Revision: 1874210
URL: http://svn.apache.org/viewvc?rev=1874210&view=rev
Log:
PDFBOX-4071: improve javadoc, improve error message, reformat
Modified:
pdfbox/branches/1.8/preflight/src/main/java/org/apache/pdfbox/preflight/metadata/RDFAboutAttributeConcordanceValidation.java
Modified: pdfbox/branches/1.8/preflight/src/main/java/org/apache/pdfbox/preflight/metadata/RDFAboutAttributeConcordanceValidation.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/preflight/src/main/java/org/apache/pdfbox/preflight/metadata/RDFAboutAttributeConcordanceValidation.java?rev=1874210&r1=1874209&r2=1874210&view=diff
==============================================================================
--- pdfbox/branches/1.8/preflight/src/main/java/org/apache/pdfbox/preflight/metadata/RDFAboutAttributeConcordanceValidation.java (original)
+++ pdfbox/branches/1.8/preflight/src/main/java/org/apache/pdfbox/preflight/metadata/RDFAboutAttributeConcordanceValidation.java Wed Feb 19 18:56:20 2020
@@ -28,8 +28,9 @@ import org.apache.xmpbox.XMPMetadata;
import org.apache.xmpbox.schema.XMPSchema;
/**
- * Class which all elements within an rdf:RDF have the same value for their rdf:about attributes
- *
+ * Class which checks that all elements within an rdf:RDF have the same value for their rdf:about
+ * attributes.
+ *
* @author Germain Costenobel
*
*/
@@ -37,9 +38,8 @@ public class RDFAboutAttributeConcordanc
{
/**
- *
+ *
* @param metadata
- * @return
* @throws DifferentRDFAboutException
* @throws ValidationException
*/
@@ -49,11 +49,11 @@ public class RDFAboutAttributeConcordanc
List<XMPSchema> schemas = metadata.getAllSchemas();
if (schemas.size() == 0)
{
- throw new ValidationException("Schemas not found in the given metadata representation");
+ throw new ValidationException("No schema found in the given metadata representation");
}
-
+
String about = schemas.get(0).getAboutValue();
-
+
// rdf:description must have an rdf:about attribute
for (XMPSchema xmpSchema : schemas)
{
@@ -63,12 +63,12 @@ public class RDFAboutAttributeConcordanc
{
throw new DifferentRDFAboutException();
}
-
- if ("".equals(about)) {
+
+ if ("".equals(about))
+ {
about = schemaAboutValue;
}
}
-
}
public static class DifferentRDFAboutException extends Exception