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: XMPSchema.java 426584 2006-07-28 16:01:47Z jeremias $ */
19:
20: package org.apache.xmlgraphics.xmp;
21:
22: import org.apache.xmlgraphics.util.QName;
23: import org.apache.xmlgraphics.xmp.merge.MergeRuleSet;
24:
25: /**
26: * Base class for schema implementations that provide user-friendly access to XMP values.
27: */
28: public class XMPSchema {
29:
30: private static MergeRuleSet defaultMergeRuleSet = new MergeRuleSet();
31:
32: private String namespace;
33: private String prefix;
34:
35: /**
36: * Constructs a new XMP schema object.
37: * @param namespace the namespace URI for the schema
38: * @param preferredPrefix the preferred prefix for the schema
39: */
40: public XMPSchema(String namespace, String preferredPrefix) {
41: this .namespace = namespace;
42: this .prefix = preferredPrefix;
43: }
44:
45: /** @return the namespace URI of the schema */
46: public String getNamespace() {
47: return this .namespace;
48: }
49:
50: /** @return the preferred prefix of the schema */
51: public String getPreferredPrefix() {
52: return this .prefix;
53: }
54:
55: /**
56: * Returns the QName for a property of this schema.
57: * @param propName the property name
58: * @return the QName for the property
59: */
60: protected QName getQName(String propName) {
61: return new QName(getNamespace(), propName);
62: }
63:
64: /** @return the default merge rule set for this XMP schema. */
65: public MergeRuleSet getDefaultMergeRuleSet() {
66: return defaultMergeRuleSet;
67: }
68: }
|