]> git.evergreen-ils.org Git - OpenSRF.git/blob - src/java/org/opensrf/util/OSRFObject.java
added support for opensrf-serializable objects and JSON output of those objects....
[OpenSRF.git] / src / java / org / opensrf / util / OSRFObject.java
1 package org.opensrf.util;
2
3 import java.util.HashMap;
4
5
6 /**
7  * Generic OpenSRF network-serializable object.  This allows
8  * access to object fields.  
9  */
10 public class OSRFObject extends HashMap<String, Object> implements OSRFSerializable {
11     
12     /** This objects registry */
13     private OSRFRegistry registry;
14
15     public OSRFObject() {
16     }
17
18     /**
19      * Creates a new object with the provided registry
20      */
21     public OSRFObject(OSRFRegistry reg) {
22         this();
23         registry = reg;
24     }
25
26
27     /**
28      * @return This object's registry
29      */
30     public OSRFRegistry getRegistry() {
31         return registry;
32     }
33
34
35     /**
36      * Gets the object at the given fields.  We override this here
37      * as part of the contract with OSRFSerializable
38      * @param field the field name to get.
39      * @return The object contained at the given field.
40      */
41     public Object get(String field) {
42         return super.get(field);
43     }
44 }