001/* ---------------------------------------------------------------------------- 002 * This file was automatically generated by SWIG (http://www.swig.org). 003 * Version 3.0.8 004 * 005 * Do not make changes to this file unless you know what you are doing--modify 006 * the SWIG interface file instead. 007 * ----------------------------------------------------------------------------- */ 008 009package org.sbml.libsbml; 010 011/** 012 * Interface to an XML output stream. 013 <p> 014 * <p style='color: #777; font-style: italic'> 015This class of objects is defined by libSBML only and has no direct 016equivalent in terms of SBML components. This class is not prescribed by 017the SBML specifications, although it is used to implement features 018defined in SBML. 019</p> 020 021 <p> 022 * SBML content is serialized using XML; the resulting data can be stored and 023 * read to/from a file or data stream. Low-level XML parsers such as Xerces 024 * provide facilities to read XML data. To permit the use of different XML 025 * parsers (Xerces, Expat or libxml2), libSBML implements an abstraction 026 * layer. {@link XMLInputStream} and {@link XMLOutputStream} are two parts of that 027 * abstraction layer. 028 <p> 029 * {@link XMLOutputStream} provides a wrapper above output streams to facilitate 030 * writing XML. {@link XMLOutputStream} keeps track of start and end elements, 031 * indentation, XML namespace prefixes, and more. The interface provides 032 * features for converting non-text data types into appropriate textual form; 033 * this takes the form of overloaded <code>writeAttribute(...)</code> methods 034 * that allow users to simply use the same method with any data type. For 035 * example, suppose an element <code>testElement</code> has two attributes, <code>size</code> and 036 * <code>id</code>, and the attributes are variables in your code as follows: 037<p> 038<pre class='fragment'> 039double size = 3.2; 040String id = 'id'; 041</pre> 042<p> 043 * Then, the element and the attributes can be written to the 044 * standard output stream (provided as <code>cout</code> in the libSBML 045 * language bindings) as follows: 046<p> 047<pre class='fragment'> 048import org.sbml.libsbml.XMLOutputStream; 049import org.sbml.libsbml.libsbml; 050 051public class test 052{ 053 public static void main (String[] args) 054 { 055 double size = 3.2; 056 String id = 'id'; 057 058 // Create an {@link XMLOutputStream} object that will write to the 059 // standard output stream, which is provide in libSBML's 060 // Java language interface as the object 'libsbml.cout'. 061 062 {@link XMLOutputStream} xos = new {@link XMLOutputStream}(libsbml.cout); 063 064 // Create the start element, write the attributes, and close 065 // the element. The output will be written immediately as 066 // each method is called. 067 068 xos.startElement('testElement'); 069 xos.writeAttribute('size', size); 070 xos.writeAttribute('id', id); 071 xos.endElement('testElement'); 072 } 073 074 static 075 { 076 System.loadLibrary('sbmlj'); 077 } 078} 079</pre> 080<p> 081 * Other classes in SBML take {@link XMLOutputStream} objects as arguments, and use 082 * that to write elements and attributes seamlessly to the XML output stream. 083 <p> 084 * It is also worth noting that unlike {@link XMLInputStream}, {@link XMLOutputStream} is 085 * actually independent of the underlying XML parsers. It does not use the 086 * XML parser libraries at all. 087 <p> 088 * @note The convenience of the {@link XMLInputStream} and {@link XMLOutputStream} 089 * abstraction may be useful for developers interested in creating parsers 090 * for other XML formats besides SBML. It can provide developers with a 091 * layer above more basic XML parsers, as well as some useful programmatic 092 * elements such as {@link XMLToken}, {@link XMLError}, etc. 093 <p> 094 * @see XMLInputStream 095 */ 096 097public class XMLOutputStream { 098 private long swigCPtr; 099 protected boolean swigCMemOwn; 100 101 protected XMLOutputStream(long cPtr, boolean cMemoryOwn) 102 { 103 swigCMemOwn = cMemoryOwn; 104 swigCPtr = cPtr; 105 } 106 107 protected static long getCPtr(XMLOutputStream obj) 108 { 109 return (obj == null) ? 0 : obj.swigCPtr; 110 } 111 112 protected static long getCPtrAndDisown (XMLOutputStream obj) 113 { 114 long ptr = 0; 115 116 if (obj != null) 117 { 118 ptr = obj.swigCPtr; 119 obj.swigCMemOwn = false; 120 } 121 122 return ptr; 123 } 124 125 protected void finalize() { 126 delete(); 127 } 128 129 public synchronized void delete() { 130 if (swigCPtr != 0) { 131 if (swigCMemOwn) { 132 swigCMemOwn = false; 133 libsbmlJNI.delete_XMLOutputStream(swigCPtr); 134 } 135 swigCPtr = 0; 136 } 137 } 138 139 /** 140 * Equality comparison method for XMLOutputStream. 141 * <p> 142 * Because the Java methods for libSBML are actually wrappers around code 143 * implemented in C++ and C, certain operations will not behave as 144 * expected. Equality comparison is one such case. An instance of a 145 * libSBML object class is actually a <em>proxy object</em> 146 * wrapping the real underlying C/C++ object. The normal <code>==</code> 147 * equality operator in Java will <em>only compare the Java proxy objects</em>, 148 * not the underlying native object. The result is almost never what you 149 * want in practical situations. Unfortunately, Java does not provide a 150 * way to override <code>==</code>. 151 * <p> 152 * The alternative that must be followed is to use the 153 * <code>equals()</code> method. The <code>equals</code> method on this 154 * class overrides the default java.lang.Object one, and performs an 155 * intelligent comparison of instances of objects of this class. The 156 * result is an assessment of whether two libSBML Java objects are truly 157 * the same underlying native-code objects. 158 * <p> 159 * The use of this method in practice is the same as the use of any other 160 * Java <code>equals</code> method. For example, 161 * <em>a</em><code>.equals(</code><em>b</em><code>)</code> returns 162 * <code>true</code> if <em>a</em> and <em>b</em> are references to the 163 * same underlying object. 164 * 165 * @param sb a reference to an object to which the current object 166 * instance will be compared 167 * 168 * @return <code>true</code> if <code>sb</code> refers to the same underlying 169 * native object as this one, <code>false</code> otherwise 170 */ 171 public boolean equals(Object sb) 172 { 173 if ( this == sb ) 174 { 175 return true; 176 } 177 return swigCPtr == getCPtr((XMLOutputStream)(sb)); 178 } 179 180 /** 181 * Returns a hashcode for this XMLOutputStream object. 182 * 183 * @return a hash code usable by Java methods that need them. 184 */ 185 public int hashCode() 186 { 187 return (int)(swigCPtr^(swigCPtr>>>32)); 188 } 189 190 191/** 192 * Creates a new {@link XMLOutputStream} that wraps the given <code>stream</code>. 193 <p> 194 * <p> 195 * The functionality associated with the <code>programName</code> and 196 * <code>programVersion</code> arguments concerns an optional comment that libSBML can 197 * write at the beginning of the output stream. The comment is intended 198 * for human readers of the XML file, and has the following form: 199 * <pre class='fragment'> 200<!-- Created by <program name> version <program version> 201on yyyy-MM-dd HH:mm with libSBML version <libsbml version>. --> 202</pre> 203 <p> 204 * This program information comment is a separate item from the XML 205 * declaration that this method can also write to this output stream. The 206 * comment is also not mandated by any SBML specification. This libSBML 207 * functionality is provided for the convenience of calling programs, and to 208 * help humans trace the origin of SBML files. 209 <p> 210 * <p> 211 * The XML declaration has the form 212 * <pre class='fragment'> 213<?xml version='1.0' encoding='UTF-8'?> 214</pre> 215 * Note that the SBML specifications require the use of UTF-8 encoding and 216 * version 1.0, so for SBML documents, the above is the standard XML 217 * declaration. 218 <p> 219 * @param stream the input stream to wrap. 220 <p> 221 * @param encoding the XML encoding to declare in the output. This value 222 * should be <code>'UTF-8'</code> for SBML documents. The default value 223 * is <code>'UTF-8'</code> if no value is supplied for this parameter. 224 <p> 225 * @param writeXMLDecl whether to write a standard XML declaration at 226 * the beginning of the content written on <code>stream</code>. The default is 227 * <code>true.</code> 228 <p> 229 * @param programName an optional program name to write as a comment 230 * in the output stream. 231 <p> 232 * @param programVersion an optional version identification string to write 233 * as a comment in the output stream. 234 <p> 235 * 236</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 237The native C++ implementation of this method defines a default argument 238value. In the documentation generated for different libSBML language 239bindings, you may or may not see corresponding arguments in the method 240declarations. For example, in Java and C#, a default argument is handled by 241declaring two separate methods, with one of them having the argument and 242the other one lacking the argument. However, the libSBML documentation will 243be <em>identical</em> for both methods. Consequently, if you are reading 244this and do not see an argument even though one is described, please look 245for descriptions of other variants of this method near where this one 246appears in the documentation. 247</dd></dl> 248 249 */ public 250 XMLOutputStream(OStream stream, String encoding, boolean writeXMLDecl, String programName, String programVersion) throws org.sbml.libsbml.XMLConstructorException { 251 this(libsbmlJNI.new_XMLOutputStream__SWIG_0(SWIGTYPE_p_std__ostream.getCPtr(stream.get_ostream()), stream, encoding, writeXMLDecl, programName, programVersion), true); 252 } 253 254 255/** 256 * Creates a new {@link XMLOutputStream} that wraps the given <code>stream</code>. 257 <p> 258 * <p> 259 * The functionality associated with the <code>programName</code> and 260 * <code>programVersion</code> arguments concerns an optional comment that libSBML can 261 * write at the beginning of the output stream. The comment is intended 262 * for human readers of the XML file, and has the following form: 263 * <pre class='fragment'> 264<!-- Created by <program name> version <program version> 265on yyyy-MM-dd HH:mm with libSBML version <libsbml version>. --> 266</pre> 267 <p> 268 * This program information comment is a separate item from the XML 269 * declaration that this method can also write to this output stream. The 270 * comment is also not mandated by any SBML specification. This libSBML 271 * functionality is provided for the convenience of calling programs, and to 272 * help humans trace the origin of SBML files. 273 <p> 274 * <p> 275 * The XML declaration has the form 276 * <pre class='fragment'> 277<?xml version='1.0' encoding='UTF-8'?> 278</pre> 279 * Note that the SBML specifications require the use of UTF-8 encoding and 280 * version 1.0, so for SBML documents, the above is the standard XML 281 * declaration. 282 <p> 283 * @param stream the input stream to wrap. 284 <p> 285 * @param encoding the XML encoding to declare in the output. This value 286 * should be <code>'UTF-8'</code> for SBML documents. The default value 287 * is <code>'UTF-8'</code> if no value is supplied for this parameter. 288 <p> 289 * @param writeXMLDecl whether to write a standard XML declaration at 290 * the beginning of the content written on <code>stream</code>. The default is 291 * <code>true.</code> 292 <p> 293 * @param programName an optional program name to write as a comment 294 * in the output stream. 295 <p> 296 * @param programVersion an optional version identification string to write 297 * as a comment in the output stream. 298 <p> 299 * 300</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 301The native C++ implementation of this method defines a default argument 302value. In the documentation generated for different libSBML language 303bindings, you may or may not see corresponding arguments in the method 304declarations. For example, in Java and C#, a default argument is handled by 305declaring two separate methods, with one of them having the argument and 306the other one lacking the argument. However, the libSBML documentation will 307be <em>identical</em> for both methods. Consequently, if you are reading 308this and do not see an argument even though one is described, please look 309for descriptions of other variants of this method near where this one 310appears in the documentation. 311</dd></dl> 312 313 */ public 314 XMLOutputStream(OStream stream, String encoding, boolean writeXMLDecl, String programName) throws org.sbml.libsbml.XMLConstructorException { 315 this(libsbmlJNI.new_XMLOutputStream__SWIG_1(SWIGTYPE_p_std__ostream.getCPtr(stream.get_ostream()), stream, encoding, writeXMLDecl, programName), true); 316 } 317 318 319/** 320 * Creates a new {@link XMLOutputStream} that wraps the given <code>stream</code>. 321 <p> 322 * <p> 323 * The functionality associated with the <code>programName</code> and 324 * <code>programVersion</code> arguments concerns an optional comment that libSBML can 325 * write at the beginning of the output stream. The comment is intended 326 * for human readers of the XML file, and has the following form: 327 * <pre class='fragment'> 328<!-- Created by <program name> version <program version> 329on yyyy-MM-dd HH:mm with libSBML version <libsbml version>. --> 330</pre> 331 <p> 332 * This program information comment is a separate item from the XML 333 * declaration that this method can also write to this output stream. The 334 * comment is also not mandated by any SBML specification. This libSBML 335 * functionality is provided for the convenience of calling programs, and to 336 * help humans trace the origin of SBML files. 337 <p> 338 * <p> 339 * The XML declaration has the form 340 * <pre class='fragment'> 341<?xml version='1.0' encoding='UTF-8'?> 342</pre> 343 * Note that the SBML specifications require the use of UTF-8 encoding and 344 * version 1.0, so for SBML documents, the above is the standard XML 345 * declaration. 346 <p> 347 * @param stream the input stream to wrap. 348 <p> 349 * @param encoding the XML encoding to declare in the output. This value 350 * should be <code>'UTF-8'</code> for SBML documents. The default value 351 * is <code>'UTF-8'</code> if no value is supplied for this parameter. 352 <p> 353 * @param writeXMLDecl whether to write a standard XML declaration at 354 * the beginning of the content written on <code>stream</code>. The default is 355 * <code>true.</code> 356 <p> 357 * @param programName an optional program name to write as a comment 358 * in the output stream. 359 <p> 360 * @param programVersion an optional version identification string to write 361 * as a comment in the output stream. 362 <p> 363 * 364</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 365The native C++ implementation of this method defines a default argument 366value. In the documentation generated for different libSBML language 367bindings, you may or may not see corresponding arguments in the method 368declarations. For example, in Java and C#, a default argument is handled by 369declaring two separate methods, with one of them having the argument and 370the other one lacking the argument. However, the libSBML documentation will 371be <em>identical</em> for both methods. Consequently, if you are reading 372this and do not see an argument even though one is described, please look 373for descriptions of other variants of this method near where this one 374appears in the documentation. 375</dd></dl> 376 377 */ public 378 XMLOutputStream(OStream stream, String encoding, boolean writeXMLDecl) throws org.sbml.libsbml.XMLConstructorException { 379 this(libsbmlJNI.new_XMLOutputStream__SWIG_2(SWIGTYPE_p_std__ostream.getCPtr(stream.get_ostream()), stream, encoding, writeXMLDecl), true); 380 } 381 382 383/** 384 * Creates a new {@link XMLOutputStream} that wraps the given <code>stream</code>. 385 <p> 386 * <p> 387 * The functionality associated with the <code>programName</code> and 388 * <code>programVersion</code> arguments concerns an optional comment that libSBML can 389 * write at the beginning of the output stream. The comment is intended 390 * for human readers of the XML file, and has the following form: 391 * <pre class='fragment'> 392<!-- Created by <program name> version <program version> 393on yyyy-MM-dd HH:mm with libSBML version <libsbml version>. --> 394</pre> 395 <p> 396 * This program information comment is a separate item from the XML 397 * declaration that this method can also write to this output stream. The 398 * comment is also not mandated by any SBML specification. This libSBML 399 * functionality is provided for the convenience of calling programs, and to 400 * help humans trace the origin of SBML files. 401 <p> 402 * <p> 403 * The XML declaration has the form 404 * <pre class='fragment'> 405<?xml version='1.0' encoding='UTF-8'?> 406</pre> 407 * Note that the SBML specifications require the use of UTF-8 encoding and 408 * version 1.0, so for SBML documents, the above is the standard XML 409 * declaration. 410 <p> 411 * @param stream the input stream to wrap. 412 <p> 413 * @param encoding the XML encoding to declare in the output. This value 414 * should be <code>'UTF-8'</code> for SBML documents. The default value 415 * is <code>'UTF-8'</code> if no value is supplied for this parameter. 416 <p> 417 * @param writeXMLDecl whether to write a standard XML declaration at 418 * the beginning of the content written on <code>stream</code>. The default is 419 * <code>true.</code> 420 <p> 421 * @param programName an optional program name to write as a comment 422 * in the output stream. 423 <p> 424 * @param programVersion an optional version identification string to write 425 * as a comment in the output stream. 426 <p> 427 * 428</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 429The native C++ implementation of this method defines a default argument 430value. In the documentation generated for different libSBML language 431bindings, you may or may not see corresponding arguments in the method 432declarations. For example, in Java and C#, a default argument is handled by 433declaring two separate methods, with one of them having the argument and 434the other one lacking the argument. However, the libSBML documentation will 435be <em>identical</em> for both methods. Consequently, if you are reading 436this and do not see an argument even though one is described, please look 437for descriptions of other variants of this method near where this one 438appears in the documentation. 439</dd></dl> 440 441 */ public 442 XMLOutputStream(OStream stream, String encoding) throws org.sbml.libsbml.XMLConstructorException { 443 this(libsbmlJNI.new_XMLOutputStream__SWIG_3(SWIGTYPE_p_std__ostream.getCPtr(stream.get_ostream()), stream, encoding), true); 444 } 445 446 447/** 448 * Creates a new {@link XMLOutputStream} that wraps the given <code>stream</code>. 449 <p> 450 * <p> 451 * The functionality associated with the <code>programName</code> and 452 * <code>programVersion</code> arguments concerns an optional comment that libSBML can 453 * write at the beginning of the output stream. The comment is intended 454 * for human readers of the XML file, and has the following form: 455 * <pre class='fragment'> 456<!-- Created by <program name> version <program version> 457on yyyy-MM-dd HH:mm with libSBML version <libsbml version>. --> 458</pre> 459 <p> 460 * This program information comment is a separate item from the XML 461 * declaration that this method can also write to this output stream. The 462 * comment is also not mandated by any SBML specification. This libSBML 463 * functionality is provided for the convenience of calling programs, and to 464 * help humans trace the origin of SBML files. 465 <p> 466 * <p> 467 * The XML declaration has the form 468 * <pre class='fragment'> 469<?xml version='1.0' encoding='UTF-8'?> 470</pre> 471 * Note that the SBML specifications require the use of UTF-8 encoding and 472 * version 1.0, so for SBML documents, the above is the standard XML 473 * declaration. 474 <p> 475 * @param stream the input stream to wrap. 476 <p> 477 * @param encoding the XML encoding to declare in the output. This value 478 * should be <code>'UTF-8'</code> for SBML documents. The default value 479 * is <code>'UTF-8'</code> if no value is supplied for this parameter. 480 <p> 481 * @param writeXMLDecl whether to write a standard XML declaration at 482 * the beginning of the content written on <code>stream</code>. The default is 483 * <code>true.</code> 484 <p> 485 * @param programName an optional program name to write as a comment 486 * in the output stream. 487 <p> 488 * @param programVersion an optional version identification string to write 489 * as a comment in the output stream. 490 <p> 491 * 492</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 493The native C++ implementation of this method defines a default argument 494value. In the documentation generated for different libSBML language 495bindings, you may or may not see corresponding arguments in the method 496declarations. For example, in Java and C#, a default argument is handled by 497declaring two separate methods, with one of them having the argument and 498the other one lacking the argument. However, the libSBML documentation will 499be <em>identical</em> for both methods. Consequently, if you are reading 500this and do not see an argument even though one is described, please look 501for descriptions of other variants of this method near where this one 502appears in the documentation. 503</dd></dl> 504 505 */ public 506 XMLOutputStream(OStream stream) throws org.sbml.libsbml.XMLConstructorException { 507 this(libsbmlJNI.new_XMLOutputStream__SWIG_4(SWIGTYPE_p_std__ostream.getCPtr(stream.get_ostream()), stream), true); 508 } 509 510 511/** 512 * Writes the given XML end element name to this {@link XMLOutputStream}. 513 <p> 514 * @param name the name of the element. 515 <p> 516 * @param prefix an optional XML namespace prefix to write in front of the 517 * <code>element</code> name. (The result has the form 518 * <code><em>prefix</em>:<em>name</em></code>.) 519 <p> 520 * 521</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 522The native C++ implementation of this method defines a default argument 523value. In the documentation generated for different libSBML language 524bindings, you may or may not see corresponding arguments in the method 525declarations. For example, in Java and C#, a default argument is handled by 526declaring two separate methods, with one of them having the argument and 527the other one lacking the argument. However, the libSBML documentation will 528be <em>identical</em> for both methods. Consequently, if you are reading 529this and do not see an argument even though one is described, please look 530for descriptions of other variants of this method near where this one 531appears in the documentation. 532</dd></dl> 533 534 */ public 535 void endElement(String name, String prefix) { 536 libsbmlJNI.XMLOutputStream_endElement__SWIG_0(swigCPtr, this, name, prefix); 537 } 538 539 540/** 541 * Writes the given XML end element name to this {@link XMLOutputStream}. 542 <p> 543 * @param name the name of the element. 544 <p> 545 * @param prefix an optional XML namespace prefix to write in front of the 546 * <code>element</code> name. (The result has the form 547 * <code><em>prefix</em>:<em>name</em></code>.) 548 <p> 549 * 550</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 551The native C++ implementation of this method defines a default argument 552value. In the documentation generated for different libSBML language 553bindings, you may or may not see corresponding arguments in the method 554declarations. For example, in Java and C#, a default argument is handled by 555declaring two separate methods, with one of them having the argument and 556the other one lacking the argument. However, the libSBML documentation will 557be <em>identical</em> for both methods. Consequently, if you are reading 558this and do not see an argument even though one is described, please look 559for descriptions of other variants of this method near where this one 560appears in the documentation. 561</dd></dl> 562 563 */ public 564 void endElement(String name) { 565 libsbmlJNI.XMLOutputStream_endElement__SWIG_1(swigCPtr, this, name); 566 } 567 568 569/** 570 * Writes the given element to the stream. 571 <p> 572 * @param triple the XML element to write. 573 */ public 574 void endElement(XMLTriple triple) { 575 libsbmlJNI.XMLOutputStream_endElement__SWIG_2(swigCPtr, this, XMLTriple.getCPtr(triple), triple); 576 } 577 578 579/** 580 * Turns automatic indentation on or off for this {@link XMLOutputStream}. 581 <p> 582 * @param indent if <code>true</code>, automatic indentation is turned on. 583 */ public 584 void setAutoIndent(boolean indent) { 585 libsbmlJNI.XMLOutputStream_setAutoIndent(swigCPtr, this, indent); 586 } 587 588 589/** 590 * Writes the given XML start element name to this {@link XMLOutputStream}. 591 <p> 592 * @param name the name of the element. 593 <p> 594 * @param prefix an optional XML namespace prefix to write in front of the 595 * <code>element</code> name. (The result has the form 596 * <code><em>prefix</em>:<em>name</em></code>.) 597 <p> 598 * 599</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 600The native C++ implementation of this method defines a default argument 601value. In the documentation generated for different libSBML language 602bindings, you may or may not see corresponding arguments in the method 603declarations. For example, in Java and C#, a default argument is handled by 604declaring two separate methods, with one of them having the argument and 605the other one lacking the argument. However, the libSBML documentation will 606be <em>identical</em> for both methods. Consequently, if you are reading 607this and do not see an argument even though one is described, please look 608for descriptions of other variants of this method near where this one 609appears in the documentation. 610</dd></dl> 611 612 */ public 613 void startElement(String name, String prefix) { 614 libsbmlJNI.XMLOutputStream_startElement__SWIG_0(swigCPtr, this, name, prefix); 615 } 616 617 618/** 619 * Writes the given XML start element name to this {@link XMLOutputStream}. 620 <p> 621 * @param name the name of the element. 622 <p> 623 * @param prefix an optional XML namespace prefix to write in front of the 624 * <code>element</code> name. (The result has the form 625 * <code><em>prefix</em>:<em>name</em></code>.) 626 <p> 627 * 628</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 629The native C++ implementation of this method defines a default argument 630value. In the documentation generated for different libSBML language 631bindings, you may or may not see corresponding arguments in the method 632declarations. For example, in Java and C#, a default argument is handled by 633declaring two separate methods, with one of them having the argument and 634the other one lacking the argument. However, the libSBML documentation will 635be <em>identical</em> for both methods. Consequently, if you are reading 636this and do not see an argument even though one is described, please look 637for descriptions of other variants of this method near where this one 638appears in the documentation. 639</dd></dl> 640 641 */ public 642 void startElement(String name) { 643 libsbmlJNI.XMLOutputStream_startElement__SWIG_1(swigCPtr, this, name); 644 } 645 646 647/** 648 * Writes the given XML start element 649 * <code><em>prefix</em>:<em>name</em></code> on this output stream. 650 <p> 651 * @param triple the start element to write. 652 */ public 653 void startElement(XMLTriple triple) { 654 libsbmlJNI.XMLOutputStream_startElement__SWIG_2(swigCPtr, this, XMLTriple.getCPtr(triple), triple); 655 } 656 657 658/** 659 * Writes the given XML start and end element name to this {@link XMLOutputStream}. 660 <p> 661 * @param name the name of the element. 662 <p> 663 * @param prefix an optional XML namespace prefix to write in front of the 664 * <code>element</code> name. (The result has the form 665 * <code><em>prefix</em>:<em>name</em></code>.) 666 <p> 667 * 668</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 669The native C++ implementation of this method defines a default argument 670value. In the documentation generated for different libSBML language 671bindings, you may or may not see corresponding arguments in the method 672declarations. For example, in Java and C#, a default argument is handled by 673declaring two separate methods, with one of them having the argument and 674the other one lacking the argument. However, the libSBML documentation will 675be <em>identical</em> for both methods. Consequently, if you are reading 676this and do not see an argument even though one is described, please look 677for descriptions of other variants of this method near where this one 678appears in the documentation. 679</dd></dl> 680 681 */ public 682 void startEndElement(String name, String prefix) { 683 libsbmlJNI.XMLOutputStream_startEndElement__SWIG_0(swigCPtr, this, name, prefix); 684 } 685 686 687/** 688 * Writes the given XML start and end element name to this {@link XMLOutputStream}. 689 <p> 690 * @param name the name of the element. 691 <p> 692 * @param prefix an optional XML namespace prefix to write in front of the 693 * <code>element</code> name. (The result has the form 694 * <code><em>prefix</em>:<em>name</em></code>.) 695 <p> 696 * 697</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 698The native C++ implementation of this method defines a default argument 699value. In the documentation generated for different libSBML language 700bindings, you may or may not see corresponding arguments in the method 701declarations. For example, in Java and C#, a default argument is handled by 702declaring two separate methods, with one of them having the argument and 703the other one lacking the argument. However, the libSBML documentation will 704be <em>identical</em> for both methods. Consequently, if you are reading 705this and do not see an argument even though one is described, please look 706for descriptions of other variants of this method near where this one 707appears in the documentation. 708</dd></dl> 709 710 */ public 711 void startEndElement(String name) { 712 libsbmlJNI.XMLOutputStream_startEndElement__SWIG_1(swigCPtr, this, name); 713 } 714 715 716/** 717 * Writes the given start element to this output stream. 718 <p> 719 * @param triple the XML element to write. 720 */ public 721 void startEndElement(XMLTriple triple) { 722 libsbmlJNI.XMLOutputStream_startEndElement__SWIG_2(swigCPtr, this, XMLTriple.getCPtr(triple), triple); 723 } 724 725 726/** 727 * Writes the given attribute and value to this output stream. 728 <p> 729 * @param name the name of the attribute. 730 <p> 731 * @param value the value of the attribute. 732 */ public 733 void writeAttribute(String name, String value) { 734 libsbmlJNI.XMLOutputStream_writeAttribute__SWIG_0(swigCPtr, this, name, value); 735 } 736 737 738/** 739 * Writes the given namespace-prefixed attribute value to this output stream. 740 <p> 741 * @param name the name of the attribute. 742 <p> 743 * @param prefix an XML namespace prefix to write in front of the 744 * <code>element</code> name. (The result has the form 745 * <code><em>prefix</em>:<em>name</em></code>.) See other versions of 746 * this method for a variant that does not require a prefix. 747 <p> 748 * @param value the value of the attribute. 749 */ public 750 void writeAttribute(String name, String prefix, String value) { 751 libsbmlJNI.XMLOutputStream_writeAttribute__SWIG_1(swigCPtr, this, name, prefix, value); 752 } 753 754 755/** 756 * Writes the given attribute and value to this output stream. 757 <p> 758 * @param triple the attribute, in the form of an {@link XMLTriple}. 759 <p> 760 * @param value the value of the attribute. 761 */ public 762 void writeAttribute(XMLTriple triple, String value) { 763 libsbmlJNI.XMLOutputStream_writeAttribute__SWIG_2(swigCPtr, this, XMLTriple.getCPtr(triple), triple, value); 764 } 765 766 767/** 768 * Writes the given attribute and value to this output stream. 769 <p> 770 * @param name the name of the attribute. 771 <p> 772 * @param value the value of the attribute. 773 */ public 774 void writeAttribute(String name, boolean value) { 775 libsbmlJNI.XMLOutputStream_writeAttribute__SWIG_6(swigCPtr, this, name, value); 776 } 777 778 779/** 780 * Writes the given namespace-prefixed attribute value to this output stream. 781 <p> 782 * @param name the name of the attribute. 783 <p> 784 * @param prefix an XML namespace prefix to write in front of the 785 * <code>element</code> name. (The result has the form 786 * <code><em>prefix</em>:<em>name</em></code>.) See other versions of 787 * this method for a variant that does not require a prefix. 788 <p> 789 * @param value the value of the attribute. 790 */ public 791 void writeAttribute(String name, String prefix, boolean value) { 792 libsbmlJNI.XMLOutputStream_writeAttribute__SWIG_7(swigCPtr, this, name, prefix, value); 793 } 794 795 796/** 797 * Writes the given attribute and value to this output stream. 798 <p> 799 * @param triple the attribute, in the form of an {@link XMLTriple}. 800 <p> 801 * @param value the value of the attribute. 802 */ public 803 void writeAttribute(XMLTriple triple, boolean value) { 804 libsbmlJNI.XMLOutputStream_writeAttribute__SWIG_8(swigCPtr, this, XMLTriple.getCPtr(triple), triple, value); 805 } 806 807 808/** 809 * Writes the given attribute and value to this output stream. 810 <p> 811 * @param name the name of the attribute. 812 <p> 813 * @param value the value of the attribute. 814 */ public 815 void writeAttribute(String name, double value) { 816 libsbmlJNI.XMLOutputStream_writeAttribute__SWIG_9(swigCPtr, this, name, value); 817 } 818 819 820/** 821 * Writes the given namespace-prefixed attribute value to this output stream. 822 <p> 823 * @param name the name of the attribute. 824 <p> 825 * @param prefix an XML namespace prefix to write in front of the 826 * <code>element</code> name. (The result has the form 827 * <code><em>prefix</em>:<em>name</em></code>.) See other versions of 828 * this method for a variant that does not require a prefix. 829 <p> 830 * @param value the value of the attribute. 831 */ public 832 void writeAttribute(String name, String prefix, double value) { 833 libsbmlJNI.XMLOutputStream_writeAttribute__SWIG_10(swigCPtr, this, name, prefix, value); 834 } 835 836 837/** 838 * Writes the given attribute and value to this output stream. 839 <p> 840 * @param triple the attribute, in the form of an {@link XMLTriple}. 841 <p> 842 * @param value the value of the attribute. 843 */ public 844 void writeAttribute(XMLTriple triple, double value) { 845 libsbmlJNI.XMLOutputStream_writeAttribute__SWIG_11(swigCPtr, this, XMLTriple.getCPtr(triple), triple, value); 846 } 847 848 849/** 850 * Writes the given attribute and value to this output stream. 851 <p> 852 * @param name the name of the attribute. 853 <p> 854 * @param value the value of the attribute. 855 */ public 856 void writeAttribute(String name, int value) { 857 libsbmlJNI.XMLOutputStream_writeAttribute__SWIG_12(swigCPtr, this, name, value); 858 } 859 860 861/** 862 * Writes the given namespace-prefixed attribute value to this output stream. 863 <p> 864 * @param name the name of the attribute. 865 <p> 866 * @param prefix an XML namespace prefix to write in front of the 867 * <code>element</code> name. (The result has the form 868 * <code><em>prefix</em>:<em>name</em></code>.) See other versions of 869 * this method for a variant that does not require a prefix. 870 <p> 871 * @param value the value of the attribute. 872 */ public 873 void writeAttribute(String name, String prefix, int value) { 874 libsbmlJNI.XMLOutputStream_writeAttribute__SWIG_13(swigCPtr, this, name, prefix, value); 875 } 876 877 878/** 879 * Writes the given attribute and value to this output stream. 880 <p> 881 * @param triple the attribute, in the form of an {@link XMLTriple}. 882 <p> 883 * @param value the value of the attribute. 884 */ public 885 void writeAttribute(XMLTriple triple, int value) { 886 libsbmlJNI.XMLOutputStream_writeAttribute__SWIG_14(swigCPtr, this, XMLTriple.getCPtr(triple), triple, value); 887 } 888 889 890/** 891 * Writes the given namespace-prefixed attribute value to this output stream. 892 <p> 893 * @param name the name of the attribute. 894 <p> 895 * @param prefix an XML namespace prefix to write in front of the 896 * <code>element</code> name. (The result has the form 897 * <code><em>prefix</em>:<em>name</em></code>.) See other versions of 898 * this method for a variant that does not require a prefix. 899 <p> 900 * @param value the value of the attribute. 901 */ public 902 void writeAttribute(String name, String prefix, long value) { 903 libsbmlJNI.XMLOutputStream_writeAttribute__SWIG_18(swigCPtr, this, name, prefix, value); 904 } 905 906 907/** 908 * Writes a standard XML declaration to this output stream. 909 <p> 910 * <p> 911 * The XML declaration has the form 912 * <pre class='fragment'> 913<?xml version='1.0' encoding='UTF-8'?> 914</pre> 915 * Note that the SBML specifications require the use of UTF-8 encoding and 916 * version 1.0, so for SBML documents, the above is the standard XML 917 * declaration. 918 */ public 919 void writeXMLDecl() { 920 libsbmlJNI.XMLOutputStream_writeXMLDecl(swigCPtr, this); 921 } 922 923 924/** 925 * Writes an XML comment with the name and version of this program. 926 <p> 927 * The XML comment has the following form: 928 * <pre class='fragment'> 929<!-- Created by <program name> version <program version> 930on yyyy-MM-dd HH:mm with libSBML version <libsbml version>. --> 931</pre> 932 <p> 933 * See the class constructor for more information about this program 934 * comment. 935 <p> 936 * @param programName an optional program name to write as a comment 937 * in the output stream. 938 <p> 939 * @param programVersion an optional version identification string to write 940 * as a comment in the output stream. 941 */ public 942 void writeComment(String programName, String programVersion) { 943 libsbmlJNI.XMLOutputStream_writeComment(swigCPtr, this, programName, programVersion); 944 } 945 946 947/** 948 * Decreases the indentation level for this {@link XMLOutputStream}. 949 <p> 950 * <p> 951 * LibSBML tries to produce human-readable XML output by automatically 952 * indenting the bodies of elements. Callers can manually control 953 * indentation further by using the {@link XMLOutputStream#upIndent()} 954 * and {@link XMLOutputStream#downIndent()} methods to increase and 955 * decrease, respectively, the current level of indentation in the 956 * XML output. 957 <p> 958 * @see #upIndent() 959 */ public 960 void downIndent() { 961 libsbmlJNI.XMLOutputStream_downIndent(swigCPtr, this); 962 } 963 964 965/** 966 * Increases the indentation level for this {@link XMLOutputStream}. 967 <p> 968 * <p> 969 * LibSBML tries to produce human-readable XML output by automatically 970 * indenting the bodies of elements. Callers can manually control 971 * indentation further by using the {@link XMLOutputStream#upIndent()} 972 * and {@link XMLOutputStream#downIndent()} methods to increase and 973 * decrease, respectively, the current level of indentation in the 974 * XML output. 975 <p> 976 * @see #downIndent() 977 */ public 978 void upIndent() { 979 libsbmlJNI.XMLOutputStream_upIndent(swigCPtr, this); 980 } 981 982 983/** 984 * Returns the {@link SBMLNamespaces} object attached to this output stream. 985 <p> 986 * @return the {@link SBMLNamespaces} object, or <code>null</code> if none has been set. 987 */ public 988 SBMLNamespaces getSBMLNamespaces() { 989 return libsbml.DowncastSBMLNamespaces(libsbmlJNI.XMLOutputStream_getSBMLNamespaces(swigCPtr, this), false); 990} 991 992 993/** 994 * Sets the {@link SBMLNamespaces} object associated with this output stream. 995 <p> 996 * @param sbmlns the namespace object. 997 */ public 998 void setSBMLNamespaces(SBMLNamespaces sbmlns) { 999 libsbmlJNI.XMLOutputStream_setSBMLNamespaces(swigCPtr, this, SBMLNamespaces.getCPtr(sbmlns), sbmlns); 1000 } 1001 1002}