1
2
3
4
5
6
7
8
9
10
11
12
13 package com.eviware.soapui.impl.wsdl.panels.request.components.editor.support;
14
15 import org.apache.xmlbeans.SchemaTypeSystem;
16 import org.apache.xmlbeans.XmlObject;
17
18 import com.eviware.soapui.SoapUI;
19
20 /***
21 * Default XmlDocument that works on an existing XmlObject
22 *
23 * @author ole.matzura
24 */
25
26 public class XmlObjectXmlDocument extends AbstractXmlDocument
27 {
28 private XmlObject xmlObject;
29
30 public XmlObjectXmlDocument( XmlObject xmlObject )
31 {
32 this.xmlObject = xmlObject;}
33
34 public SchemaTypeSystem getTypeSystem()
35 {
36 return xmlObject == null ? null : xmlObject.schemaType().getTypeSystem();
37 }
38
39 public String getXml()
40 {
41 return xmlObject.toString();
42 }
43
44 public void setXml(String xml)
45 {
46 try
47 {
48 String old = getXml();
49 xmlObject = XmlObject.Factory.parse( xml );
50 fireXmlChanged( old, getXml() );
51 }
52 catch (Exception e)
53 {
54 SoapUI.logError( e );
55 }
56 }
57
58 public void release()
59 {
60 xmlObject = null;
61 }
62 }