01: package com.jeta.forms.store.jml;
02:
03: import com.jeta.forms.store.jml.dom.JMLDocument;
04: import com.jeta.forms.store.jml.dom.JMLNode;
05:
06: /**
07: * This class is used to store Java primitive types.
08: *
09: * @deprecated Use PrimitiveSerializer instead.
10: * @author Jeff Tassin
11: */
12: public class PrimitiveHolderSerializer implements JMLSerializer {
13:
14: public JMLNode serialize(JMLDocument document, Object obj)
15: throws JMLException {
16: JMLUtils.verifyObjectType(obj, PrimitiveHolder.class);
17:
18: JMLNode objnode = JMLUtils.createObjectNode(document, obj);
19: PrimitiveHolder prim = (PrimitiveHolder) obj;
20:
21: if (prim != null) {
22: objnode.appendChild(JMLUtils.createPropertyNode(document,
23: "primitive", prim.getPrimitiveClassName()));
24: objnode.appendChild(JMLUtils.createPropertyNode(document,
25: "value", String.valueOf(prim.getPrimitive())));
26: }
27: return objnode;
28: }
29:
30: }
|