01: package com.jeta.forms.store.jml;
02:
03: import java.awt.Insets;
04:
05: import com.jeta.forms.store.jml.dom.JMLDocument;
06: import com.jeta.forms.store.jml.dom.JMLNode;
07:
08: public class InsetsSerializer implements InlineJMLSerializer {
09:
10: public JMLNode serialize(JMLDocument document, Object obj)
11: throws JMLException {
12: JMLUtils.verifyObjectType(obj, Insets.class);
13: Insets insets = (Insets) obj;
14: if (insets != null) {
15: StringBuffer sbuff = new StringBuffer();
16: sbuff.append(String.valueOf(insets.top));
17: sbuff.append(',');
18: sbuff.append(String.valueOf(insets.left));
19: sbuff.append(',');
20: sbuff.append(String.valueOf(insets.bottom));
21: sbuff.append(',');
22: sbuff.append(String.valueOf(insets.right));
23: return document.createTextNode(sbuff.toString());
24: } else {
25: return document.createTextNode("");
26: }
27: }
28:
29: public String getObjectName() {
30: return "insets";
31: }
32:
33: }
|