1 18 19 package sync4j.framework.core.bootstrap; 20 21 import java.io.ByteArrayOutputStream ; 22 import java.util.ArrayList ; 23 import java.util.List ; 24 25 import org.jibx.runtime.BindingDirectory; 26 import org.jibx.runtime.IBindingFactory; 27 import org.jibx.runtime.IMarshallingContext; 28 import org.jibx.runtime.JiBXException; 29 30 31 39 public final class WapProvisioningDoc { 40 41 private ArrayList characteristics = null; 43 44 private String version = null; 45 46 48 51 public WapProvisioningDoc() { 52 characteristics = new ArrayList (); 53 } 54 55 56 60 public WapProvisioningDoc(String version) { 61 this.version = version; 62 characteristics = new ArrayList (); 63 } 64 65 66 70 public String getVersion() { 71 return version; 72 } 73 74 78 public void setVersion(String version) { 79 this.version = version; 80 } 81 82 87 public void addCharacteristic(Characteristic characteristicToAdd) { 88 characteristics.add(characteristicToAdd); 89 } 90 91 96 public void addCharacteristicList(List characteristicsToAdd) { 97 characteristics.addAll(characteristicsToAdd); 98 } 99 100 104 public String toXml() throws JiBXException { 105 ByteArrayOutputStream bout = new ByteArrayOutputStream (); 106 107 IBindingFactory f = BindingDirectory.getFactory(WapProvisioningDoc.class); 108 IMarshallingContext c = f.createMarshallingContext(); 109 c.setIndent(0); 110 c.marshalDocument(this, "UTF-8", null, bout); 111 112 String inputXml = new String (bout.toByteArray()); 113 114 return inputXml; 115 116 } 117 118 } | Popular Tags |