1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.onemind.commons.relabean.serialize;
21
22 import java.util.HashMap;
23 import java.util.Map;
24
25
26 /***
27 * Describes the binding of a class and a name
28 * @author TiongHiang Lee (thlee@onemindsoft.org)
29 * @version $Id: NameBinding.java,v 1.2 2004/08/26 16:29:00 thlee Exp $ $Name: $
30 */
31 public class NameBinding
32 {
33 /*** the name mapping **/
34 private Map _nameBindings = new HashMap();
35
36 /***
37 * {@inheritDoc}
38 */
39 public NameBinding()
40 {
41 }
42
43 /***
44 * Get the name of the class in the model
45 * @param c the class
46 * @return the name of the class in the model
47 */
48 public String getName(Class c)
49 {
50 return (String) _nameBindings.get(c);
51 }
52
53 /***
54 * Add a name mapping of the bean
55 * @param c the class
56 * @param name the name
57 */
58 public void bind(Class c, String name)
59 {
60 _nameBindings.put(c, name);
61 }
62
63 /***
64 * Get all the name mappings
65 * @return the name mappings
66 */
67 public Map getBindings()
68 {
69 return _nameBindings;
70 }
71 }