01: /*
02: * Copyright 2004-2006 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16:
17: package org.compass.core.metadata.impl;
18:
19: import java.util.HashMap;
20: import java.util.Iterator;
21:
22: import org.compass.core.metadata.MetaData;
23:
24: /**
25: * @author kimchy
26: */
27: public class DefaultMetaData extends AbstractMetaDataItem implements
28: MetaData {
29:
30: private String format;
31:
32: private HashMap values = new HashMap();
33:
34: public String getFormat() {
35: return format;
36: }
37:
38: public void setFormat(String format) {
39: this .format = format;
40: }
41:
42: public String getValue(String id) {
43: return (String) values.get(id);
44: }
45:
46: public void setValue(String id, String value) {
47: values.put(id, value);
48: }
49:
50: public MetaData copy() {
51: DefaultMetaData copyMetaData = new DefaultMetaData();
52: copy(copyMetaData);
53: copyMetaData.setFormat(getFormat());
54: for (Iterator it = values.keySet().iterator(); it.hasNext();) {
55: String id = (String) it.next();
56: copyMetaData.setValue(id, (String) values.get(id));
57: }
58: return copyMetaData;
59: }
60:
61: }
|