01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: /* $Id: PDFAAdapter.java 426584 2006-07-28 16:01:47Z jeremias $ */
19:
20: package org.apache.xmlgraphics.xmp.schemas.pdf;
21:
22: import org.apache.xmlgraphics.xmp.Metadata;
23: import org.apache.xmlgraphics.xmp.XMPSchemaAdapter;
24: import org.apache.xmlgraphics.xmp.XMPSchemaRegistry;
25:
26: /**
27: * Schema adapter implementation for both the old (deprecated) and the current PDF/A schema.
28: * The old namespace is still needed to make Adobe Acrobat happy.
29: */
30: public class PDFAAdapter extends XMPSchemaAdapter {
31:
32: /**
33: * Constructs a new adapter for PDF/A around the given metadata object.
34: * @param meta the underlying metadata
35: * @param namespace the namespace to access the schema (must be one of the PDF/A schema
36: * namespaces)
37: */
38: public PDFAAdapter(Metadata meta, String namespace) {
39: super (meta, XMPSchemaRegistry.getInstance()
40: .getSchema(namespace));
41: }
42:
43: /**
44: * Sets the PDF/A version identifier ("part").
45: * @param value the version identifier ("1" for PDF/A-1)
46: */
47: public void setPart(int value) {
48: setValue("part", Integer.toString(value));
49: }
50:
51: /** @return the PDF/A version identifier */
52: public int getPart() {
53: return Integer.parseInt(getValue("part"));
54: }
55:
56: /**
57: * Sets the PDF/A amendment identifier ("amd").
58: * @param value the amendment identifiert
59: */
60: public void setAmendment(String value) {
61: setValue("amd", value);
62: }
63:
64: /** @return the PDF/A amendment identifier */
65: public String getAmendment() {
66: return getValue("amd");
67: }
68:
69: /**
70: * Sets the PDF/A conformance level.
71: * @param value the conformance level ("A" or "B" for PDF/A-1)
72: */
73: public void setConformance(String value) {
74: setValue("conformance", value);
75: }
76:
77: /** @return the PDF/A conformance level */
78: public String getConformance() {
79: return getValue("conformance");
80: }
81:
82: }
|