1 20 21 27 28 package javax.xml.transform.stax; 29 30 import javax.xml.stream.XMLEventWriter; 31 import javax.xml.stream.XMLStreamWriter; 32 import javax.xml.transform.Result ; 33 34 54 public class StAXResult implements Result { 55 59 public static final String FEATURE = 60 "http://javax.xml.transform.stax.StAXResult/feature"; 61 62 66 private XMLEventWriter xmlEventWriter = null; 67 68 72 private XMLStreamWriter xmlStreamWriter = null; 73 74 75 private String systemId = null; 76 77 90 public StAXResult(final XMLEventWriter xmlEventWriter) { 91 92 if (xmlEventWriter == null) { 93 throw new IllegalArgumentException ( 94 "StAXResult(XMLEventWriter) with XMLEventWriter == null"); 95 } 96 97 this.xmlEventWriter = xmlEventWriter; 98 } 99 100 113 public StAXResult(final XMLStreamWriter xmlStreamWriter) { 114 115 if (xmlStreamWriter == null) { 116 throw new IllegalArgumentException ( 117 "StAXResult(XMLStreamWriter) with XMLStreamWriter == null"); 118 } 119 120 this.xmlStreamWriter = xmlStreamWriter; 121 } 122 123 134 public XMLEventWriter getXMLEventWriter() { 135 136 return xmlEventWriter; 137 } 138 139 150 public XMLStreamWriter getXMLStreamWriter() { 151 152 return xmlStreamWriter; 153 } 154 155 170 public void setSystemId(final String systemId) { 171 172 throw new UnsupportedOperationException ( 173 "StAXResult#setSystemId(systemId) cannot set the " 174 + "system identifier for a StAXResult"); 175 } 176 177 182 public String getSystemId() { 183 184 return null; 185 } 186 } 187 | Popular Tags |