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:24 UTC
svn commit: r1874211 -
/pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/metadata/RDFAboutAttributeConcordanceValidation.java
Author: tilman
Date: Wed Feb 19 18:56:24 2020
New Revision: 1874211
URL: http://svn.apache.org/viewvc?rev=1874211&view=rev
Log:
PDFBOX-4071: improve javadoc, improve error message, reformat
Modified:
pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/metadata/RDFAboutAttributeConcordanceValidation.java
Modified: pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/metadata/RDFAboutAttributeConcordanceValidation.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/metadata/RDFAboutAttributeConcordanceValidation.java?rev=1874211&r1=1874210&r2=1874211&view=diff
==============================================================================
--- pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/metadata/RDFAboutAttributeConcordanceValidation.java (original)
+++ pdfbox/branches/2.0/preflight/src/main/java/org/apache/pdfbox/preflight/metadata/RDFAboutAttributeConcordanceValidation.java Wed Feb 19 18:56:24 2020
@@ -28,16 +28,17 @@ 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
- *
+ *
*/
public class RDFAboutAttributeConcordanceValidation
{
/**
- *
+ *
* @param metadata the XMP metadata.
* @throws DifferentRDFAboutException
* @throws ValidationException
@@ -48,11 +49,11 @@ public class RDFAboutAttributeConcordanc
List<XMPSchema> schemas = metadata.getAllSchemas();
if (schemas.isEmpty())
{
- 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)
{
@@ -62,7 +63,7 @@ public class RDFAboutAttributeConcordanc
{
throw new DifferentRDFAboutException();
}
-
+
if ("".equals(about))
{
about = schemaAboutValue;