01: /**
02: * Objective Database Abstraction Layer (ODAL)
03: * Copyright (c) 2004, The ODAL Development Group
04: * All rights reserved.
05: * For definition of the ODAL Development Group please refer to LICENCE.txt file
06: *
07: * Distributable under LGPL license.
08: * See terms of license at gnu.org.
09: */package com.completex.objective.components.persistency.meta;
10:
11: import com.completex.objective.components.persistency.Mappable;
12:
13: import java.util.LinkedHashMap;
14: import java.util.Map;
15:
16: /**
17: * @author Gennady Krizhevsky
18: */
19: public class MetaRef implements Mappable {
20:
21: public static final String TAG_NAME = "name";
22: public static final String TAG_CLASS_NAME = "className";
23:
24: private String name;
25: private String className;
26:
27: public MetaRef() {
28: }
29:
30: public MetaRef(Map map) {
31: fromMap(map);
32: }
33:
34: public String getName() {
35: return name;
36: }
37:
38: public void setName(String name) {
39: this .name = name;
40: }
41:
42: public String getClassName() {
43: return className;
44: }
45:
46: public void setClassName(String className) {
47: this .className = className;
48: }
49:
50: public Map toMap() {
51: LinkedHashMap map = new LinkedHashMap();
52: map.put(TAG_NAME, name);
53: map.put(TAG_CLASS_NAME, className);
54: return map;
55: }
56:
57: public void fromMap(Map map) {
58: name = (String) map.get(TAG_NAME);
59: className = (String) map.get(TAG_CLASS_NAME);
60: }
61:
62: public String toString() {
63: return toMap().toString();
64: }
65:
66: }
|