* @throws ValidationException
*/
public List<ValidationError> validatePDFAIdentifer(XMPMetadata metadata) throws ValidationException
{
List<ValidationError> ve = new ArrayList<ValidationError>();
PDFAIdentificationSchema id = metadata.getPDFIdentificationSchema();
if (id == null)
{
ve.add(new ValidationError(ERROR_METADATA_PDFA_ID_MISSING));
return ve;
}
// According to the PDF/A specification, the prefix must be pdfaid for this schema.
StructuredType stBasic = XMPBasicSchema.class.getAnnotation(StructuredType.class);
StructuredType stPdfaIdent = PDFAIdentificationSchema.class.getAnnotation(StructuredType.class);
if (!id.getPrefix().equals(stPdfaIdent.preferedPrefix()))
{
if (metadata.getSchema(stPdfaIdent.preferedPrefix(), stBasic.namespace()) == null)
{
ve.add(unexpectedPrefixFoundError(id.getPrefix(), stPdfaIdent.preferedPrefix(),
PDFAIdentificationSchema.class.getName()));
}
else
{
id = (PDFAIdentificationSchema) metadata.getSchema(stPdfaIdent.preferedPrefix(),
stPdfaIdent.namespace());
}
}
checkConformanceLevel(ve, id.getConformance());
checkPartNumber(ve, id.getPart());
return ve;
}