PdfaExtensionHelper.java (pdfbox-2.0.23-src) | : | PdfaExtensionHelper.java (pdfbox-2.0.24-src) | ||
---|---|---|---|---|
skipping to change at line 85 | skipping to change at line 85 | |||
private static void checkNamespaceDeclaration(Attr attr, Class<? extends Abs tractStructuredType> clz) | private static void checkNamespaceDeclaration(Attr attr, Class<? extends Abs tractStructuredType> clz) | |||
throws XmpParsingException | throws XmpParsingException | |||
{ | { | |||
String prefix = attr.getLocalName(); | String prefix = attr.getLocalName(); | |||
String namespace = attr.getValue(); | String namespace = attr.getValue(); | |||
String cprefix = clz.getAnnotation(StructuredType.class).preferedPrefix( ); | String cprefix = clz.getAnnotation(StructuredType.class).preferedPrefix( ); | |||
String cnamespace = clz.getAnnotation(StructuredType.class).namespace(); | String cnamespace = clz.getAnnotation(StructuredType.class).namespace(); | |||
// check extension | // check extension | |||
if (cprefix.equals(prefix) && !cnamespace.equals(namespace)) | if (cprefix.equals(prefix) && !cnamespace.equals(namespace)) | |||
{ | { | |||
throw new XmpParsingException(ErrorType.InvalidPdfaSchema, "Invalid | throw new XmpParsingException(ErrorType.InvalidPdfaSchema, | |||
PDF/A namespace definition"); | "Invalid PDF/A namespace definition, " | |||
+ "prefix: " + prefix + ", namespace: " + namespace) | ||||
; | ||||
} | } | |||
if (cnamespace.equals(namespace) && !cprefix.equals(prefix)) | if (cnamespace.equals(namespace) && !cprefix.equals(prefix)) | |||
{ | { | |||
throw new XmpParsingException(ErrorType.InvalidPdfaSchema, "Invalid | throw new XmpParsingException(ErrorType.InvalidPdfaSchema, | |||
PDF/A namespace definition"); | "Invalid PDF/A namespace definition, " | |||
+ "prefix: " + prefix + ", namespace: " + namespace) | ||||
; | ||||
} | } | |||
} | } | |||
public static void populateSchemaMapping(XMPMetadata meta) throws XmpParsing Exception | public static void populateSchemaMapping(XMPMetadata meta) throws XmpParsing Exception | |||
{ | { | |||
List<XMPSchema> schems = meta.getAllSchemas(); | List<XMPSchema> schems = meta.getAllSchemas(); | |||
TypeMapping tm = meta.getTypeMapping(); | TypeMapping tm = meta.getTypeMapping(); | |||
StructuredType stPdfaExt = PDFAExtensionSchema.class.getAnnotation(Struc turedType.class); | StructuredType stPdfaExt = PDFAExtensionSchema.class.getAnnotation(Struc turedType.class); | |||
for (XMPSchema xmpSchema : schems) | for (XMPSchema xmpSchema : schems) | |||
{ | { | |||
End of changes. 2 change blocks. | ||||
4 lines changed or deleted | 8 lines changed or added |