001/* ---------------------------------------------------------------------------- 002 * This file was automatically generated by SWIG (http://www.swig.org). 003 * Version 2.0.11 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 * 013 * Container for an SBML document and interface for global operations 014 * on SBML documents. 015 * <p> 016 * LibSBML uses the class {@link SBMLDocument} as a top-level 017 * container for storing SBML content and data associated with it (such as 018 * warnings and error messages). The two primary means of reading an SBML 019 * model, {@link SBMLReader#readSBML(String filename)} and 020 * {@link SBMLReader#readSBMLFromString(String xml)}, both return an {@link SBMLDocument} 021 * object. From there, callers can inquire about any errors encountered 022 * (e.g., using {@link SBMLDocument#getNumErrors()}), access the {@link Model} object, and 023 * perform other actions such as consistency-checking and model 024 * translation. 025 * <p> 026 * <p> 027 * When creating fresh models programmatically, the starting point is 028 * typically the creation of an {@link SBMLDocument} object instance. The 029 * {@link SBMLDocument} constructor accepts arguments for the SBML Level and 030 * Version of the model to be created. After creating the {@link SBMLDocument} 031 * object, calling programs then typically call {@link SBMLDocument#createModel()} 032 * almost immediately, and then proceed to call the methods on the {@link Model} 033 * object to fill out the model's contents. 034 * <p> 035 * {@link SBMLDocument} corresponds roughly to the class <i>Sbml</i> defined in the 036 * SBML Level 2 specification and <i>SBML</i> in the Level 3 037 * specification. It does not have a direct correspondence in SBML 038 * Level 1. (However, to make matters simpler for applications, 039 * libSBML creates an {@link SBMLDocument} no matter whether the model is 040 * Level 1, Level 2 or Level 3.) In its barest form, when written out in 041 * XML format for (e.g.) SBML Level 2 Version 4, the corresponding 042 * structure is the following: 043 * <div class='fragment'><pre> 044<sbml xmlns='http://www.sbml.org/sbml/level2/version4' level='2' version='4'> 045 ... 046</sbml></pre></div> 047 * <p> 048 * {@link SBMLDocument} is derived from {@link SBase}, and therefore contains the usual {@link SBase} 049 * attributes (in SBML Level 2 and Level 3) of 'metaid' and 'sboTerm', as 050 * well as the subelements 'notes' and 'annotation'. It also contains the 051 * attributes 'level' and 'version' indicating the Level and Version of the 052 * SBML data structure. These can be accessed using the methods defined by 053 * the {@link SBase} class for that purpose. 054 * <p> 055 * <h2>Checking consistency and adherence to SBML specifications</h2> 056 * <p> 057 * One of the most important features of libSBML is its ability to perform 058 * SBML validation to ensure that a model adheres to the SBML specification 059 * for whatever Level+Version combination the model uses. {@link SBMLDocument} 060 * provides the methods for running consistency-checking and validation 061 * rules on the SBML content. 062 * <p> 063 * First, a brief explanation of the rationale is in order. In libSBML 064 * versions up to and including the version 3.3.x series, the 065 * individual methods for creating and setting attributes and other 066 * components were quite lenient, and allowed a caller to compose SBML 067 * entities that might not, in the end, represent valid SBML. This allowed 068 * applications the freedom to do things such as save incomplete models 069 * (which is useful when models are being developed over long periods of 070 * time). In the version 4.x series, libSBML is somewhat stricter, 071 * but still permits structures to be created independently and the results 072 * to be combined in a separate step. In all these cases, it means that a 073 * separate validation step is necessary when a calling program finally 074 * wants to finish a complete SBML document. 075 * <p> 076 * The primary interface to this validation facility is {@link SBMLDocument}'s 077 * {@link SBMLDocument#checkInternalConsistency()} and 078 * {@link SBMLDocument#checkConsistency()}. The former verifies the basic 079 * internal consistency and syntax of an SBML document, and the latter 080 * implements more elaborate validation rules (both those defined by the 081 * SBML specifications, as well as additional rules offered by libSBML). 082 * <p> 083 * The checks performed by {@link SBMLDocument#checkInternalConsistency()} are 084 * hardwired and cannot be changed by calling programs, but the validation 085 * performed by {@link SBMLDocument#checkConsistency()} is under program control 086 * using the method {@link SBMLDocument#setConsistencyChecks(int categ, boolean 087 * onoff)}. Applications can selectively disable specific kinds of checks 088 * that they may not be interested by calling 089 * {@link SBMLDocument#setConsistencyChecks(int categ, boolean onoff)} with 090 * appropriate parameters. 091 * <p> 092 * <p> 093 * These methods have slightly different relevance depending on whether a 094 * model is created programmaticaly from scratch, or whether it is read in 095 * from a file or data stream. The following list summarizes the possible 096 * scenarios. 097 * <p> 098 * <em>Scenario 1: Creating a model from scratch</em>. Before writing out 099 * the model, 100 * <p> 101 * <ul> 102 * <li> Call {@link SBMLDocument#checkInternalConsistency()}, then inquire about 103 * the results by calling {@link SBMLDocument#getNumErrors()} 104 * </ul> 105 * <p> 106 * <ul> 107 * <li> Call {@link SBMLDocument#setConsistencyChecks(int categ, boolean 108 * onoff)} to configure 109 * which checks will be performed by {@link SBMLDocument#checkConsistency()} 110 * </ul> 111 * <p> 112 * <ul> 113 * <li> Call {@link SBMLDocument#checkConsistency()}, then inquire about the results by 114 * calling {@link SBMLDocument#getNumErrors()} 115 * </ul> 116 * <p> 117 * <em>Scenario 2: Reading a model from a file or data stream.</em> After 118 * reading the model, 119 * <p> 120 * <ul> 121 * <li> Basic consistency checks will have been performed automatically by 122 * libSBML upon reading the content, so you only need to inquire about the 123 * results by using {@link SBMLDocument#getNumErrors()} 124 * </ul> 125 * <p> 126 * <ul> 127 * <li> Call {@link SBMLDocument#setConsistencyChecks(int categ, boolean 128 * onoff)} to configure 129 * which checks are performed by {@link SBMLDocument#checkConsistency()} 130 * </ul> 131 * <p> 132 * <ul> 133 * <li> Call {@link SBMLDocument#checkConsistency()}, then inquire about the results 134 * by calling {@link SBMLDocument#getNumErrors()} 135 * </ul> 136 * <p> 137 * <p> 138 * <p> 139 * <h2>Converting documents between Levels and Versions of SBML</h2> 140 * <p> 141 * LibSBML provides facilities for limited translation of SBML between 142 * Levels and Versions of the SBML specifications. The method for doing is 143 * is {@link SBMLDocument#setLevelAndVersion(long lev, long ver, boolean strict)} . In 144 * general, models can be converted upward without difficulty (e.g., from 145 * SBML Level 1 to Level 2, or from an earlier Version of 146 * Level 2 to the latest Version of Level 2). Sometimes models 147 * can be translated downward as well, if they do not use constructs 148 * specific to more advanced Levels of SBML. 149 * <p> 150 * Calling {@link SBMLDocument#setLevelAndVersion(long lev, long ver, boolean strict)} will not <em>necessarily</em> lead 151 * to a successful conversion. The method will return a boolean value 152 * to indicate success or failure. Callers must check the error log (see 153 * next section) attached to the {@link SBMLDocument} object after calling 154 * {@link SBMLDocument#setLevelAndVersion(long lev, long ver)} in order to assess whether any 155 * problems arose. 156 * <p> 157 * If an application is interested in translating to a lower Level and/or 158 * Version of SBML within a Level, the following methods allow for prior 159 * assessment of whether there is sufficient compatibility to make a 160 * translation possible: 161 * <ul> 162 * <li> {@link SBMLDocument#checkL1Compatibility()}, 163 * <li> {@link SBMLDocument#checkL2v1Compatibility()}, 164 * <li> {@link SBMLDocument#checkL2v2Compatibility()}, 165 * <li> {@link SBMLDocument#checkL2v3Compatibility()}, 166 * <li> {@link SBMLDocument#checkL2v4Compatibility()}, and 167 * <li> {@link SBMLDocument#checkL3v1Compatibility()}. 168 * </ul> 169 * <p> 170 * Some changes between Versions of SBML Level 2 may lead to 171 * unexpected behaviors when attempting conversions in either direction. 172 * For example, SBML Level 2 Version 4 relaxed the requirement 173 * for consistency in units of measurement between expressions annd 174 * quantities in a model. As a result, a model written in Version 4, 175 * if converted to Version 3 with no other changes, may fail 176 * validation as a Version 3 model because Version 3 imposed 177 * stricter requirements on unit consistency. 178 * <p> 179 * Other changes between SBML Level 2 and Level 3 make downward conversions 180 * challenging. In some cases, it means that a model converted to 181 * Level 2 from Level 3 will contain attributes that were not 182 * explicitly given in the Level 3 model, because in Level 2 183 * these attributes may have been optional or have default values. 184 * <p> 185 * <h2>Error handling</h2> 186 * <p> 187 * Upon reading a model, {@link SBMLDocument} logs any problems encountered while 188 * reading the model from the file or data stream. The log contains 189 * objects that record diagnostic information about any notable issues that 190 * arose. Whether the problems are warnings or errors, they are both 191 * reported through a single common interface involving the object class 192 * {@link SBMLError}. 193 * <p> 194 * The methods {@link SBMLDocument#getNumErrors()}, {@link SBMLDocument#getError(long n)} and 195 * {@link SBMLDocument#printErrors()} allow callers to interact with the warnings 196 * or errors logged. Alternatively, callers may retrieve the entire log as 197 * an {@link SBMLErrorLog} object using the method {@link SBMLDocument#getErrorLog()}. 198 * The {@link SBMLErrorLog} object provides some alternative methods for 199 * interacting with the set of errors and warnings. In either case, 200 * applications typically should first call {@link SBMLDocument#getNumErrors()} to 201 * find out if any issues have been logged after specific libSBML 202 * operations such as the ones discussed in the sections above. If they 203 * have, then an application will should proceed to inspect the individual 204 * reports using either the direct interfaces on {@link SBMLDocument} or using the 205 * methods on the {@link SBMLErrorLog} object. 206 * <p> 207 * <p> 208 * <p> 209 */ 210 211public class SBMLDocument extends SBase { 212 private long swigCPtr; 213 214 protected SBMLDocument(long cPtr, boolean cMemoryOwn) 215 { 216 super(libsbmlJNI.SBMLDocument_SWIGUpcast(cPtr), cMemoryOwn); 217 swigCPtr = cPtr; 218 } 219 220 protected static long getCPtr(SBMLDocument obj) 221 { 222 return (obj == null) ? 0 : obj.swigCPtr; 223 } 224 225 protected static long getCPtrAndDisown (SBMLDocument obj) 226 { 227 long ptr = 0; 228 229 if (obj != null) 230 { 231 ptr = obj.swigCPtr; 232 obj.swigCMemOwn = false; 233 } 234 235 return ptr; 236 } 237 238 protected void finalize() { 239 delete(); 240 } 241 242 public synchronized void delete() { 243 if (swigCPtr != 0) { 244 if (swigCMemOwn) { 245 swigCMemOwn = false; 246 libsbmlJNI.delete_SBMLDocument(swigCPtr); 247 } 248 swigCPtr = 0; 249 } 250 super.delete(); 251 } 252 253 254/** 255 * The default SBML Level of new {@link SBMLDocument} objects. 256 * <p> 257 * This 'default Level' corresponds to the most recent SBML specification 258 * Level available at the time libSBML version 5.8.0 259 260 * was released. For this copy of libSBML, the value is <code>3</code>. 261 * The default Level is used by {@link SBMLDocument} if no Level is explicitly 262 * specified at the time of the construction of an {@link SBMLDocument} instance. 263 * <p> 264 * @return an integer indicating the most recent SBML specification Level 265 * <p> 266 * @note Because this is a <em>static</em> method, the 267 * non-C++ language interfaces for libSBML will contain two variants. One 268 * will be a static method on the class (i.e., {@link SBMLDocument}), and the 269 * other will be a standalone top-level function with the name 270 * SBMLDocument_getDefaultLevel(). They are functionally 271 * identical. 272 * <p> 273 * @see SBMLDocument#getDefaultVersion() 274 */ public 275 static long getDefaultLevel() { 276 return libsbmlJNI.SBMLDocument_getDefaultLevel(); 277 } 278 279 280/** 281 * The default Version of new {@link SBMLDocument} objects. 282 * <p> 283 * This 'default Version' corresponds to the most recent Version 284 * within the most recent Level of SBML available at the time libSBML 285 * version 5.8.0 286 287 * was released. For this copy of libSBML, the value is <code>1</code> 288 * (where the default Level of SBML is <code>3</code>). The default 289 * Version is used by {@link SBMLDocument} if no Version is explicitly specified 290 * at the time of the construction of an {@link SBMLDocument} instance. 291 * <p> 292 * @return an integer indicating the most recent SBML specification 293 * Version 294 * <p> 295 * @note Because this is a <em>static</em> method, the 296 * non-C++ language interfaces for libSBML will contain two variants. One 297 * will be a static method on the class (i.e., {@link SBMLDocument}), and the 298 * other will be a standalone top-level function with the name 299 * SBMLDocument_getDefaultVersion(). They are functionally 300 * identical. 301 * <p> 302 * @see SBMLDocument#getDefaultLevel() 303 */ public 304 static long getDefaultVersion() { 305 return libsbmlJNI.SBMLDocument_getDefaultVersion(); 306 } 307 308 309/** 310 * Creates a new {@link SBMLDocument}, optionally with given values for the SBML 311 * Level and Version. 312 * <p> 313 * If <em>both</em> the SBML Level and Version attributes are not 314 * specified, the SBML document is treated as having the latest Level and 315 * Version of SBML as determined by {@link SBMLDocument#getDefaultLevel()} and 316 * {@link SBMLDocument#getDefaultVersion()}; <em>however</em>, the {@link SBMLDocument} 317 * object is otherwise left blank. In particular, the blank {@link SBMLDocument} 318 * object has no associated XML attributes, including (but not limited 319 * to) an XML namespace declaration. The XML namespace declaration is 320 * not added until the model is written out, <em>or</em> the method 321 * {@link SBMLDocument#setLevelAndVersion(long lev, long ver, boolean strict)} 322 * is called. This may be important to keep in mind 323 * if an application needs to add additional XML namespace declarations 324 * on the <code><sbml></code> element. Application writers should 325 * either provide values for <code>level</code> and <code>version</code> on the call to this 326 * constructor, or else call 327 * {@link SBMLDocument#setLevelAndVersion(long lev, long ver, boolean strict)} 328 * shortly after creating the {@link SBMLDocument} object. 329 * <p> 330 * @param level an integer for the SBML Level 331 * <p> 332 * @param version an integer for the Version within the SBML Level 333 * <p> 334 * @throws SBMLConstructorException 335 * Thrown if the given <code>level</code> and <code>version</code> combination, or this kind 336 * of SBML object, are either invalid or mismatched with respect to the 337 * parent {@link SBMLDocument} object. 338 * <p> 339 * <!-- Don't remove the leading </dl> below. It's a hack for javadoc. --> 340</dl><dl class='docnote'><dt><b>Documentation note:</b></dt><dd> 341The native C++ implementation of this method defines a default argument 342value. In the documentation generated for different libSBML language 343bindings, you may or may not see corresponding arguments in the method 344declarations. For example, in Java and C#, a default argument is handled by 345declaring two separate methods, with one of them having the argument and 346the other one lacking the argument. However, the libSBML documentation will 347be <em>identical</em> for both methods. Consequently, if you are reading 348this and do not see an argument even though one is described, please look 349for descriptions of other variants of this method near where this one 350appears in the documentation. 351</dd></dl> 352 353 * <p> 354 * @see SBMLDocument#setLevelAndVersion(long lev, long ver, boolean strict) 355 * @see #getDefaultLevel() 356 * @see #getDefaultVersion() 357 */ public 358 SBMLDocument(long level, long version) throws org.sbml.libsbml.SBMLConstructorException { 359 this(libsbmlJNI.new_SBMLDocument__SWIG_0(level, version), true); 360 } 361 362 363/** 364 * Creates a new {@link SBMLDocument}, optionally with given values for the SBML 365 * Level and Version. 366 * <p> 367 * If <em>both</em> the SBML Level and Version attributes are not 368 * specified, the SBML document is treated as having the latest Level and 369 * Version of SBML as determined by {@link SBMLDocument#getDefaultLevel()} and 370 * {@link SBMLDocument#getDefaultVersion()}; <em>however</em>, the {@link SBMLDocument} 371 * object is otherwise left blank. In particular, the blank {@link SBMLDocument} 372 * object has no associated XML attributes, including (but not limited 373 * to) an XML namespace declaration. The XML namespace declaration is 374 * not added until the model is written out, <em>or</em> the method 375 * {@link SBMLDocument#setLevelAndVersion(long lev, long ver, boolean strict)} 376 * is called. This may be important to keep in mind 377 * if an application needs to add additional XML namespace declarations 378 * on the <code><sbml></code> element. Application writers should 379 * either provide values for <code>level</code> and <code>version</code> on the call to this 380 * constructor, or else call 381 * {@link SBMLDocument#setLevelAndVersion(long lev, long ver, boolean strict)} 382 * shortly after creating the {@link SBMLDocument} object. 383 * <p> 384 * @param level an integer for the SBML Level 385 * <p> 386 * @param version an integer for the Version within the SBML Level 387 * <p> 388 * @throws SBMLConstructorException 389 * Thrown if the given <code>level</code> and <code>version</code> combination, or this kind 390 * of SBML object, are either invalid or mismatched with respect to the 391 * parent {@link SBMLDocument} object. 392 * <p> 393 * <!-- Don't remove the leading </dl> below. It's a hack for javadoc. --> 394</dl><dl class='docnote'><dt><b>Documentation note:</b></dt><dd> 395The native C++ implementation of this method defines a default argument 396value. In the documentation generated for different libSBML language 397bindings, you may or may not see corresponding arguments in the method 398declarations. For example, in Java and C#, a default argument is handled by 399declaring two separate methods, with one of them having the argument and 400the other one lacking the argument. However, the libSBML documentation will 401be <em>identical</em> for both methods. Consequently, if you are reading 402this and do not see an argument even though one is described, please look 403for descriptions of other variants of this method near where this one 404appears in the documentation. 405</dd></dl> 406 407 * <p> 408 * @see SBMLDocument#setLevelAndVersion(long lev, long ver, boolean strict) 409 * @see #getDefaultLevel() 410 * @see #getDefaultVersion() 411 */ public 412 SBMLDocument(long level) throws org.sbml.libsbml.SBMLConstructorException { 413 this(libsbmlJNI.new_SBMLDocument__SWIG_1(level), true); 414 } 415 416 417/** 418 * Creates a new {@link SBMLDocument}, optionally with given values for the SBML 419 * Level and Version. 420 * <p> 421 * If <em>both</em> the SBML Level and Version attributes are not 422 * specified, the SBML document is treated as having the latest Level and 423 * Version of SBML as determined by {@link SBMLDocument#getDefaultLevel()} and 424 * {@link SBMLDocument#getDefaultVersion()}; <em>however</em>, the {@link SBMLDocument} 425 * object is otherwise left blank. In particular, the blank {@link SBMLDocument} 426 * object has no associated XML attributes, including (but not limited 427 * to) an XML namespace declaration. The XML namespace declaration is 428 * not added until the model is written out, <em>or</em> the method 429 * {@link SBMLDocument#setLevelAndVersion(long lev, long ver, boolean strict)} 430 * is called. This may be important to keep in mind 431 * if an application needs to add additional XML namespace declarations 432 * on the <code><sbml></code> element. Application writers should 433 * either provide values for <code>level</code> and <code>version</code> on the call to this 434 * constructor, or else call 435 * {@link SBMLDocument#setLevelAndVersion(long lev, long ver, boolean strict)} 436 * shortly after creating the {@link SBMLDocument} object. 437 * <p> 438 * @param level an integer for the SBML Level 439 * <p> 440 * @param version an integer for the Version within the SBML Level 441 * <p> 442 * @throws SBMLConstructorException 443 * Thrown if the given <code>level</code> and <code>version</code> combination, or this kind 444 * of SBML object, are either invalid or mismatched with respect to the 445 * parent {@link SBMLDocument} object. 446 * <p> 447 * <!-- Don't remove the leading </dl> below. It's a hack for javadoc. --> 448</dl><dl class='docnote'><dt><b>Documentation note:</b></dt><dd> 449The native C++ implementation of this method defines a default argument 450value. In the documentation generated for different libSBML language 451bindings, you may or may not see corresponding arguments in the method 452declarations. For example, in Java and C#, a default argument is handled by 453declaring two separate methods, with one of them having the argument and 454the other one lacking the argument. However, the libSBML documentation will 455be <em>identical</em> for both methods. Consequently, if you are reading 456this and do not see an argument even though one is described, please look 457for descriptions of other variants of this method near where this one 458appears in the documentation. 459</dd></dl> 460 461 * <p> 462 * @see SBMLDocument#setLevelAndVersion(long lev, long ver, boolean strict) 463 * @see #getDefaultLevel() 464 * @see #getDefaultVersion() 465 */ public 466 SBMLDocument() throws org.sbml.libsbml.SBMLConstructorException { 467 this(libsbmlJNI.new_SBMLDocument__SWIG_2(), true); 468 } 469 470 471/** 472 * Creates a new {@link SBMLDocument} using the given {@link SBMLNamespaces} object 473 * <code>sbmlns</code>. 474 * <p> 475 * The {@link SBMLNamespaces} object encapsulates SBML Level/Version/namespaces 476 * information. It is used to communicate the SBML Level, Version, and 477 * (in Level 3) packages used in addition to SBML Level 3 Core. 478 * A common approach to using this class constructor is to create an 479 * {@link SBMLNamespaces} object somewhere in a program, once, then pass it to 480 * object constructors such as this one when needed. 481 * <p> 482 * @param sbmlns an {@link SBMLNamespaces} object. 483 * <p> 484 * @throws SBMLConstructorException 485 * Thrown if the given <code>level</code> and <code>version</code> combination, or this kind 486 * of SBML object, are either invalid or mismatched with respect to the 487 * parent {@link SBMLDocument} object. 488 */ public 489 SBMLDocument(SBMLNamespaces sbmlns) throws org.sbml.libsbml.SBMLConstructorException { 490 this(libsbmlJNI.new_SBMLDocument__SWIG_3(SBMLNamespaces.getCPtr(sbmlns), sbmlns), true); 491 } 492 493 494/** 495 * Copy constructor; creates a copy of this {@link SBMLDocument}. 496 * <p> 497 * @param orig the object to copy. 498 * <p> 499 * @throws SBMLConstructorException 500 * Thrown if the argument <code>orig</code> is <code>null.</code> 501 */ public 502 SBMLDocument(SBMLDocument orig) throws org.sbml.libsbml.SBMLConstructorException { 503 this(libsbmlJNI.new_SBMLDocument__SWIG_4(SBMLDocument.getCPtr(orig), orig), true); 504 } 505 506 507/** 508 * Creates and returns a deep copy of this {@link SBMLDocument}. 509 * <p> 510 * @return a (deep) copy of this {@link SBMLDocument}. 511 */ public 512 SBMLDocument cloneObject() { 513 long cPtr = libsbmlJNI.SBMLDocument_cloneObject(swigCPtr, this); 514 return (cPtr == 0) ? null : new SBMLDocument(cPtr, true); 515 } 516 517 518/** 519 * Returns the {@link Model} object stored in this {@link SBMLDocument}. 520 * <p> 521 * It is important to note that this method <em>does not create</em> a 522 * {@link Model} instance. The model in the {@link SBMLDocument} must have been created 523 * at some prior time, for example using {@link SBMLDocument#createModel()} 524 * or {@link SBMLDocument#setModel(Model m)}. 525 * This method returns <code>null</code> if a model does not yet exist. 526 * <p> 527 * @return the {@link Model} contained in this {@link SBMLDocument}. 528 * <p> 529 * @see #createModel() 530 */ public 531 Model getModel() { 532 long cPtr = libsbmlJNI.SBMLDocument_getModel__SWIG_0(swigCPtr, this); 533 return (cPtr == 0) ? null : new Model(cPtr, false); 534 } 535 536 537/** 538 * Returns the first child element found that has the given <code>id</code> in the model-wide SId namespace, or <code>null</code> if no such object is found. 539 * <p> 540 * @param id string representing the id of objects to find 541 * <p> 542 * @return pointer to the first element found with the given <code>id</code>. 543 */ public 544 SBase getElementBySId(String id) { 545 return libsbml.DowncastSBase(libsbmlJNI.SBMLDocument_getElementBySId(swigCPtr, this, id), false); 546} 547 548 549/** 550 * Returns the first child element it can find with the given <code>metaid</code>, or itself if it has the given <code>metaid</code>, or <code>null</code> if no such object is found. 551 * <p> 552 * @param metaid string representing the metaid of objects to find 553 * <p> 554 * @return pointer to the first element found with the given <code>metaid</code>. 555 */ public 556 SBase getElementByMetaId(String metaid) { 557 return libsbml.DowncastSBase(libsbmlJNI.SBMLDocument_getElementByMetaId(swigCPtr, this, metaid), false); 558} 559 560 561/** 562 * Removes {@link FunctionDefinition} constructs from the document and expands 563 * any instances of their use within <code><math></code> elements. 564 * <p> 565 * For example, suppose a {@link Model} contains a {@link FunctionDefinition} with 566 * identifier <code>'f'</code> representing the math expression: <em>f(x, y) = x * 567 * y</em>. Suppose further that there is a reaction in which the 568 * <code><math></code> element of the {@link KineticLaw} object contains 569 * <code>f(s, p)</code>, where <code>s</code> and <code>p</code> are other identifiers 570 * defined in the model. The outcome of invoking this method is that the 571 * <code><math></code> of the {@link KineticLaw} now represents the 572 * expression <em>s * p</em> and the model no longer contains any 573 * {@link FunctionDefinition} objects. 574 * <p> 575 * @return bool <code>true</code> if the transformation was successful, 576 * <code>false</code>, otherwise. 577 * <p> 578 * @note This function will check the consistency of a model before 579 * attemptimg the transformation. If the model is not valid SBML, the 580 * transformation will not be performed and the function will return 581 * <code>false.</code> 582 */ public 583 boolean expandFunctionDefinitions() { 584 return libsbmlJNI.SBMLDocument_expandFunctionDefinitions(swigCPtr, this); 585 } 586 587 588/** 589 * Removes {@link InitialAssignment} constructs from the document and 590 * replaces them with appropriate values. 591 * <p> 592 * For example, suppose a {@link Model} contains a {@link InitialAssignment} to a symbol 593 * <code>'k'</code> where <code>'k'</code> is the identifier of a {@link Parameter}. The outcome of 594 * invoking this method is that the 'value' attribute of the {@link Parameter} 595 * definition is set to the result calculated using the {@link InitialAssignment} 596 * object's <code><math></code> formula, and the corresponding 597 * {@link InitialAssignment} is then removed from the {@link Model}. 598 * <p> 599 * @return bool <code>true</code> if the transformation was successful, 600 * <code>false</code>, otherwise. 601 * <p> 602 * @note This function will check the consistency of a model before 603 * attemptimg the transformation. If the model is not valid SBML, the 604 * transformation will not be performed and the function will return 605 * <code>false.</code> As part of that process, this method will check that it has 606 * values for any components referred to by the <code><math></code> 607 * elements of {@link InitialAssignment} objects. In cases where not all of the 608 * values have been declared (e.g., if the mathematical expression refers 609 * to model entities that have no declared values), the {@link InitialAssignment} 610 * in question will <em>not</em> be removed and this method will return 611 * <code>false.</code> 612 */ public 613 boolean expandInitialAssignments() { 614 return libsbmlJNI.SBMLDocument_expandInitialAssignments(swigCPtr, this); 615 } 616 617 618/** 619 * Sets the SBML Level and Version of this {@link SBMLDocument} instance, 620 * attempting to convert the model as needed. 621 * <p> 622 * This method is the principal way in libSBML to convert models between 623 * Levels and Versions of SBML. Generally, models can be converted 624 * upward without difficulty (e.g., from SBML Level 1 to 625 * Level 2, or from an earlier Version of Level 2 to the latest 626 * Version of Level 2). Sometimes models can be translated downward 627 * as well, if they do not use constructs specific to more advanced 628 * Levels of SBML. 629 * <p> 630 * Before calling this method, callers may check compatibility directly 631 * using the methods {@link SBMLDocument#checkL1Compatibility()}, 632 * {@link SBMLDocument#checkL2v1Compatibility()}, 633 * {@link SBMLDocument#checkL2v2Compatibility()}, 634 * {@link SBMLDocument#checkL2v3Compatibility()}, 635 * {@link SBMLDocument#checkL2v4Compatibility()}, and 636 * {@link SBMLDocument#checkL3v1Compatibility()}. 637 * <p> 638 * The valid combinations of SBML Level and Version as of this release 639 * of libSBML are the following: 640 * <ul> 641 * <li> Level 1 Version 2 642 * <li> Level 2 Version 1 643 * <li> Level 2 Version 2 644 * <li> Level 2 Version 3 645 * <li> Level 2 Version 4 646 * <li> Level 3 Version 1 647 * </ul> 648 * <p> 649 * Strict conversion applies the additional criteria that both the 650 * source and the target model must be consistent SBML. Users can 651 * control the consistency checks that are applied using the 652 * {@link SBMLDocument#setConsistencyChecksForConversion(int categ, boolean onoff)} method. If either 653 * the source or the potential target model have validation errors, the 654 * conversion is not performed. When a strict conversion is successful, 655 * the underlying SBML object model is altered to reflect the new level 656 * and version. Thus, information that cannot be converted 657 * (e.g. sboTerms) will be lost. 658 * <p> 659 * @param level the desired SBML Level 660 * <p> 661 * @param version the desired Version within the SBML Level 662 * <p> 663 * @param strict boolean indicating whether to check consistency 664 * of both the source and target model when performing 665 * conversion (defaults to <code> true </code>) 666 * <p> 667 * @return <code>true</code> if the level and version of the document were 668 * successfully set to the requested values (which may have required 669 * conversion of the model), <code>false</code> otherwise. 670 * <p> 671 * @note Calling this method will not <em>necessarily</em> lead to a successful 672 * conversion. If the conversion fails, it will be logged in the error 673 * list associated with this {@link SBMLDocument}. Callers should consult 674 * getNumErrors() to find out if the conversion succeeded without 675 * problems. For conversions from Level 2 to Level 1, callers 676 * can also check the Level of the model after calling this method to 677 * find out whether it is Level 1. (If the conversion to 678 * Level 1 failed, the Level of this model will be left unchanged.) 679 * <p> 680 * <!-- Don't remove the leading </dl> below. It's a hack for javadoc. --> 681</dl><dl class='docnote'><dt><b>Documentation note:</b></dt><dd> 682The native C++ implementation of this method defines a default argument 683value. In the documentation generated for different libSBML language 684bindings, you may or may not see corresponding arguments in the method 685declarations. For example, in Java and C#, a default argument is handled by 686declaring two separate methods, with one of them having the argument and 687the other one lacking the argument. However, the libSBML documentation will 688be <em>identical</em> for both methods. Consequently, if you are reading 689this and do not see an argument even though one is described, please look 690for descriptions of other variants of this method near where this one 691appears in the documentation. 692</dd></dl> 693 694 * <p> 695 * @see #checkL1Compatibility() 696 * @see #checkL2v1Compatibility() 697 * @see #checkL2v2Compatibility() 698 * @see #checkL2v3Compatibility() 699 * @see #checkL2v4Compatibility() 700 * @see #checkL3v1Compatibility() 701 * @see #checkL3v1Compatibility() 702 */ public 703 boolean setLevelAndVersion(long level, long version, boolean strict) { 704 return libsbmlJNI.SBMLDocument_setLevelAndVersion__SWIG_0(swigCPtr, this, level, version, strict); 705 } 706 707 708/** 709 * Sets the SBML Level and Version of this {@link SBMLDocument} instance, 710 * attempting to convert the model as needed. 711 * <p> 712 * This method is the principal way in libSBML to convert models between 713 * Levels and Versions of SBML. Generally, models can be converted 714 * upward without difficulty (e.g., from SBML Level 1 to 715 * Level 2, or from an earlier Version of Level 2 to the latest 716 * Version of Level 2). Sometimes models can be translated downward 717 * as well, if they do not use constructs specific to more advanced 718 * Levels of SBML. 719 * <p> 720 * Before calling this method, callers may check compatibility directly 721 * using the methods {@link SBMLDocument#checkL1Compatibility()}, 722 * {@link SBMLDocument#checkL2v1Compatibility()}, 723 * {@link SBMLDocument#checkL2v2Compatibility()}, 724 * {@link SBMLDocument#checkL2v3Compatibility()}, 725 * {@link SBMLDocument#checkL2v4Compatibility()}, and 726 * {@link SBMLDocument#checkL3v1Compatibility()}. 727 * <p> 728 * The valid combinations of SBML Level and Version as of this release 729 * of libSBML are the following: 730 * <ul> 731 * <li> Level 1 Version 2 732 * <li> Level 2 Version 1 733 * <li> Level 2 Version 2 734 * <li> Level 2 Version 3 735 * <li> Level 2 Version 4 736 * <li> Level 3 Version 1 737 * </ul> 738 * <p> 739 * Strict conversion applies the additional criteria that both the 740 * source and the target model must be consistent SBML. Users can 741 * control the consistency checks that are applied using the 742 * {@link SBMLDocument#setConsistencyChecksForConversion(int categ, boolean onoff)} method. If either 743 * the source or the potential target model have validation errors, the 744 * conversion is not performed. When a strict conversion is successful, 745 * the underlying SBML object model is altered to reflect the new level 746 * and version. Thus, information that cannot be converted 747 * (e.g. sboTerms) will be lost. 748 * <p> 749 * @param level the desired SBML Level 750 * <p> 751 * @param version the desired Version within the SBML Level 752 * <p> 753 * @param strict boolean indicating whether to check consistency 754 * of both the source and target model when performing 755 * conversion (defaults to <code> true </code>) 756 * <p> 757 * @return <code>true</code> if the level and version of the document were 758 * successfully set to the requested values (which may have required 759 * conversion of the model), <code>false</code> otherwise. 760 * <p> 761 * @note Calling this method will not <em>necessarily</em> lead to a successful 762 * conversion. If the conversion fails, it will be logged in the error 763 * list associated with this {@link SBMLDocument}. Callers should consult 764 * getNumErrors() to find out if the conversion succeeded without 765 * problems. For conversions from Level 2 to Level 1, callers 766 * can also check the Level of the model after calling this method to 767 * find out whether it is Level 1. (If the conversion to 768 * Level 1 failed, the Level of this model will be left unchanged.) 769 * <p> 770 * <!-- Don't remove the leading </dl> below. It's a hack for javadoc. --> 771</dl><dl class='docnote'><dt><b>Documentation note:</b></dt><dd> 772The native C++ implementation of this method defines a default argument 773value. In the documentation generated for different libSBML language 774bindings, you may or may not see corresponding arguments in the method 775declarations. For example, in Java and C#, a default argument is handled by 776declaring two separate methods, with one of them having the argument and 777the other one lacking the argument. However, the libSBML documentation will 778be <em>identical</em> for both methods. Consequently, if you are reading 779this and do not see an argument even though one is described, please look 780for descriptions of other variants of this method near where this one 781appears in the documentation. 782</dd></dl> 783 784 * <p> 785 * @see #checkL1Compatibility() 786 * @see #checkL2v1Compatibility() 787 * @see #checkL2v2Compatibility() 788 * @see #checkL2v3Compatibility() 789 * @see #checkL2v4Compatibility() 790 * @see #checkL3v1Compatibility() 791 * @see #checkL3v1Compatibility() 792 */ public 793 boolean setLevelAndVersion(long level, long version) { 794 return libsbmlJNI.SBMLDocument_setLevelAndVersion__SWIG_1(swigCPtr, this, level, version); 795 } 796 797 798/** 799 * @param package 800 * @param level 801 * @param version 802 * @internal 803 */ public 804 void updateSBMLNamespace(String arg0, long level, long version) { 805 libsbmlJNI.SBMLDocument_updateSBMLNamespace(swigCPtr, this, arg0, level, version); 806 } 807 808 809/** 810 * Sets the {@link Model} for this {@link SBMLDocument} to a copy of the given {@link Model}. 811 * <p> 812 * @param m the new {@link Model} to use. 813 * <p> 814 * @return integer value indicating success/failure of the 815 * function. The possible values 816 * returned by this function are: 817 * <ul> 818 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 819 * <li> {@link libsbmlConstants#LIBSBML_LEVEL_MISMATCH LIBSBML_LEVEL_MISMATCH } 820 * <li> {@link libsbmlConstants#LIBSBML_VERSION_MISMATCH LIBSBML_VERSION_MISMATCH } 821 * </ul> 822 * <p> 823 * @see #createModel() 824 * @see #getModel() 825 */ public 826 int setModel(Model m) { 827 return libsbmlJNI.SBMLDocument_setModel(swigCPtr, this, Model.getCPtr(m), m); 828 } 829 830 831/** 832 * Creates a new {@link Model} inside this {@link SBMLDocument}, and returns a pointer to 833 * it. 834 * <p> 835 * In SBML Level 2, the use of an identifier on a {@link Model} object is 836 * optional. This method takes an optional argument, <code>sid</code>, for setting 837 * the identifier. If not supplied, the identifier attribute on the 838 * {@link Model} instance is not set. 839 * <p> 840 * @param sid the identifier of the new {@link Model} to create. 841 * <p> 842 * <!-- Don't remove the leading </dl> below. It's a hack for javadoc. --> 843</dl><dl class='docnote'><dt><b>Documentation note:</b></dt><dd> 844The native C++ implementation of this method defines a default argument 845value. In the documentation generated for different libSBML language 846bindings, you may or may not see corresponding arguments in the method 847declarations. For example, in Java and C#, a default argument is handled by 848declaring two separate methods, with one of them having the argument and 849the other one lacking the argument. However, the libSBML documentation will 850be <em>identical</em> for both methods. Consequently, if you are reading 851this and do not see an argument even though one is described, please look 852for descriptions of other variants of this method near where this one 853appears in the documentation. 854</dd></dl> 855 856 * <p> 857 * @see #getModel() 858 * @see SBMLDocument#setModel(Model m) 859 */ public 860 Model createModel(String sid) { 861 long cPtr = libsbmlJNI.SBMLDocument_createModel__SWIG_0(swigCPtr, this, sid); 862 return (cPtr == 0) ? null : new Model(cPtr, false); 863 } 864 865 866/** 867 * Creates a new {@link Model} inside this {@link SBMLDocument}, and returns a pointer to 868 * it. 869 * <p> 870 * In SBML Level 2, the use of an identifier on a {@link Model} object is 871 * optional. This method takes an optional argument, <code>sid</code>, for setting 872 * the identifier. If not supplied, the identifier attribute on the 873 * {@link Model} instance is not set. 874 * <p> 875 * @param sid the identifier of the new {@link Model} to create. 876 * <p> 877 * <!-- Don't remove the leading </dl> below. It's a hack for javadoc. --> 878</dl><dl class='docnote'><dt><b>Documentation note:</b></dt><dd> 879The native C++ implementation of this method defines a default argument 880value. In the documentation generated for different libSBML language 881bindings, you may or may not see corresponding arguments in the method 882declarations. For example, in Java and C#, a default argument is handled by 883declaring two separate methods, with one of them having the argument and 884the other one lacking the argument. However, the libSBML documentation will 885be <em>identical</em> for both methods. Consequently, if you are reading 886this and do not see an argument even though one is described, please look 887for descriptions of other variants of this method near where this one 888appears in the documentation. 889</dd></dl> 890 891 * <p> 892 * @see #getModel() 893 * @see SBMLDocument#setModel(Model m) 894 */ public 895 Model createModel() { 896 long cPtr = libsbmlJNI.SBMLDocument_createModel__SWIG_1(swigCPtr, this); 897 return (cPtr == 0) ? null : new Model(cPtr, false); 898 } 899 900 901/** 902 * Sets the location of this {@link SBMLDocument}. Called automatically when 903 * readSBMLFromFile is used, but may be set manually as well. 904 */ public 905 void setLocationURI(String uri) { 906 libsbmlJNI.SBMLDocument_setLocationURI(swigCPtr, this, uri); 907 } 908 909 910/** 911 * Get the location of this {@link SBMLDocument}. If this document was 912 * read from a file or had its location set manually, that filename 913 * or set location will be returned, otherwise, an empty string is returned. 914 */ public 915 String getLocationURI() { 916 return libsbmlJNI.SBMLDocument_getLocationURI__SWIG_0(swigCPtr, this); 917 } 918 919 920/** 921 * Controls the consistency checks that are performed when 922 * {@link SBMLDocument#checkConsistency()} is called. 923 * <p> 924 * This method works by adding or subtracting consistency checks from the 925 * set of all possible checks that {@link SBMLDocument#checkConsistency()} knows 926 * how to perform. This method may need to be called multiple times in 927 * order to achieve the desired combination of checks. The first 928 * argument (<code>category</code>) in a call to this method indicates the category 929 * of consistency/error checks that are to be turned on or off, and the 930 * second argument (<code>apply</code>, a boolean) indicates whether to turn it on 931 * (value of <code>true</code>) or off (value of <code>false</code>). 932 * <p> 933 * * The possible categories (values to the argument <code>category</code>) are the 934 * set of constants whose names begin with the characters <code>LIBSBML_CAT_</code> 935 * in the interface class {@link libsbmlConstants}. 936 * The following are the possible choices: 937 * <p> 938 * <ul> 939 * <li> {@link libsbmlConstants#LIBSBML_CAT_GENERAL_CONSISTENCY 940 * LIBSBML_CAT_GENERAL_CONSISTENCY}: Correctness and consistency 941 * of specific SBML language constructs. Performing this set of checks 942 * is highly recommended. With respect to the SBML specification, these 943 * concern failures in applying the validation rules numbered 2xxxx in 944 * the Level 2 Versions 2–4 and Level 3 Version 1 945 * specifications. 946 * <p> 947 * <li> {@link libsbmlConstants#LIBSBML_CAT_IDENTIFIER_CONSISTENCY 948 * LIBSBML_CAT_IDENTIFIER_CONSISTENCY}: Correctness and 949 * consistency of identifiers used for model entities. An example of 950 * inconsistency would be using a species identifier in a reaction rate 951 * formula without first having declared the species. With respect to 952 * the SBML specification, these concern failures in applying the 953 * validation rules numbered 103xx in the Level 2 Versions 2–4 954 * and Level 3 Version 1 specifications. 955 * <p> 956 * <li> {@link libsbmlConstants#LIBSBML_CAT_UNITS_CONSISTENCY 957 * LIBSBML_CAT_UNITS_CONSISTENCY}: Consistency of measurement 958 * units associated with quantities in a model. With respect to the SBML 959 * specification, these concern failures in applying the validation rules 960 * numbered 105xx in the Level 2 Versions 2–4 and Level 3 961 * Version 1 specifications. 962 * <p> 963 * <li> {@link libsbmlConstants#LIBSBML_CAT_MATHML_CONSISTENCY 964 * LIBSBML_CAT_MATHML_CONSISTENCY}: Syntax of MathML constructs. 965 * With respect to the SBML specification, these concern failures in 966 * applying the validation rules numbered 102xx in the Level 2 967 * Versions 2–4 and Level 3 Version 1 specifications. 968 * <p> 969 * <li> {@link libsbmlConstants#LIBSBML_CAT_SBO_CONSISTENCY 970 * LIBSBML_CAT_SBO_CONSISTENCY}: Consistency and validity of SBO 971 * identifiers (if any) used in the model. With respect to the SBML 972 * specification, these concern failures in applying the validation rules 973 * numbered 107xx in the Level 2 Versions 2–4 and Level 3 974 * Version 1 specifications. 975 * <p> 976 * <li> {@link libsbmlConstants#LIBSBML_CAT_OVERDETERMINED_MODEL 977 * LIBSBML_CAT_OVERDETERMINED_MODEL}: Static analysis of whether 978 * the system of equations implied by a model is mathematically 979 * overdetermined. With respect to the SBML specification, this is 980 * validation rule #10601 in the Level 2 Versions 2–4 and 981 * Level 3 Version 1 specifications. 982 * <p> 983 * <li> {@link libsbmlConstants#LIBSBML_CAT_MODELING_PRACTICE 984 * LIBSBML_CAT_MODELING_PRACTICE}: Additional checks for 985 * recommended good modeling practice. (These are tests performed by 986 * libSBML and do not have equivalent SBML validation rules.) 987 * </ul> 988 * <p> 989 * <em>By default, all validation checks are applied</em> to the model in 990 * an {@link SBMLDocument} object <em>unless</em> 991 * {@link SBMLDocument#setConsistencyChecks(int categ, boolean onoff)} 992 * is called to indicate that only a subset should be applied. Further, 993 * this default (i.e., performing all checks) applies separately to 994 * <em>each new {@link SBMLDocument} object</em> created. In other words, each 995 * time a model is read using {@link SBMLReader#readSBML(String filename)}, 996 * {@link SBMLReader#readSBMLFromString(String xml)}, 997 * or the global functions readSBML() and readSBMLFromString(), a new 998 * {@link SBMLDocument} is created and for that document, a call to 999 * {@link SBMLDocument#checkConsistency()} will default to applying all possible checks. 1000 * Calling programs must invoke 1001 * {@link SBMLDocument#setConsistencyChecks(int categ, boolean onoff)} 1002 * for each such new model if they wish to change the consistency checks 1003 * applied. 1004 * <p> 1005 * @param category a value drawn from * the set of SBML error categories indicating the 1006 * consistency checking/validation to be turned on or off. 1007 * <p> 1008 * @param apply a boolean indicating whether the checks indicated by 1009 * <code>category</code> should be applied or not. 1010 * <p> 1011 * @see SBMLDocument#checkConsistency() 1012 */ public 1013 void setConsistencyChecks(int category, boolean apply) { 1014 libsbmlJNI.SBMLDocument_setConsistencyChecks(swigCPtr, this, category, apply); 1015 } 1016 1017 1018/** 1019 * Controls the consistency checks that are performed when 1020 * {@link SBMLDocument#setLevelAndVersion(long lev, long ver, boolean strict)} is called. 1021 * <p> 1022 * This method works by adding or subtracting consistency checks from the 1023 * set of all possible checks that may be performed to avoid conversion 1024 * to or from an invalid document. This method may need to be called 1025 * multiple times in 1026 * order to achieve the desired combination of checks. The first 1027 * argument (<code>category</code>) in a call to this method indicates the category 1028 * of consistency/error checks that are to be turned on or off, and the 1029 * second argument (<code>apply</code>, a boolean) indicates whether to turn it on 1030 * (value of <code>true</code>) or off (value of <code>false</code>). 1031 * <p> 1032 * * The possible categories (values to the argument <code>category</code>) are the 1033 * set of constants whose names begin with the characters <code>LIBSBML_CAT_</code> 1034 * in the interface class {@link libsbmlConstants}. 1035 * The following are the possible choices: 1036 * <p> 1037 * <ul> 1038 * <li> {@link libsbmlConstants#LIBSBML_CAT_GENERAL_CONSISTENCY 1039 * LIBSBML_CAT_GENERAL_CONSISTENCY}: Correctness and consistency 1040 * of specific SBML language constructs. Performing this set of checks 1041 * is highly recommended. With respect to the SBML specification, these 1042 * concern failures in applying the validation rules numbered 2xxxx in 1043 * the Level 2 Versions 2–4 and Level 3 Version 1 1044 * specifications. 1045 * <p> 1046 * <li> {@link libsbmlConstants#LIBSBML_CAT_IDENTIFIER_CONSISTENCY 1047 * LIBSBML_CAT_IDENTIFIER_CONSISTENCY}: Correctness and 1048 * consistency of identifiers used for model entities. An example of 1049 * inconsistency would be using a species identifier in a reaction rate 1050 * formula without first having declared the species. With respect to 1051 * the SBML specification, these concern failures in applying the 1052 * validation rules numbered 103xx in the Level 2 Versions 2–4 1053 * and Level 3 Version 1 specifications. 1054 * <p> 1055 * <li> {@link libsbmlConstants#LIBSBML_CAT_UNITS_CONSISTENCY 1056 * LIBSBML_CAT_UNITS_CONSISTENCY}: Consistency of measurement 1057 * units associated with quantities in a model. With respect to the SBML 1058 * specification, these concern failures in applying the validation rules 1059 * numbered 105xx in the Level 2 Versions 2–4 and Level 3 1060 * Version 1 specifications. 1061 * <p> 1062 * <li> {@link libsbmlConstants#LIBSBML_CAT_MATHML_CONSISTENCY 1063 * LIBSBML_CAT_MATHML_CONSISTENCY}: Syntax of MathML constructs. 1064 * With respect to the SBML specification, these concern failures in 1065 * applying the validation rules numbered 102xx in the Level 2 1066 * Versions 2–4 and Level 3 Version 1 specifications. 1067 * <p> 1068 * <li> {@link libsbmlConstants#LIBSBML_CAT_SBO_CONSISTENCY 1069 * LIBSBML_CAT_SBO_CONSISTENCY}: Consistency and validity of SBO 1070 * identifiers (if any) used in the model. With respect to the SBML 1071 * specification, these concern failures in applying the validation rules 1072 * numbered 107xx in the Level 2 Versions 2–4 and Level 3 1073 * Version 1 specifications. 1074 * <p> 1075 * <li> {@link libsbmlConstants#LIBSBML_CAT_OVERDETERMINED_MODEL 1076 * LIBSBML_CAT_OVERDETERMINED_MODEL}: Static analysis of whether 1077 * the system of equations implied by a model is mathematically 1078 * overdetermined. With respect to the SBML specification, this is 1079 * validation rule #10601 in the Level 2 Versions 2–4 and 1080 * Level 3 Version 1 specifications. 1081 * <p> 1082 * <li> {@link libsbmlConstants#LIBSBML_CAT_MODELING_PRACTICE 1083 * LIBSBML_CAT_MODELING_PRACTICE}: Additional checks for 1084 * recommended good modeling practice. (These are tests performed by 1085 * libSBML and do not have equivalent SBML validation rules.) 1086 * </ul> 1087 * <p> 1088 * <em>By default, all validation checks are applied</em> to the model in 1089 * an {@link SBMLDocument} object <em>unless</em> 1090 * {@link SBMLDocument#setConsistencyChecks(int categ, boolean onoff)} 1091 * is called to indicate that only a subset should be applied. Further, 1092 * this default (i.e., performing all checks) applies separately to 1093 * <em>each new {@link SBMLDocument} object</em> created. In other words, each 1094 * time a model is read using {@link SBMLReader#readSBML(String filename)}, 1095 * {@link SBMLReader#readSBMLFromString(String xml)}, 1096 * or the global functions readSBML() and readSBMLFromString(), a new 1097 * {@link SBMLDocument} is created and for that document, a call to 1098 * {@link SBMLDocument#checkConsistency()} will default to applying all possible checks. 1099 * Calling programs must invoke 1100 * {@link SBMLDocument#setConsistencyChecks(int categ, boolean onoff)} 1101 * for each such new model if they wish to change the consistency checks 1102 * applied. 1103 * <p> 1104 * @param category a value drawn from * the set of SBML error categories indicating the consistency 1105 * checking/validation to be turned on or off. 1106 * <p> 1107 * @param apply a boolean indicating whether the checks indicated by 1108 * <code>category</code> should be applied or not. 1109 * <p> 1110 * @see SBMLDocument#setLevelAndVersion(long lev, long ver, boolean strict) 1111 */ public 1112 void setConsistencyChecksForConversion(int category, boolean apply) { 1113 libsbmlJNI.SBMLDocument_setConsistencyChecksForConversion(swigCPtr, this, category, apply); 1114 } 1115 1116 1117/** 1118 * Performs consistency checking and validation on this SBML document. 1119 * <p> 1120 * If this method returns a nonzero value (meaning, one or more 1121 * consistency checks have failed for SBML document), the failures may be 1122 * due to warnings <em>or</em> errors. Callers should inspect the severity 1123 * flag in the individual {@link SBMLError} objects returned by 1124 * {@link SBMLDocument#getError(long n)} to determine the nature of the failures. 1125 * <p> 1126 * @return the number of failed checks (errors) encountered. 1127 * <p> 1128 * @see SBMLDocument#checkInternalConsistency() 1129 */ public 1130 long checkConsistency() { 1131 return libsbmlJNI.SBMLDocument_checkConsistency(swigCPtr, this); 1132 } 1133 1134 1135/** 1136 * Performs consistency checking and validation on this SBML document. 1137 * <p> 1138 * If this method returns a nonzero value (meaning, one or more 1139 * consistency checks have failed for SBML document), the failures may be 1140 * due to warnings <em>or</em> errors. Callers should inspect the severity 1141 * flag in the individual {@link SBMLError} objects returned by 1142 * {@link SBMLDocument#getError(long n)} to determine the nature of the failures. 1143 * <p> 1144 * @note unlike checkConsistency this method will write the document 1145 * in order to determine all errors for the document. This will 1146 * also clear the error log. 1147 * <p> 1148 * @return the number of failed checks (errors) encountered. 1149 * <p> 1150 * @see SBMLDocument#checkConsistency() 1151 */ public 1152 long validateSBML() { 1153 return libsbmlJNI.SBMLDocument_validateSBML(swigCPtr, this); 1154 } 1155 1156 1157/** 1158 * Performs consistency checking on libSBML's internal representation of 1159 * an SBML {@link Model}. 1160 * <p> 1161 * Callers should query the results of the consistency check by calling 1162 * {@link SBMLDocument#getError(long n)}. 1163 * <p> 1164 * @return the number of failed checks (errors) encountered. 1165 * <p> 1166 * The distinction between this method and 1167 * {@link SBMLDocument#checkConsistency()} is that this method reports on 1168 * fundamental syntactic and structural errors that violate the XML 1169 * Schema for SBML; by contrast, {@link SBMLDocument#checkConsistency()} 1170 * performs more elaborate model verifications and also validation 1171 * according to the validation rules written in the appendices of the 1172 * SBML Level 2 Versions 2–4 specification documents. 1173 * <p> 1174 * @see SBMLDocument#checkConsistency() 1175 */ public 1176 long checkInternalConsistency() { 1177 return libsbmlJNI.SBMLDocument_checkInternalConsistency(swigCPtr, this); 1178 } 1179 1180 1181/** 1182 * Performs a set of consistency checks on the document to establish 1183 * whether it is compatible with SBML Level 1 and can be converted 1184 * to Level 1. 1185 * <p> 1186 * Callers should query the results of the consistency check by calling 1187 * {@link SBMLDocument#getError(long n)}. 1188 * <p> 1189 * @return the number of failed checks (errors) encountered. 1190 */ public 1191 long checkL1Compatibility() { 1192 return libsbmlJNI.SBMLDocument_checkL1Compatibility(swigCPtr, this); 1193 } 1194 1195 1196/** 1197 * Performs a set of consistency checks on the document to establish 1198 * whether it is compatible with SBML Level 2 Version 1 and can 1199 * be converted to Level 2 Version 1. 1200 * <p> 1201 * Callers should query the results of the consistency check by calling 1202 * {@link SBMLDocument#getError(long n)}. 1203 * <p> 1204 * @return the number of failed checks (errors) encountered. 1205 */ public 1206 long checkL2v1Compatibility() { 1207 return libsbmlJNI.SBMLDocument_checkL2v1Compatibility(swigCPtr, this); 1208 } 1209 1210 1211/** 1212 * Performs a set of consistency checks on the document to establish 1213 * whether it is compatible with SBML Level 2 Version 2 and can 1214 * be converted to Level 2 Version 2. 1215 * <p> 1216 * Callers should query the results of the consistency check by calling 1217 * {@link SBMLDocument#getError(long n)}. 1218 * <p> 1219 * @return the number of failed checks (errors) encountered. 1220 */ public 1221 long checkL2v2Compatibility() { 1222 return libsbmlJNI.SBMLDocument_checkL2v2Compatibility(swigCPtr, this); 1223 } 1224 1225 1226/** 1227 * Performs a set of consistency checks on the document to establish 1228 * whether it is compatible with SBML Level 2 Version 3 and can 1229 * be converted to Level 2 Version 3. 1230 * <p> 1231 * Callers should query the results of the consistency check by calling 1232 * {@link SBMLDocument#getError(long n)}. 1233 * <p> 1234 * @return the number of failed checks (errors) encountered. 1235 */ public 1236 long checkL2v3Compatibility() { 1237 return libsbmlJNI.SBMLDocument_checkL2v3Compatibility(swigCPtr, this); 1238 } 1239 1240 1241/** 1242 * Performs a set of consistency checks on the document to establish 1243 * whether it is compatible with SBML Level 2 Version 4 and can 1244 * be converted to Level 2 Version 4. 1245 * <p> 1246 * Callers should query the results of the consistency check by calling 1247 * {@link SBMLDocument#getError(long n)}. 1248 * <p> 1249 * @return the number of failed checks (errors) encountered. 1250 */ public 1251 long checkL2v4Compatibility() { 1252 return libsbmlJNI.SBMLDocument_checkL2v4Compatibility(swigCPtr, this); 1253 } 1254 1255 1256/** 1257 * Performs a set of consistency checks on the document to establish 1258 * whether it is compatible with SBML Level 3 Version 1 and can 1259 * be converted to Level 3 Version 1. 1260 * <p> 1261 * Callers should query the results of the consistency check by calling 1262 * {@link SBMLDocument#getError(long n)}. 1263 * <p> 1264 * @return the number of failed checks (errors) encountered. 1265 */ public 1266 long checkL3v1Compatibility() { 1267 return libsbmlJNI.SBMLDocument_checkL3v1Compatibility(swigCPtr, this); 1268 } 1269 1270 1271/** 1272 * Returns the nth error or warning encountered during parsing, 1273 * consistency checking, or attempted translation of this model. 1274 * <p> 1275 * Callers can use method {@link XMLError#getSeverity()} on the result to assess 1276 * the severity of the problem. The possible severity levels range from 1277 * informational messages to fatal errors. 1278 * <p> 1279 * @return the error or warning indexed by integer <code>n</code>, or return 1280 * <code>null</code> if <code>n > (getNumErrors() - 1)</code>. 1281 * <p> 1282 * @param n the integer index of the error sought. 1283 * <p> 1284 * @see SBMLDocument#getNumErrors() 1285 */ public 1286 SBMLError getError(long n) { 1287 long cPtr = libsbmlJNI.SBMLDocument_getError(swigCPtr, this, n); 1288 return (cPtr == 0) ? null : new SBMLError(cPtr, false); 1289 } 1290 1291 1292/** 1293 * Returns the number of errors or warnings encountered during parsing, 1294 * consistency checking, or attempted translation of this model. 1295 * <p> 1296 * @return the number of errors or warnings encountered 1297 * <p> 1298 * @see SBMLDocument#getError(long n) 1299 */ public 1300 long getNumErrors() { 1301 return libsbmlJNI.SBMLDocument_getNumErrors__SWIG_0(swigCPtr, this); 1302 } 1303 1304 1305/** 1306 * Returns the number of errors or warnings encountered with the given 1307 * severity during parsing, 1308 * consistency checking, or attempted translation of this model. 1309 * <p> 1310 * @param severity the severity of the error sought. 1311 * <p> 1312 * @return the number of errors or warnings encountered 1313 * <p> 1314 * @see SBMLDocument#getError(long n) 1315 */ public 1316 long getNumErrors(long severity) { 1317 return libsbmlJNI.SBMLDocument_getNumErrors__SWIG_1(swigCPtr, this, severity); 1318 } 1319 1320 1321/** 1322 * Prints all the errors or warnings encountered trying to parse, 1323 * check, or translate this SBML document. 1324 * <p> 1325 * It prints the text to the stream given by the optional parameter 1326 * <code>stream</code>. If no parameter is given, it prints the output to the 1327 * standard error stream. 1328 * <p> 1329 * If no errors have occurred, i.e., <code>getNumErrors() == 0</code>, no 1330 * output will be sent to the stream. 1331 * <p> 1332 * The format of the output is: 1333 * <div class='fragment'><pre> 1334 N error(s): 1335 line NNN: (id) message 1336 </pre></div> 1337 * <p> 1338 * @param stream the ostream or ostringstream object indicating where 1339 * the output should be printed. 1340 * <p> 1341 * <!-- Don't remove the leading </dl> below. It's a hack for javadoc. --> 1342</dl><dl class='docnote'><dt><b>Documentation note:</b></dt><dd> 1343The native C++ implementation of this method defines a default argument 1344value. In the documentation generated for different libSBML language 1345bindings, you may or may not see corresponding arguments in the method 1346declarations. For example, in Java and C#, a default argument is handled by 1347declaring two separate methods, with one of them having the argument and 1348the other one lacking the argument. However, the libSBML documentation will 1349be <em>identical</em> for both methods. Consequently, if you are reading 1350this and do not see an argument even though one is described, please look 1351for descriptions of other variants of this method near where this one 1352appears in the documentation. 1353</dd></dl> 1354 1355 * <p> 1356 * @see #getNumErrors() 1357 * @see #getErrorLog() 1358 * @see SBMLDocument#getError(long n) 1359 */ public 1360 void printErrors(OStream stream) { 1361 libsbmlJNI.SBMLDocument_printErrors__SWIG_0(swigCPtr, this, SWIGTYPE_p_std__ostream.getCPtr(stream.get_ostream()), stream); 1362 } 1363 1364 1365/** 1366 * Prints all the errors or warnings encountered trying to parse, 1367 * check, or translate this SBML document. 1368 * <p> 1369 * It prints the text to the stream given by the optional parameter 1370 * <code>stream</code>. If no parameter is given, it prints the output to the 1371 * standard error stream. 1372 * <p> 1373 * If no errors have occurred, i.e., <code>getNumErrors() == 0</code>, no 1374 * output will be sent to the stream. 1375 * <p> 1376 * The format of the output is: 1377 * <div class='fragment'><pre> 1378 N error(s): 1379 line NNN: (id) message 1380 </pre></div> 1381 * <p> 1382 * @param stream the ostream or ostringstream object indicating where 1383 * the output should be printed. 1384 * <p> 1385 * <!-- Don't remove the leading </dl> below. It's a hack for javadoc. --> 1386</dl><dl class='docnote'><dt><b>Documentation note:</b></dt><dd> 1387The native C++ implementation of this method defines a default argument 1388value. In the documentation generated for different libSBML language 1389bindings, you may or may not see corresponding arguments in the method 1390declarations. For example, in Java and C#, a default argument is handled by 1391declaring two separate methods, with one of them having the argument and 1392the other one lacking the argument. However, the libSBML documentation will 1393be <em>identical</em> for both methods. Consequently, if you are reading 1394this and do not see an argument even though one is described, please look 1395for descriptions of other variants of this method near where this one 1396appears in the documentation. 1397</dd></dl> 1398 1399 * <p> 1400 * @see #getNumErrors() 1401 * @see #getErrorLog() 1402 * @see SBMLDocument#getError(long n) 1403 */ public 1404 void printErrors() { 1405 libsbmlJNI.SBMLDocument_printErrors__SWIG_1(swigCPtr, this); 1406 } 1407 1408 1409/** 1410 * Sets this SBML object to child SBML objects (if any). 1411 * (Creates a child-parent relationship by the parent) 1412 * <p> 1413 * Subclasses must override this function if they define 1414 * one ore more child elements. 1415 * Basically, this function needs to be called in 1416 * constructor, copy constructor and assignment operator. 1417 * <p> 1418 * @see setSBMLDocument 1419 * @see enablePackageInternal 1420 * @internal 1421 */ public 1422 void connectToChild() { 1423 libsbmlJNI.SBMLDocument_connectToChild(swigCPtr, this); 1424 } 1425 1426 1427/** 1428 * Converts this document using the converter that best matches 1429 * the given conversion properties. 1430 * <p> 1431 * @param props the conversion properties to use 1432 * <p> 1433 * @return integer value indicating success/failure of the 1434 * function. The possible values 1435 * returned by this function are: 1436 * <ul> 1437 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 1438 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED } 1439 * <li> {@link libsbmlConstants#LIBSBML_CONV_CONVERSION_NOT_AVAILABLE LIBSBML_CONV_CONVERSION_NOT_AVAILABLE } 1440 * </ul> 1441 * @internal 1442 */ public 1443 int convert(ConversionProperties props) { 1444 return libsbmlJNI.SBMLDocument_convert(swigCPtr, this, ConversionProperties.getCPtr(props), props); 1445 } 1446 1447 1448/** 1449 * Enables/Disables the given package with this element and child 1450 * elements (if any). 1451 * (This is an internal implementation for enablePackage function) 1452 * <p> 1453 * @note Subclasses of the SBML Core package in which one or more child 1454 * elements are defined must override this function. 1455 * @internal 1456 */ public 1457 void enablePackageInternal(String pkgURI, String pkgPrefix, boolean flag) { 1458 libsbmlJNI.SBMLDocument_enablePackageInternal(swigCPtr, this, pkgURI, pkgPrefix, flag); 1459 } 1460 1461 1462/** 1463 * Returns the libSBML type code for this SBML object. 1464 * <p> 1465 * LibSBML attaches an identifying code to every 1466 * kind of SBML object. These are known as <em>SBML type codes</em>. In 1467 * other languages, the set of type codes is stored in an enumeration; in 1468 * the Java language interface for libSBML, the type codes are defined as 1469 * static integer constants in the interface class {@link 1470 * libsbmlConstants}. The names of the type codes all begin with the 1471 * characters <code>SBML_.</code> 1472 * <p> 1473 * @return the SBML type code for this object, or {@link libsbmlConstants#SBML_UNKNOWN SBML_UNKNOWN} (default). 1474 * <p> 1475 * @see SBMLDocument#getElementName() 1476 */ public 1477 int getTypeCode() { 1478 return libsbmlJNI.SBMLDocument_getTypeCode(swigCPtr, this); 1479 } 1480 1481 1482/** 1483 * Returns the XML element name of this object, which for {@link SBMLDocument}, 1484 * is always <code>'sbml'.</code> 1485 * <p> 1486 * @return the name of this element, i.e., <code>'sbml'.</code> 1487 */ public 1488 String getElementName() { 1489 return libsbmlJNI.SBMLDocument_getElementName(swigCPtr, this); 1490 } 1491 1492 1493/** 1494 * Returns the list of errors or warnings logged during parsing, 1495 * consistency checking, or attempted translation of this model. 1496 * <p> 1497 * @return the {@link SBMLErrorLog} used for this {@link SBMLDocument} 1498 * <p> 1499 * @see SBMLDocument#getNumErrors() 1500 */ public 1501 SBMLErrorLog getErrorLog() { 1502 long cPtr = libsbmlJNI.SBMLDocument_getErrorLog__SWIG_0(swigCPtr, this); 1503 return (cPtr == 0) ? null : new SBMLErrorLog(cPtr, false); 1504 } 1505 1506 1507/** 1508 * Returns a list of XML Namespaces associated with the XML content 1509 * of this SBML document. 1510 * <p> 1511 * @return the XML Namespaces associated with this SBML object 1512 */ public 1513 XMLNamespaces getNamespaces() { 1514 long cPtr = libsbmlJNI.SBMLDocument_getNamespaces(swigCPtr, this); 1515 return (cPtr == 0) ? null : new XMLNamespaces(cPtr, false); 1516 } 1517 1518 1519/** 1520 * Set/unset default namespace to each top-level element defined in the 1521 * given package extension. 1522 * <p> 1523 * This works by adding a <code>xmlns="..."</code> attribute. No 1524 * prefix will be written when writing elements defined in the given 1525 * package extension if <code>true</code> is given as second argument. 1526 * <p> 1527 * @param package the name or URI of the package extension. 1528 * @param flag boolean value to indicate whether to write a namespace 1529 * prefix. 1530 * <p> 1531 * @return integer value indicating success/failure of the 1532 * function. The possible values 1533 * returned by this function are: 1534 * <ul> 1535 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 1536 * <li> {@link libsbmlConstants#LIBSBML_PKG_UNKNOWN_VERSION LIBSBML_PKG_UNKNOWN_VERSION } 1537 * </ul> 1538 */ public 1539 int enableDefaultNS(String arg0, boolean flag) { 1540 return libsbmlJNI.SBMLDocument_enableDefaultNS(swigCPtr, this, arg0, flag); 1541 } 1542 1543 1544/** 1545 * Returns <code>true</code> if a default namespace is added to each top-level 1546 * element defined in the given package extension, otherwise returns 1547 * <code>false.</code> 1548 * <p> 1549 * This basically checks if the attribute 1550 * <code>xmlns="..."</code> is present. 1551 * <p> 1552 * @param package the name or URI of the package extension. 1553 * <p> 1554 * @return a boolean 1555 */ public 1556 boolean isEnabledDefaultNS(String arg0) { 1557 return libsbmlJNI.SBMLDocument_isEnabledDefaultNS(swigCPtr, this, arg0); 1558 } 1559 1560 1561/** 1562 * Sets the <code>required</code> attribute value of the given package 1563 * extension. 1564 * <p> 1565 * @note The name of package must not be given if the package is not 1566 * enabled. 1567 * <p> 1568 * @param package the name or URI of the package extension. 1569 * @param flag Boolean value indicating whether the package is required. 1570 * <p> 1571 * @return integer value indicating success/failure of the 1572 * function. The possible values 1573 * returned by this function are: 1574 * <ul> 1575 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 1576 * <li> {@link libsbmlConstants#LIBSBML_PKG_UNKNOWN_VERSION LIBSBML_PKG_UNKNOWN_VERSION } 1577 * </ul> 1578 */ public 1579 int setPackageRequired(String arg0, boolean flag) { 1580 return libsbmlJNI.SBMLDocument_setPackageRequired(swigCPtr, this, arg0, flag); 1581 } 1582 1583 1584/** 1585 * Returns the <code>required</code> attribute of the given package 1586 * extension. 1587 * <p> 1588 * @note The name of package must not be given if the package is not 1589 * enabled. 1590 * <p> 1591 * @param package the name or URI of the package extension. 1592 * <p> 1593 * @return Boolean flag indicating whether the package is flagged as 1594 * being required. 1595 */ public 1596 boolean getPackageRequired(String arg0) { 1597 return libsbmlJNI.SBMLDocument_getPackageRequired(swigCPtr, this, arg0); 1598 } 1599 1600 1601/** 1602 * Returns <code>true</code> if the required attribute of the given package extension 1603 * is defined, otherwise returns <code>false.</code> 1604 * <p> 1605 * @note The name of package must not be given if the package is not 1606 * enabled. 1607 * <p> 1608 * @param package the name or URI of the package extension. 1609 * <p> 1610 * @return a Boolean 1611 */ public 1612 boolean isSetPackageRequired(String arg0) { 1613 return libsbmlJNI.SBMLDocument_isSetPackageRequired(swigCPtr, this, arg0); 1614 } 1615 1616 1617/** 1618 * Returns <code>true</code> if the given package extension is one of an ignored 1619 * packages, otherwise returns <code>false.</code> 1620 * <p> 1621 * An ignored package is one that is defined to be used in this SBML 1622 * document, but the package is not enabled in this copy of libSBML. 1623 * <p> 1624 * @param pkgURI the URI of the package extension. 1625 * <p> 1626 * @return a Boolean, <code>true</code> if the package is being ignored and 1627 * <code>false</code> otherwise. 1628 */ public 1629 boolean isIgnoredPackage(String pkgURI) { 1630 return libsbmlJNI.SBMLDocument_isIgnoredPackage(swigCPtr, this, pkgURI); 1631 } 1632 1633 1634/** 1635 * Sets the value of the <code>required</code> attribute for the given 1636 * package. 1637 * <p> 1638 * @note The name of package must not be given if the package is not 1639 * enabled. 1640 * <p> 1641 * @param package the name or URI of the package extension. 1642 * @param flag a Boolean value. 1643 * <p> 1644 * @return integer value indicating success/failure of the 1645 * function. The possible values 1646 * returned by this function are: 1647 * <ul> 1648 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS } 1649 * <li> {@link libsbmlConstants#LIBSBML_PKG_UNKNOWN_VERSION LIBSBML_PKG_UNKNOWN_VERSION } 1650 * </ul> 1651 * <p> 1652 * @deprecated <div class='deprecated'>Replaced in libSBML 5.2.0 by 1653 * setPackageRequired(String package, boolean flag) 1654 </div> 1655 * */ public 1656 int setPkgRequired(String arg0, boolean flag) { 1657 return libsbmlJNI.SBMLDocument_setPkgRequired(swigCPtr, this, arg0, flag); 1658 } 1659 1660 1661/** 1662 * Returns the <code>required</code> attribute of the given package 1663 * extension. 1664 * <p> 1665 * @note The name of package must not be given if the package is not 1666 * enabled. 1667 * <p> 1668 * @param package the name or URI of the package extension. 1669 * <p> 1670 * @return a Boolean value indicating whether the package is flagged as 1671 * being required in this SBML document. 1672 * <p> 1673 * @deprecated <div class='deprecated'>Replaced in libSBML 5.2.0 by 1674 * getPackageRequired(String package flag) 1675 </div> 1676 * */ public 1677 boolean getPkgRequired(String arg0) { 1678 return libsbmlJNI.SBMLDocument_getPkgRequired(swigCPtr, this, arg0); 1679 } 1680 1681 1682/** 1683 * Returns <code>true</code> if the required attribute of the given package extension 1684 * is defined, otherwise returns <code>false.</code> 1685 * <p> 1686 * @note The name of package must not be given if the package is not 1687 * enabled. 1688 * <p> 1689 * @param package the name or URI of the package extension. 1690 * <p> 1691 * @return a Boolean value. 1692 * <p> 1693 * @deprecated <div class='deprecated'>Replaced in libSBML 5.2.0 by 1694 * isSetPackageRequired(String package flag) 1695 </div> 1696 * */ public 1697 boolean isSetPkgRequired(String arg0) { 1698 return libsbmlJNI.SBMLDocument_isSetPkgRequired(swigCPtr, this, arg0); 1699 } 1700 1701 1702/** 1703 * Returns <code>true</code> if the given package extension is one of ignored 1704 * packages, otherwise returns <code>false.</code> 1705 * <p> 1706 * An ignored package is one that is defined to be used in this SBML 1707 * document, but the package is not enabled in this copy of libSBML. 1708 * <p> 1709 * @param pkgURI the URI of the package extension. 1710 * <p> 1711 * @return a boolean 1712 * <p> 1713 * @deprecated <div class='deprecated'>Replaced in libSBML 5.2.0 by 1714 * isIgnoredPackage(String pkgURI flag) 1715 </div> 1716 * */ public 1717 boolean isIgnoredPkg(String pkgURI) { 1718 return libsbmlJNI.SBMLDocument_isIgnoredPkg(swigCPtr, this, pkgURI); 1719 } 1720 1721 1722/** 1723 * Validation system. 1724 * @internal 1725 */ public 1726 short getApplicableValidators() { 1727 return libsbmlJNI.SBMLDocument_getApplicableValidators(swigCPtr, this); 1728 } 1729 1730 1731/** 1732 * Validation system. 1733 * @internal 1734 */ public 1735 short getConversionValidators() { 1736 return libsbmlJNI.SBMLDocument_getConversionValidators(swigCPtr, this); 1737 } 1738 1739 1740/** 1741 * Validation system. 1742 * @internal 1743 */ public 1744 void setApplicableValidators(short appl) { 1745 libsbmlJNI.SBMLDocument_setApplicableValidators(swigCPtr, this, appl); 1746 } 1747 1748 1749/** 1750 * Validation system. 1751 * @internal 1752 */ public 1753 void setConversionValidators(short appl) { 1754 libsbmlJNI.SBMLDocument_setConversionValidators(swigCPtr, this, appl); 1755 } 1756 1757 1758/** 1759 * Validation system. 1760 * @internal 1761 */ public 1762 long getNumValidators() { 1763 return libsbmlJNI.SBMLDocument_getNumValidators(swigCPtr, this); 1764 } 1765 1766 1767/** 1768 * Validation system. 1769 * @internal 1770 */ public 1771 int clearValidators() { 1772 return libsbmlJNI.SBMLDocument_clearValidators(swigCPtr, this); 1773 } 1774 1775 1776/** 1777 * Validation system. 1778 * @internal 1779 */ public 1780 int addValidator(SBMLValidator validator) { 1781 return libsbmlJNI.SBMLDocument_addValidator(swigCPtr, this, SBMLValidator.getCPtr(validator), validator); 1782 } 1783 1784 1785/** 1786 * Validation system. 1787 * @internal 1788 */ public 1789 SBMLValidator getValidator(long index) { 1790 long cPtr = libsbmlJNI.SBMLDocument_getValidator(swigCPtr, this, index); 1791 return (cPtr == 0) ? null : new SBMLValidator(cPtr, false); 1792 } 1793 1794}