001/* ---------------------------------------------------------------------------- 002 * This file was automatically generated by SWIG (http://www.swig.org). 003 * Version 3.0.10 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 * XML-level errors, warnings and other diagnostics. 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 * LibSBML can be configured to use any of a number of XML parsers; at the 023 * time of this writing, libSBML supports Xerces versions 2.4 through 3.1, 024 * Expat version 1.95.x and higher, and libxml2 version 2.6.16 and higher. 025 * These parsers each report different status codes for the various 026 * exceptions that can occur during XML processing. The {@link XMLError} object 027 * class abstracts away from the particular diagnostics reported by the 028 * different parsers and presents a single uniform interface and set of 029 * status codes, along with operations for manipulating the error objects. 030 <p> 031 * When the libSBML XML parser layer encounters an error in the XML content 032 * being processed, or when there is something else wrong (such as an 033 * out-of-memory condition), the problems are reported as {@link XMLError} objects. 034 * Each {@link XMLError} object instance has an identification number that 035 * identifies the nature of the problem. 036 * This 037 * error identifier is one of the constants listed in the next section below. 038 * Applications can use the error identifiers as a means of recognizing the 039 * error encountered and changing their behavior if desired. 040 <p> 041 * Integer error codes are useful for software, but not so much for telling 042 * humans what happened. For this reason, {@link XMLError} also provides two text 043 * messages describing the nature of the error. These messages are 044 * accessible by means of the methods {@link XMLError#getShortMessage()} and 045 * {@link XMLError#getMessage()}. The method {@link XMLError#getShortMessage()} returns 046 * a very brief synopsis of the warning or error condition, whereas 047 * {@link XMLError#getMessage()} returns a longer explanation. These text strings 048 * are suitable for displaying to human users. 049 <p> 050 * Each {@link XMLError} object also contains a category code; its value may be 051 * retrieved using the method {@link XMLError#getCategory()}. Category values 052 * are drawn from a 053 * set of constants whose names begin with the characters <code>LIBSBML_CAT_</code>, described below. Categories 054 * are used by libSBML to provide more information to calling programs about 055 * the nature of a given error. 056 <p> 057 * In addition to category codes, each {@link XMLError} object also has a severity 058 * code; its value may be retrieved using the method 059 * {@link XMLError#getSeverity()}. Severity code values are drawn from 060 * a 061 * set of constants whose names begin with the characters <code>LIBSBML_SEV_</code>, 062 * described below. Severity levels range from informational 063 * ({@link libsbmlConstants#LIBSBML_SEV_INFO LIBSBML_SEV_INFO}) to 064 * fatal errors ({@link libsbmlConstants#LIBSBML_SEV_FATAL LIBSBML_SEV_FATAL}). 065 <p> 066 * Finally, {@link XMLError} objects record the line and column near where the 067 * problem occurred in the XML content. The values can be retrieved using 068 * the methods {@link XMLError#getLine()} and {@link XMLError#getColumn()}. We say 'near 069 * where the problem occurred', because many factors affect how accurate 070 * the line/column information ultimately is. For example, sometimes, the 071 * underlying XML parsers can only report such information for the parent 072 * XML element where an error occurs, and not for the specific point where 073 * the problem occurs. In other situations, some parsers report invalid 074 * line and/or column numbers altogether. If this occurs, libSBML sets the 075 * line and/or column number in the {@link XMLError} object to either 076 * <code>0</code> or the value of the maximum unsigned long integer 077 * representable on the platform where libSBML is running. The probability 078 * that a true line or column number in an SBML model would equal this 079 * value is vanishingly small; thus, if an application encounters these 080 * values in an {@link XMLError} object, it can assume no valid line/column number 081 * could be provided by libSBML in that situation. 082 <p> 083 * <h3><a class='anchor' 084 * name='error-codes'>Error codes associated with {@link XMLError} objects</a></h3> 085 <p> 086 * The error and warning codes returned by the XML layer in libSBML are 087 * listed in the table below. In the libSBML Java language interface, 088 * these error identifiers are currently implemented as static integer 089 * constants defined in the interface class <code><a 090 * href='libsbmlConstants.html'>libsbmlConstants</a></code>. This is 091 * admittedly not an ideal approach from the standpoint of modern Java 092 * programming, but it was necessary to work around the lack of 093 * enumerations in Java prior to JDK 1.5. Future versions of libSBML may 094 * use a proper Java enumeration type to define the error 095 * identifiers. 096 <p> 097 * <center> 098 * <table cellspacing='1' cellpadding='1' border='0' width='95%' 099 class='text-table normal-font alt-row-colors'> 100 * <caption>Possible {@link XMLError} error codes. Depending on the programming 101 * language in use, the <em>Enumerator</em> values will be defined either 102 * as a value from an enumeration type 103 * or as integer constants. 104 * To make this table more compact, we have shortened the identifiers for 105 * the category and severity codes to their essential parts. To get the 106 * actual names of the constants, prepend <code>LIBSBML_CAT_</code> to the 107 * category names and <code>LIBSBML_SEV_</code> to the severity names 108 * shown in the two right-hand columns. 109 * </caption> 110 * <tr style='background: lightgray' class='normal-font'> 111 * <th style='text-align: left'>Enumerator</th> 112 * <th>Meaning</th> 113 * <th width='90' style='text-align: left'>Category</th> 114 * <th width='90' style='text-align: left'>Severity</th> 115 * </tr> 116 * <tr><td>{@link libsbmlConstants#XMLUnknownError XMLUnknownError}</td><td>Unrecognized error encountered internally</td><td>INTERNAL</td><td>FATAL</td></tr> 117 * <tr><td>{@link libsbmlConstants#XMLOutOfMemory XMLOutOfMemory}</td> <td>Out of memory</td><td>SYSTEM</td><td>FATAL</td></tr> 118 * <tr><td>{@link libsbmlConstants#XMLFileUnreadable XMLFileUnreadable}</td> <td>File unreadable</td><td>SYSTEM</td><td>ERROR</td></tr> 119 * <tr><td>{@link libsbmlConstants#XMLFileUnwritable XMLFileUnwritable}</td> <td>File unwritable</td><td>SYSTEM</td><td>ERROR</td></tr> 120 * <tr><td>{@link libsbmlConstants#XMLFileOperationError XMLFileOperationError}</td><td>Error encountered while attempting file operation</td><td>SYSTEM</td><td>ERROR</td></tr> 121 * <tr><td>{@link libsbmlConstants#XMLNetworkAccessError XMLNetworkAccessError}</td><td>Network access error</td><td>SYSTEM</td><td>ERROR</td></tr> 122 * <tr><td>{@link libsbmlConstants#InternalXMLParserError InternalXMLParserError}</td><td>Internal XML parser state error</td><td>INTERNAL</td><td>FATAL</td></tr> 123 * <tr><td>{@link libsbmlConstants#UnrecognizedXMLParserCode UnrecognizedXMLParserCode}</td><td>XML parser returned an unrecognized error code</td><td>INTERNAL</td><td>FATAL</td></tr> 124 * <tr><td>{@link libsbmlConstants#XMLTranscoderError XMLTranscoderError}</td><td>Character transcoder error</td><td>INTERNAL</td><td>FATAL</td></tr> 125 * <tr><td>{@link libsbmlConstants#MissingXMLDecl MissingXMLDecl}</td><td>Missing XML declaration at beginning of XML input</td><td>XML</td><td>ERROR</td></tr> 126 * <tr><td>{@link libsbmlConstants#MissingXMLEncoding MissingXMLEncoding}</td><td>Missing encoding attribute in XML declaration</td><td>XML</td><td>ERROR</td></tr> 127 * <tr><td>{@link libsbmlConstants#BadXMLDecl BadXMLDecl}</td><td>Invalid or unrecognized XML declaration or XML encoding</td><td>XML</td><td>ERROR</td></tr> 128 * <tr><td>{@link libsbmlConstants#BadXMLDOCTYPE BadXMLDOCTYPE}</td><td>Invalid, malformed or unrecognized XML DOCTYPE declaration</td><td>XML</td><td>ERROR</td></tr> 129 * <tr><td>{@link libsbmlConstants#InvalidCharInXML InvalidCharInXML}</td><td>Invalid character in XML content</td><td>XML</td><td>ERROR</td></tr> 130 * <tr><td>{@link libsbmlConstants#BadlyFormedXML BadlyFormedXML}</td><td>XML content is not well-formed</td><td>XML</td><td>ERROR</td></tr> 131 * <tr><td>{@link libsbmlConstants#UnclosedXMLToken UnclosedXMLToken}</td><td>Unclosed XML token</td><td>XML</td><td>ERROR</td></tr> 132 * <tr><td>{@link libsbmlConstants#InvalidXMLConstruct InvalidXMLConstruct}</td><td>XML construct is invalid or not permitted</td><td>XML</td><td>ERROR</td></tr> 133 * <tr><td>{@link libsbmlConstants#XMLTagMismatch XMLTagMismatch}</td><td>Element tag mismatch or missing tag</td><td>XML</td><td>ERROR</td></tr> 134 * <tr><td>{@link libsbmlConstants#DuplicateXMLAttribute DuplicateXMLAttribute}</td><td>Duplicate XML attribute</td><td>XML</td><td>ERROR</td></tr> 135 * <tr><td>{@link libsbmlConstants#UndefinedXMLEntity UndefinedXMLEntity}</td><td>Undefined XML entity</td><td>XML</td><td>ERROR</td></tr> 136 * <tr><td>{@link libsbmlConstants#BadProcessingInstruction BadProcessingInstruction}</td><td>Invalid, malformed or unrecognized XML processing instruction</td><td>XML</td><td>ERROR</td></tr> 137 * <tr><td>{@link libsbmlConstants#BadXMLPrefix BadXMLPrefix}</td><td>Invalid or undefined XML namespace prefix</td><td>XML</td><td>ERROR</td></tr> 138 * <tr><td>{@link libsbmlConstants#BadXMLPrefixValue BadXMLPrefixValue}</td><td>Invalid XML namespace prefix value</td><td>XML</td><td>ERROR</td></tr> 139 * <tr><td>{@link libsbmlConstants#MissingXMLRequiredAttribute MissingXMLRequiredAttribute}</td><td>Missing a required XML attribute</td><td>XML</td><td>ERROR</td></tr> 140 * <tr><td>{@link libsbmlConstants#XMLAttributeTypeMismatch XMLAttributeTypeMismatch}</td><td>Data type mismatch for the value of an attribute</td><td>XML</td><td>ERROR</td></tr> 141 * <tr><td>{@link libsbmlConstants#XMLBadUTF8Content XMLBadUTF8Content}</td><td>Invalid UTF8 content</td><td>XML</td><td>ERROR</td></tr> 142 * <tr><td>{@link libsbmlConstants#MissingXMLAttributeValue MissingXMLAttributeValue}</td><td>Missing or improperly formed attribute value</td><td>XML</td><td>ERROR</td></tr> 143 * <tr><td>{@link libsbmlConstants#BadXMLAttributeValue BadXMLAttributeValue}</td><td>Invalid or unrecognizable attribute value</td><td>XML</td><td>ERROR</td></tr> 144 * <tr><td>{@link libsbmlConstants#BadXMLAttribute BadXMLAttribute}</td><td>Invalid, unrecognized or malformed attribute</td><td>XML</td><td>ERROR</td></tr> 145 * <tr><td>{@link libsbmlConstants#UnrecognizedXMLElement UnrecognizedXMLElement}</td><td>Element either not recognized or not permitted</td><td>XML</td><td>ERROR</td></tr> 146 * <tr><td>{@link libsbmlConstants#BadXMLComment BadXMLComment}</td><td>Badly formed XML comment</td><td>XML</td><td>ERROR</td></tr> 147 * <tr><td>{@link libsbmlConstants#BadXMLDeclLocation BadXMLDeclLocation}</td><td>XML declaration not permitted in this location</td><td>XML</td><td>ERROR</td></tr> 148 * <tr><td>{@link libsbmlConstants#XMLUnexpectedEOF XMLUnexpectedEOF}</td><td>Reached end of input unexpectedly</td><td>XML</td><td>ERROR</td></tr> 149 * <tr><td>{@link libsbmlConstants#BadXMLIDValue BadXMLIDValue}</td><td>Value is invalid for XML ID, or has already been used</td><td>XML</td><td>ERROR</td></tr> 150 * <tr><td>{@link libsbmlConstants#BadXMLIDRef BadXMLIDRef}</td><td>XML ID value was never declared</td><td>XML</td><td>ERROR</td></tr> 151 * <tr><td>{@link libsbmlConstants#UninterpretableXMLContent UninterpretableXMLContent}</td><td>Unable to interpret content</td><td>XML</td><td>ERROR</td></tr> 152 * <tr><td>{@link libsbmlConstants#BadXMLDocumentStructure BadXMLDocumentStructure}</td><td>Bad XML document structure</td><td>XML</td><td>ERROR</td></tr> 153 * <tr><td>{@link libsbmlConstants#InvalidAfterXMLContent InvalidAfterXMLContent}</td><td>Encountered invalid content after expected content</td><td>XML</td><td>ERROR</td></tr> 154 * <tr><td>{@link libsbmlConstants#XMLExpectedQuotedString XMLExpectedQuotedString}</td><td>Expected to find a quoted string</td><td>XML</td><td>ERROR</td></tr> 155 * <tr><td>{@link libsbmlConstants#XMLEmptyValueNotPermitted XMLEmptyValueNotPermitted}</td><td>An empty value is not permitted in this context</td><td>XML</td><td>ERROR</td></tr> 156 * <tr><td>{@link libsbmlConstants#XMLBadNumber XMLBadNumber}</td><td>Invalid or unrecognized number</td><td>XML</td><td>ERROR</td></tr> 157 * <tr><td>{@link libsbmlConstants#XMLBadColon XMLBadColon}</td><td>Colon characters are invalid in this context</td><td>XML</td><td>ERROR</td></tr> 158 * <tr><td>{@link libsbmlConstants#MissingXMLElements MissingXMLElements}</td><td>One or more expected elements are missing</td><td>XML</td><td>ERROR</td></tr> 159 * <tr><td>{@link libsbmlConstants#XMLContentEmpty XMLContentEmpty}</td><td>Main XML content is empty</td><td>XML</td><td>ERROR</td></tr> 160 * </table> 161 * </center> 162 <p> 163 * <h3><a class='anchor' 164 * name='error-categories'>Category codes associated with {@link XMLError} objects</a></h3> 165 <p> 166 * As discussed above, each {@link XMLError} object contains a value for a category 167 * identifier, describing the type of issue that the {@link XMLError} object represents. 168 * The category can be retrieved from an {@link XMLError} object using the method 169 * {@link XMLError#getCategory()}. The following table lists each possible value 170 * and a brief description of its meaning. 171 <p> 172 * As is the case with the error codes, in the libSBML Java language 173 * interface, the category identifiers are currently implemented as static 174 * integer constants defined in the interface class 175 * <code>libsbmlConstants</code> in the file '<a 176 * href='libsbmlConstants.html'>libsbmlConstants.java</a>'. 177 <p> 178 * <center> 179 * <table width='95%' cellspacing='1' cellpadding='1' border='0' 180 * class='text-table normal-font alt-row-colors'> 181 * <tr style='background: lightgray' class='normal-font'> 182 * <th style='text-align: left'>Enumerator</th> 183 * <th>Meaning</th> 184 * </tr> 185 * <tr><td>{@link libsbmlConstants#LIBSBML_CAT_INTERNAL LIBSBML_CAT_INTERNAL}</td> 186 * <td>A problem involving the libSBML 187 * software itself or the underlying XML parser. This almost certainly 188 * indicates a software defect (i.e., bug) in libSBML. Please report 189 * instances of this to the libSBML developers.</td></tr> 190 * <tr><td>{@link libsbmlConstants#LIBSBML_CAT_SYSTEM LIBSBML_CAT_SYSTEM}</td> 191 * <td>A problem reported by the operating 192 * system, such as an inability to read or write a file. This indicates 193 * something that is not a program error but is outside of the control of 194 * libSBML.</td></tr> 195 * <tr><td>{@link libsbmlConstants#LIBSBML_CAT_XML LIBSBML_CAT_XML}</td> 196 * <td>A problem in the XML content itself. This 197 * usually arises from malformed XML or the use of 198 * constructs not permitted in SBML.</td></tr> 199 * </table> 200 * </center> 201 <p> 202 * <h3><a class='anchor' 203 * name='error-severities'>Severity codes associated with {@link XMLError} objects</a></h3> 204 <p> 205 * As described above, each {@link XMLError} object contains a value for a severity 206 * code, describing how severe is the issue that the {@link XMLError} object 207 * represents. The severity be retrieved from an {@link XMLError} object using the 208 * method {@link XMLError#getSeverity()}. The following table lists each possible 209 * value and a brief description of its meaning. 210 <p> 211 * As is the case with the category codes, in the libSBML Java language 212 * interface, these severity codes are currently 213 * implemented as static integer constants defined in the interface class 214 * <code>libsbmlConstants</code> in the file '<a 215 * href='libsbmlConstants.html'>libsbmlConstants.java</a>'. This 216 * is admittedly not an ideal approach from the standpoint of modern Java 217 * programming, but it was necessary to work around the lack of 218 * enumerations in Java prior to JDK 1.5. Future versions of libSBML may 219 * use a proper Java enumeration type to define the severity 220 * codes. 221 <p> 222 * <center> 223 * <table width='95%' cellspacing='1' cellpadding='1' border='0' 224 * class='text-table normal-font alt-row-colors'> 225 * <tr style='background: lightgray' class='normal-font'> 226 * <th style='text-align: left'>Enumerator</th> 227 * <th>Meaning</th> 228 * </tr> 229 * <tr><td>{@link libsbmlConstants#LIBSBML_SEV_INFO LIBSBML_SEV_INFO}</td> 230 * <td>The error is actually informational and 231 * not necessarily a serious problem.</td></tr> 232 * <tr><td>{@link libsbmlConstants#LIBSBML_SEV_WARNING LIBSBML_SEV_WARNING}</td> 233 * <td>The error object represents a problem 234 * that is not serious enough to necessarily stop the problem, but 235 * applications should take note of the problem and evaluate what its 236 * implications may be.</td></tr> 237 * <tr><td>{@link libsbmlConstants#LIBSBML_SEV_ERROR LIBSBML_SEV_ERROR}</td> 238 * <td>The error object represents a serious 239 * error. The application may continue running but it is unlikely to be 240 * able to continue processing the same XML file or data stream.</td></tr> 241 * <tr><td>{@link libsbmlConstants#LIBSBML_SEV_FATAL LIBSBML_SEV_FATAL}</td> 242 * <td>A serious error occurred, such as an 243 * out-of-memory condition, and the software should terminate 244 * immediately.</td></tr> 245 * </table> 246 * </center> 247 */ 248 249public class XMLError { 250 private long swigCPtr; 251 protected boolean swigCMemOwn; 252 253 protected XMLError(long cPtr, boolean cMemoryOwn) 254 { 255 swigCMemOwn = cMemoryOwn; 256 swigCPtr = cPtr; 257 } 258 259 protected static long getCPtr(XMLError obj) 260 { 261 return (obj == null) ? 0 : obj.swigCPtr; 262 } 263 264 protected static long getCPtrAndDisown (XMLError obj) 265 { 266 long ptr = 0; 267 268 if (obj != null) 269 { 270 ptr = obj.swigCPtr; 271 obj.swigCMemOwn = false; 272 } 273 274 return ptr; 275 } 276 277 protected void finalize() { 278 delete(); 279 } 280 281 public synchronized void delete() { 282 if (swigCPtr != 0) { 283 if (swigCMemOwn) { 284 swigCMemOwn = false; 285 libsbmlJNI.delete_XMLError(swigCPtr); 286 } 287 swigCPtr = 0; 288 } 289 } 290 291 /** 292 * Equality comparison method for XMLError. 293 * <p> 294 * Because the Java methods for libSBML are actually wrappers around code 295 * implemented in C++ and C, certain operations will not behave as 296 * expected. Equality comparison is one such case. An instance of a 297 * libSBML object class is actually a <em>proxy object</em> 298 * wrapping the real underlying C/C++ object. The normal <code>==</code> 299 * equality operator in Java will <em>only compare the Java proxy objects</em>, 300 * not the underlying native object. The result is almost never what you 301 * want in practical situations. Unfortunately, Java does not provide a 302 * way to override <code>==</code>. 303 * <p> 304 * The alternative that must be followed is to use the 305 * <code>equals()</code> method. The <code>equals</code> method on this 306 * class overrides the default java.lang.Object one, and performs an 307 * intelligent comparison of instances of objects of this class. The 308 * result is an assessment of whether two libSBML Java objects are truly 309 * the same underlying native-code objects. 310 * <p> 311 * The use of this method in practice is the same as the use of any other 312 * Java <code>equals</code> method. For example, 313 * <em>a</em><code>.equals(</code><em>b</em><code>)</code> returns 314 * <code>true</code> if <em>a</em> and <em>b</em> are references to the 315 * same underlying object. 316 * 317 * @param sb a reference to an object to which the current object 318 * instance will be compared 319 * 320 * @return <code>true</code> if <code>sb</code> refers to the same underlying 321 * native object as this one, <code>false</code> otherwise 322 */ 323 public boolean equals(Object sb) 324 { 325 if ( this == sb ) 326 { 327 return true; 328 } 329 return swigCPtr == getCPtr((XMLError)(sb)); 330 } 331 332 /** 333 * Returns a hashcode for this XMLError object. 334 * 335 * @return a hash code usable by Java methods that need them. 336 */ 337 public int hashCode() 338 { 339 return (int)(swigCPtr^(swigCPtr>>>32)); 340 } 341 342 343/** 344 * Creates a new {@link XMLError} to report that something occurred during XML 345 * processing. 346 <p> 347 * {@link XMLError} objects have identification numbers to indicate the nature of 348 * the exception. These numbers are defined as longeger constants in the file 349 * 'libsbmlConstants.java'. See the <a class='el' 350 * href='#error-codes'>top of this documentation</a> for a table 351 * listing the possible values and their meanings. The argument 352 * <code>errorId</code> to this constructor <em>can</em> be (but does not have to be) a 353 * value from this set of constants. If it is 354 * one of the predefined error identifiers, the {@link XMLError} class assumes 355 * the error is a low-level system or XML layer error and 356 * <em>prepends</em> a built-in, predefined error message to any string 357 * passed in the argument <code>details</code> to this constructor. In addition, 358 * all the predefined error identifiers have associated values for the 359 * <code>severity</code> and <code>category</code> codes, and these fields are filled-in as 360 * well. 361 <p> 362 * If the error identifier <code>errorId</code> is a number greater than 9999, this 363 * constructor assumes that the error was generated from another part of 364 * the software, and does not do additional filling in of values beyond 365 * the defaults in the constructor itself. This allows {@link XMLError} to serve 366 * as a base class for other errors (and is used in this way elsewhere in 367 * libSBML). Callers should fill in all the parameters with suitable 368 * values if generating errors with codes greater than 9999 to make 369 * maximum use of the {@link XMLError} facilities. 370 <p> 371 * As mentioned above, 372 * there are additional constants defined for <a class='el' 373 * href='#error-severities'>standard severity</a> and <a class='el' 374 * href='#error-categories'>standard category</a> codes, and every predefined 375 * error in libSBML has an associated value for severity and category taken 376 * from these predefined sets. These constants have symbol names 377 * prefixed with <code>LIBSBML_SEV_</code> and <code>LIBSBML_CAT_</code>, 378 * respectively. If the value of <code>errorId</code> is one of the standard error 379 * codes, callers do not need to fill in <code>severity</code> and <code>category</code> in a 380 * call to this constructor. Conversely, if <code>errorId</code> is not an existing 381 * XML-level error code, callers can use other values for <code>severity</code> and 382 * <code>category</code>. 383 <p> 384 * @param errorId a long integer, the identification number of the error. 385 <p> 386 * @param details a string containing additional details about the error. 387 * If the error code in <code>errorId</code> is one that is recognized by {@link XMLError}, 388 * the given message is <em>appended</em> to a predefined message associated 389 * with the given code. If the error code is not recognized, the message 390 * is stored as-is as the text of the error. 391 <p> 392 * @param line a long integer, the line number at which the error occured. 393 <p> 394 * @param column a long integer, the column number at which the error occured. 395 <p> 396 * @param severity an integer indicating severity of the error. 397 <p> 398 * @param category an integer indicating the category to which the error 399 * belongs. 400 <p> 401 * 402</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 403The native C++ implementation of this method defines a default argument 404value. In the documentation generated for different libSBML language 405bindings, you may or may not see corresponding arguments in the method 406declarations. For example, in Java and C#, a default argument is handled by 407declaring two separate methods, with one of them having the argument and 408the other one lacking the argument. However, the libSBML documentation will 409be <em>identical</em> for both methods. Consequently, if you are reading 410this and do not see an argument even though one is described, please look 411for descriptions of other variants of this method near where this one 412appears in the documentation. 413</dd></dl> 414 415 */ public 416 XMLError(int errorId, String details, long line, long column, long severity, long category) throws org.sbml.libsbml.XMLConstructorException { 417 this(libsbmlJNI.new_XMLError__SWIG_0(errorId, details, line, column, severity, category), true); 418 } 419 420 421/** 422 * Creates a new {@link XMLError} to report that something occurred during XML 423 * processing. 424 <p> 425 * {@link XMLError} objects have identification numbers to indicate the nature of 426 * the exception. These numbers are defined as longeger constants in the file 427 * 'libsbmlConstants.java'. See the <a class='el' 428 * href='#error-codes'>top of this documentation</a> for a table 429 * listing the possible values and their meanings. The argument 430 * <code>errorId</code> to this constructor <em>can</em> be (but does not have to be) a 431 * value from this set of constants. If it is 432 * one of the predefined error identifiers, the {@link XMLError} class assumes 433 * the error is a low-level system or XML layer error and 434 * <em>prepends</em> a built-in, predefined error message to any string 435 * passed in the argument <code>details</code> to this constructor. In addition, 436 * all the predefined error identifiers have associated values for the 437 * <code>severity</code> and <code>category</code> codes, and these fields are filled-in as 438 * well. 439 <p> 440 * If the error identifier <code>errorId</code> is a number greater than 9999, this 441 * constructor assumes that the error was generated from another part of 442 * the software, and does not do additional filling in of values beyond 443 * the defaults in the constructor itself. This allows {@link XMLError} to serve 444 * as a base class for other errors (and is used in this way elsewhere in 445 * libSBML). Callers should fill in all the parameters with suitable 446 * values if generating errors with codes greater than 9999 to make 447 * maximum use of the {@link XMLError} facilities. 448 <p> 449 * As mentioned above, 450 * there are additional constants defined for <a class='el' 451 * href='#error-severities'>standard severity</a> and <a class='el' 452 * href='#error-categories'>standard category</a> codes, and every predefined 453 * error in libSBML has an associated value for severity and category taken 454 * from these predefined sets. These constants have symbol names 455 * prefixed with <code>LIBSBML_SEV_</code> and <code>LIBSBML_CAT_</code>, 456 * respectively. If the value of <code>errorId</code> is one of the standard error 457 * codes, callers do not need to fill in <code>severity</code> and <code>category</code> in a 458 * call to this constructor. Conversely, if <code>errorId</code> is not an existing 459 * XML-level error code, callers can use other values for <code>severity</code> and 460 * <code>category</code>. 461 <p> 462 * @param errorId a long integer, the identification number of the error. 463 <p> 464 * @param details a string containing additional details about the error. 465 * If the error code in <code>errorId</code> is one that is recognized by {@link XMLError}, 466 * the given message is <em>appended</em> to a predefined message associated 467 * with the given code. If the error code is not recognized, the message 468 * is stored as-is as the text of the error. 469 <p> 470 * @param line a long integer, the line number at which the error occured. 471 <p> 472 * @param column a long integer, the column number at which the error occured. 473 <p> 474 * @param severity an integer indicating severity of the error. 475 <p> 476 * @param category an integer indicating the category to which the error 477 * belongs. 478 <p> 479 * 480</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 481The native C++ implementation of this method defines a default argument 482value. In the documentation generated for different libSBML language 483bindings, you may or may not see corresponding arguments in the method 484declarations. For example, in Java and C#, a default argument is handled by 485declaring two separate methods, with one of them having the argument and 486the other one lacking the argument. However, the libSBML documentation will 487be <em>identical</em> for both methods. Consequently, if you are reading 488this and do not see an argument even though one is described, please look 489for descriptions of other variants of this method near where this one 490appears in the documentation. 491</dd></dl> 492 493 */ public 494 XMLError(int errorId, String details, long line, long column, long severity) throws org.sbml.libsbml.XMLConstructorException { 495 this(libsbmlJNI.new_XMLError__SWIG_1(errorId, details, line, column, severity), true); 496 } 497 498 499/** 500 * Creates a new {@link XMLError} to report that something occurred during XML 501 * processing. 502 <p> 503 * {@link XMLError} objects have identification numbers to indicate the nature of 504 * the exception. These numbers are defined as longeger constants in the file 505 * 'libsbmlConstants.java'. See the <a class='el' 506 * href='#error-codes'>top of this documentation</a> for a table 507 * listing the possible values and their meanings. The argument 508 * <code>errorId</code> to this constructor <em>can</em> be (but does not have to be) a 509 * value from this set of constants. If it is 510 * one of the predefined error identifiers, the {@link XMLError} class assumes 511 * the error is a low-level system or XML layer error and 512 * <em>prepends</em> a built-in, predefined error message to any string 513 * passed in the argument <code>details</code> to this constructor. In addition, 514 * all the predefined error identifiers have associated values for the 515 * <code>severity</code> and <code>category</code> codes, and these fields are filled-in as 516 * well. 517 <p> 518 * If the error identifier <code>errorId</code> is a number greater than 9999, this 519 * constructor assumes that the error was generated from another part of 520 * the software, and does not do additional filling in of values beyond 521 * the defaults in the constructor itself. This allows {@link XMLError} to serve 522 * as a base class for other errors (and is used in this way elsewhere in 523 * libSBML). Callers should fill in all the parameters with suitable 524 * values if generating errors with codes greater than 9999 to make 525 * maximum use of the {@link XMLError} facilities. 526 <p> 527 * As mentioned above, 528 * there are additional constants defined for <a class='el' 529 * href='#error-severities'>standard severity</a> and <a class='el' 530 * href='#error-categories'>standard category</a> codes, and every predefined 531 * error in libSBML has an associated value for severity and category taken 532 * from these predefined sets. These constants have symbol names 533 * prefixed with <code>LIBSBML_SEV_</code> and <code>LIBSBML_CAT_</code>, 534 * respectively. If the value of <code>errorId</code> is one of the standard error 535 * codes, callers do not need to fill in <code>severity</code> and <code>category</code> in a 536 * call to this constructor. Conversely, if <code>errorId</code> is not an existing 537 * XML-level error code, callers can use other values for <code>severity</code> and 538 * <code>category</code>. 539 <p> 540 * @param errorId a long integer, the identification number of the error. 541 <p> 542 * @param details a string containing additional details about the error. 543 * If the error code in <code>errorId</code> is one that is recognized by {@link XMLError}, 544 * the given message is <em>appended</em> to a predefined message associated 545 * with the given code. If the error code is not recognized, the message 546 * is stored as-is as the text of the error. 547 <p> 548 * @param line a long integer, the line number at which the error occured. 549 <p> 550 * @param column a long integer, the column number at which the error occured. 551 <p> 552 * @param severity an integer indicating severity of the error. 553 <p> 554 * @param category an integer indicating the category to which the error 555 * belongs. 556 <p> 557 * 558</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 559The native C++ implementation of this method defines a default argument 560value. In the documentation generated for different libSBML language 561bindings, you may or may not see corresponding arguments in the method 562declarations. For example, in Java and C#, a default argument is handled by 563declaring two separate methods, with one of them having the argument and 564the other one lacking the argument. However, the libSBML documentation will 565be <em>identical</em> for both methods. Consequently, if you are reading 566this and do not see an argument even though one is described, please look 567for descriptions of other variants of this method near where this one 568appears in the documentation. 569</dd></dl> 570 571 */ public 572 XMLError(int errorId, String details, long line, long column) throws org.sbml.libsbml.XMLConstructorException { 573 this(libsbmlJNI.new_XMLError__SWIG_2(errorId, details, line, column), true); 574 } 575 576 577/** 578 * Creates a new {@link XMLError} to report that something occurred during XML 579 * processing. 580 <p> 581 * {@link XMLError} objects have identification numbers to indicate the nature of 582 * the exception. These numbers are defined as longeger constants in the file 583 * 'libsbmlConstants.java'. See the <a class='el' 584 * href='#error-codes'>top of this documentation</a> for a table 585 * listing the possible values and their meanings. The argument 586 * <code>errorId</code> to this constructor <em>can</em> be (but does not have to be) a 587 * value from this set of constants. If it is 588 * one of the predefined error identifiers, the {@link XMLError} class assumes 589 * the error is a low-level system or XML layer error and 590 * <em>prepends</em> a built-in, predefined error message to any string 591 * passed in the argument <code>details</code> to this constructor. In addition, 592 * all the predefined error identifiers have associated values for the 593 * <code>severity</code> and <code>category</code> codes, and these fields are filled-in as 594 * well. 595 <p> 596 * If the error identifier <code>errorId</code> is a number greater than 9999, this 597 * constructor assumes that the error was generated from another part of 598 * the software, and does not do additional filling in of values beyond 599 * the defaults in the constructor itself. This allows {@link XMLError} to serve 600 * as a base class for other errors (and is used in this way elsewhere in 601 * libSBML). Callers should fill in all the parameters with suitable 602 * values if generating errors with codes greater than 9999 to make 603 * maximum use of the {@link XMLError} facilities. 604 <p> 605 * As mentioned above, 606 * there are additional constants defined for <a class='el' 607 * href='#error-severities'>standard severity</a> and <a class='el' 608 * href='#error-categories'>standard category</a> codes, and every predefined 609 * error in libSBML has an associated value for severity and category taken 610 * from these predefined sets. These constants have symbol names 611 * prefixed with <code>LIBSBML_SEV_</code> and <code>LIBSBML_CAT_</code>, 612 * respectively. If the value of <code>errorId</code> is one of the standard error 613 * codes, callers do not need to fill in <code>severity</code> and <code>category</code> in a 614 * call to this constructor. Conversely, if <code>errorId</code> is not an existing 615 * XML-level error code, callers can use other values for <code>severity</code> and 616 * <code>category</code>. 617 <p> 618 * @param errorId a long integer, the identification number of the error. 619 <p> 620 * @param details a string containing additional details about the error. 621 * If the error code in <code>errorId</code> is one that is recognized by {@link XMLError}, 622 * the given message is <em>appended</em> to a predefined message associated 623 * with the given code. If the error code is not recognized, the message 624 * is stored as-is as the text of the error. 625 <p> 626 * @param line a long integer, the line number at which the error occured. 627 <p> 628 * @param column a long integer, the column number at which the error occured. 629 <p> 630 * @param severity an integer indicating severity of the error. 631 <p> 632 * @param category an integer indicating the category to which the error 633 * belongs. 634 <p> 635 * 636</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 637The native C++ implementation of this method defines a default argument 638value. In the documentation generated for different libSBML language 639bindings, you may or may not see corresponding arguments in the method 640declarations. For example, in Java and C#, a default argument is handled by 641declaring two separate methods, with one of them having the argument and 642the other one lacking the argument. However, the libSBML documentation will 643be <em>identical</em> for both methods. Consequently, if you are reading 644this and do not see an argument even though one is described, please look 645for descriptions of other variants of this method near where this one 646appears in the documentation. 647</dd></dl> 648 649 */ public 650 XMLError(int errorId, String details, long line) throws org.sbml.libsbml.XMLConstructorException { 651 this(libsbmlJNI.new_XMLError__SWIG_3(errorId, details, line), true); 652 } 653 654 655/** 656 * Creates a new {@link XMLError} to report that something occurred during XML 657 * processing. 658 <p> 659 * {@link XMLError} objects have identification numbers to indicate the nature of 660 * the exception. These numbers are defined as longeger constants in the file 661 * 'libsbmlConstants.java'. See the <a class='el' 662 * href='#error-codes'>top of this documentation</a> for a table 663 * listing the possible values and their meanings. The argument 664 * <code>errorId</code> to this constructor <em>can</em> be (but does not have to be) a 665 * value from this set of constants. If it is 666 * one of the predefined error identifiers, the {@link XMLError} class assumes 667 * the error is a low-level system or XML layer error and 668 * <em>prepends</em> a built-in, predefined error message to any string 669 * passed in the argument <code>details</code> to this constructor. In addition, 670 * all the predefined error identifiers have associated values for the 671 * <code>severity</code> and <code>category</code> codes, and these fields are filled-in as 672 * well. 673 <p> 674 * If the error identifier <code>errorId</code> is a number greater than 9999, this 675 * constructor assumes that the error was generated from another part of 676 * the software, and does not do additional filling in of values beyond 677 * the defaults in the constructor itself. This allows {@link XMLError} to serve 678 * as a base class for other errors (and is used in this way elsewhere in 679 * libSBML). Callers should fill in all the parameters with suitable 680 * values if generating errors with codes greater than 9999 to make 681 * maximum use of the {@link XMLError} facilities. 682 <p> 683 * As mentioned above, 684 * there are additional constants defined for <a class='el' 685 * href='#error-severities'>standard severity</a> and <a class='el' 686 * href='#error-categories'>standard category</a> codes, and every predefined 687 * error in libSBML has an associated value for severity and category taken 688 * from these predefined sets. These constants have symbol names 689 * prefixed with <code>LIBSBML_SEV_</code> and <code>LIBSBML_CAT_</code>, 690 * respectively. If the value of <code>errorId</code> is one of the standard error 691 * codes, callers do not need to fill in <code>severity</code> and <code>category</code> in a 692 * call to this constructor. Conversely, if <code>errorId</code> is not an existing 693 * XML-level error code, callers can use other values for <code>severity</code> and 694 * <code>category</code>. 695 <p> 696 * @param errorId a long integer, the identification number of the error. 697 <p> 698 * @param details a string containing additional details about the error. 699 * If the error code in <code>errorId</code> is one that is recognized by {@link XMLError}, 700 * the given message is <em>appended</em> to a predefined message associated 701 * with the given code. If the error code is not recognized, the message 702 * is stored as-is as the text of the error. 703 <p> 704 * @param line a long integer, the line number at which the error occured. 705 <p> 706 * @param column a long integer, the column number at which the error occured. 707 <p> 708 * @param severity an integer indicating severity of the error. 709 <p> 710 * @param category an integer indicating the category to which the error 711 * belongs. 712 <p> 713 * 714</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 715The native C++ implementation of this method defines a default argument 716value. In the documentation generated for different libSBML language 717bindings, you may or may not see corresponding arguments in the method 718declarations. For example, in Java and C#, a default argument is handled by 719declaring two separate methods, with one of them having the argument and 720the other one lacking the argument. However, the libSBML documentation will 721be <em>identical</em> for both methods. Consequently, if you are reading 722this and do not see an argument even though one is described, please look 723for descriptions of other variants of this method near where this one 724appears in the documentation. 725</dd></dl> 726 727 */ public 728 XMLError(int errorId, String details) throws org.sbml.libsbml.XMLConstructorException { 729 this(libsbmlJNI.new_XMLError__SWIG_4(errorId, details), true); 730 } 731 732 733/** 734 * Creates a new {@link XMLError} to report that something occurred during XML 735 * processing. 736 <p> 737 * {@link XMLError} objects have identification numbers to indicate the nature of 738 * the exception. These numbers are defined as longeger constants in the file 739 * 'libsbmlConstants.java'. See the <a class='el' 740 * href='#error-codes'>top of this documentation</a> for a table 741 * listing the possible values and their meanings. The argument 742 * <code>errorId</code> to this constructor <em>can</em> be (but does not have to be) a 743 * value from this set of constants. If it is 744 * one of the predefined error identifiers, the {@link XMLError} class assumes 745 * the error is a low-level system or XML layer error and 746 * <em>prepends</em> a built-in, predefined error message to any string 747 * passed in the argument <code>details</code> to this constructor. In addition, 748 * all the predefined error identifiers have associated values for the 749 * <code>severity</code> and <code>category</code> codes, and these fields are filled-in as 750 * well. 751 <p> 752 * If the error identifier <code>errorId</code> is a number greater than 9999, this 753 * constructor assumes that the error was generated from another part of 754 * the software, and does not do additional filling in of values beyond 755 * the defaults in the constructor itself. This allows {@link XMLError} to serve 756 * as a base class for other errors (and is used in this way elsewhere in 757 * libSBML). Callers should fill in all the parameters with suitable 758 * values if generating errors with codes greater than 9999 to make 759 * maximum use of the {@link XMLError} facilities. 760 <p> 761 * As mentioned above, 762 * there are additional constants defined for <a class='el' 763 * href='#error-severities'>standard severity</a> and <a class='el' 764 * href='#error-categories'>standard category</a> codes, and every predefined 765 * error in libSBML has an associated value for severity and category taken 766 * from these predefined sets. These constants have symbol names 767 * prefixed with <code>LIBSBML_SEV_</code> and <code>LIBSBML_CAT_</code>, 768 * respectively. If the value of <code>errorId</code> is one of the standard error 769 * codes, callers do not need to fill in <code>severity</code> and <code>category</code> in a 770 * call to this constructor. Conversely, if <code>errorId</code> is not an existing 771 * XML-level error code, callers can use other values for <code>severity</code> and 772 * <code>category</code>. 773 <p> 774 * @param errorId a long integer, the identification number of the error. 775 <p> 776 * @param details a string containing additional details about the error. 777 * If the error code in <code>errorId</code> is one that is recognized by {@link XMLError}, 778 * the given message is <em>appended</em> to a predefined message associated 779 * with the given code. If the error code is not recognized, the message 780 * is stored as-is as the text of the error. 781 <p> 782 * @param line a long integer, the line number at which the error occured. 783 <p> 784 * @param column a long integer, the column number at which the error occured. 785 <p> 786 * @param severity an integer indicating severity of the error. 787 <p> 788 * @param category an integer indicating the category to which the error 789 * belongs. 790 <p> 791 * 792</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 793The native C++ implementation of this method defines a default argument 794value. In the documentation generated for different libSBML language 795bindings, you may or may not see corresponding arguments in the method 796declarations. For example, in Java and C#, a default argument is handled by 797declaring two separate methods, with one of them having the argument and 798the other one lacking the argument. However, the libSBML documentation will 799be <em>identical</em> for both methods. Consequently, if you are reading 800this and do not see an argument even though one is described, please look 801for descriptions of other variants of this method near where this one 802appears in the documentation. 803</dd></dl> 804 805 */ public 806 XMLError(int errorId) throws org.sbml.libsbml.XMLConstructorException { 807 this(libsbmlJNI.new_XMLError__SWIG_5(errorId), true); 808 } 809 810 811/** 812 * Creates a new {@link XMLError} to report that something occurred during XML 813 * processing. 814 <p> 815 * {@link XMLError} objects have identification numbers to indicate the nature of 816 * the exception. These numbers are defined as longeger constants in the file 817 * 'libsbmlConstants.java'. See the <a class='el' 818 * href='#error-codes'>top of this documentation</a> for a table 819 * listing the possible values and their meanings. The argument 820 * <code>errorId</code> to this constructor <em>can</em> be (but does not have to be) a 821 * value from this set of constants. If it is 822 * one of the predefined error identifiers, the {@link XMLError} class assumes 823 * the error is a low-level system or XML layer error and 824 * <em>prepends</em> a built-in, predefined error message to any string 825 * passed in the argument <code>details</code> to this constructor. In addition, 826 * all the predefined error identifiers have associated values for the 827 * <code>severity</code> and <code>category</code> codes, and these fields are filled-in as 828 * well. 829 <p> 830 * If the error identifier <code>errorId</code> is a number greater than 9999, this 831 * constructor assumes that the error was generated from another part of 832 * the software, and does not do additional filling in of values beyond 833 * the defaults in the constructor itself. This allows {@link XMLError} to serve 834 * as a base class for other errors (and is used in this way elsewhere in 835 * libSBML). Callers should fill in all the parameters with suitable 836 * values if generating errors with codes greater than 9999 to make 837 * maximum use of the {@link XMLError} facilities. 838 <p> 839 * As mentioned above, 840 * there are additional constants defined for <a class='el' 841 * href='#error-severities'>standard severity</a> and <a class='el' 842 * href='#error-categories'>standard category</a> codes, and every predefined 843 * error in libSBML has an associated value for severity and category taken 844 * from these predefined sets. These constants have symbol names 845 * prefixed with <code>LIBSBML_SEV_</code> and <code>LIBSBML_CAT_</code>, 846 * respectively. If the value of <code>errorId</code> is one of the standard error 847 * codes, callers do not need to fill in <code>severity</code> and <code>category</code> in a 848 * call to this constructor. Conversely, if <code>errorId</code> is not an existing 849 * XML-level error code, callers can use other values for <code>severity</code> and 850 * <code>category</code>. 851 <p> 852 * @param errorId a long integer, the identification number of the error. 853 <p> 854 * @param details a string containing additional details about the error. 855 * If the error code in <code>errorId</code> is one that is recognized by {@link XMLError}, 856 * the given message is <em>appended</em> to a predefined message associated 857 * with the given code. If the error code is not recognized, the message 858 * is stored as-is as the text of the error. 859 <p> 860 * @param line a long integer, the line number at which the error occured. 861 <p> 862 * @param column a long integer, the column number at which the error occured. 863 <p> 864 * @param severity an integer indicating severity of the error. 865 <p> 866 * @param category an integer indicating the category to which the error 867 * belongs. 868 <p> 869 * 870</dl><dl class="docnote"><dt><b>Documentation note:</b></dt><dd> 871The native C++ implementation of this method defines a default argument 872value. In the documentation generated for different libSBML language 873bindings, you may or may not see corresponding arguments in the method 874declarations. For example, in Java and C#, a default argument is handled by 875declaring two separate methods, with one of them having the argument and 876the other one lacking the argument. However, the libSBML documentation will 877be <em>identical</em> for both methods. Consequently, if you are reading 878this and do not see an argument even though one is described, please look 879for descriptions of other variants of this method near where this one 880appears in the documentation. 881</dd></dl> 882 883 */ public 884 XMLError() throws org.sbml.libsbml.XMLConstructorException { 885 this(libsbmlJNI.new_XMLError__SWIG_6(), true); 886 } 887 888 889/** 890 * Copy constructor; creates a copy of this {@link XMLError}. 891 <p> 892 * <code>orig</code> the {@link XMLError} object to copy. 893 */ public 894 XMLError(XMLError orig) throws org.sbml.libsbml.XMLConstructorException { 895 this(libsbmlJNI.new_XMLError__SWIG_7(XMLError.getCPtr(orig), orig), true); 896 } 897 898 899/** 900 * Returns the identifier of this error. 901 <p> 902 * @return the error code for this error. 903 <p> 904 * @see #getMessage() 905 * @see #getShortMessage() 906 * @see #getCategory() 907 * @see #getSeverity() 908 */ public 909 long getErrorId() { 910 return libsbmlJNI.XMLError_getErrorId(swigCPtr, this); 911 } 912 913 914/** 915 * Returns the message text of this error. 916 <p> 917 * The message associated with an error object describes the nature of 918 * the problem. The message returned by this method is generally longer 919 * and clearer than the message returned by {@link XMLError#getShortMessage()}, 920 * but not in all cases. 921 <p> 922 * Callers may use {@link XMLError#getCategory()} and {@link XMLError#getSeverity()} to 923 * obtain additional information about the nature and severity of the 924 * problem. 925 <p> 926 * @return the message text. 927 <p> 928 * @see #getErrorId() 929 * @see #getShortMessage() 930 * @see #getCategory() 931 * @see #getSeverity() 932 */ public 933 String getMessage() { 934 return libsbmlJNI.XMLError_getMessage(swigCPtr, this); 935 } 936 937 938/** 939 * Returns a brief message for this error. 940 <p> 941 * This is an alternative error message that, in general, is as short as 942 * the authors could make it. However, brevity is often inversely 943 * proportional to clarity, so this short message may not be sufficiently 944 * informative to understand the nature of the error. Calling 945 * applications may wish to check {@link XMLError#getMessage()} in addition or 946 * instead. 947 <p> 948 * @return the short error message text. 949 <p> 950 * @see #getErrorId() 951 * @see #getMessage() 952 * @see #getCategory() 953 * @see #getSeverity() 954 */ public 955 String getShortMessage() { 956 return libsbmlJNI.XMLError_getShortMessage(swigCPtr, this); 957 } 958 959 960/** 961 * Returns the line number in the XML input near where the error, warning 962 * or other diagnostic occurred. 963 <p> 964 * We say 'near where the problem occurred', because many factors affect 965 * how accurate the line/column information ultimately is. For example, 966 * sometimes, the underlying XML parsers can only report such information 967 * for the parent XML element where an error occurs, and not for the 968 * specific point where the problem occurs. In other situations, some 969 * parsers report invalid line and/or column numbers altogether. If this 970 * occurs, libSBML sets the line and/or column number in the {@link XMLError} 971 * object to either <code>0</code> or the value of the maximum unsigned 972 * long integer representable on the platform where libSBML is running. 973 * The probability that a true line or column number in an SBML model 974 * would equal this value is vanishingly small; thus, if an application 975 * encounters these values in an {@link XMLError} object, it can assume no valid 976 * line/column number could be provided by libSBML in that situation. 977 <p> 978 * @return the line number. 979 <p> 980 * @see #getColumn() 981 */ public 982 long getLine() { 983 return libsbmlJNI.XMLError_getLine(swigCPtr, this); 984 } 985 986 987/** 988 * Returns the column number in the XML input near where the error, 989 * warning or other diagnostic occurred. 990 <p> 991 * We say 'near where the problem occurred', because many factors affect 992 * how accurate the line/column information ultimately is. For example, 993 * sometimes, the underlying XML parsers can only report such information 994 * for the parent XML element where an error occurs, and not for the 995 * specific point where the problem occurs. In other situations, some 996 * parsers report invalid line and/or column numbers altogether. If this 997 * occurs, libSBML sets the line and/or column number in the {@link XMLError} 998 * object to either <code>0</code> or the value of the maximum unsigned 999 * long integer representable on the platform where libSBML is running. 1000 * The probability that a true line or column number in an SBML model 1001 * would equal this value is vanishingly small; thus, if an application 1002 * encounters these values in an {@link XMLError} object, it can assume no valid 1003 * line/column number could be provided by libSBML in that situation. 1004 <p> 1005 * @return the column number. 1006 <p> 1007 * @see #getLine() 1008 */ public 1009 long getColumn() { 1010 return libsbmlJNI.XMLError_getColumn(swigCPtr, this); 1011 } 1012 1013 1014/** 1015 * Returns the severity of this error. 1016 <p> 1017 * {@link XMLError} defines an enumeration of severity codes for the XML layer. 1018 * Applications that build on {@link XMLError} by subclassing it may add their 1019 * own severity codes with numbers higher than those in the predefined 1020 * set of severity codes. 1021 <p> 1022 * @return the severity of this {@link XMLError}. 1023 <p> 1024 * @see #getSeverityAsString() 1025 * @see #getCategory() 1026 */ public 1027 long getSeverity() { 1028 return libsbmlJNI.XMLError_getSeverity(swigCPtr, this); 1029 } 1030 1031 1032/** 1033 * Returns a string describing the severity level of this error. 1034 <p> 1035 * {@link XMLError} defines an enumeration of severity codes for the XML layer. 1036 * Applications that build on {@link XMLError} by subclassing it may add their 1037 * own severity codes with numbers higher than those in the predefined 1038 * set of severity codes. 1039 <p> 1040 * @return string representing the severity of this {@link XMLError}. 1041 <p> 1042 * @see #getSeverity() 1043 * @see #getCategoryAsString() 1044 */ public 1045 String getSeverityAsString() { 1046 return libsbmlJNI.XMLError_getSeverityAsString(swigCPtr, this); 1047 } 1048 1049 1050/** 1051 * Returns the category of this error. 1052 <p> 1053 * {@link XMLError} defines an enumeration of category codes for the XML layer. 1054 * Applications that build on {@link XMLError} by subclassing it may add their 1055 * own categories with numbers higher than those in the predefined 1056 * set of category codes. 1057 <p> 1058 * Categories can be used to partition errors into distinct groups. 1059 * Among other things, this can be used to prevent id conflicts by 1060 * uniquely identifying an {@link XMLError} by both id and category. 1061 <p> 1062 * @return the category of this {@link XMLError}. 1063 <p> 1064 * @see #getSeverity() 1065 * @see #getCategoryAsString() 1066 */ public 1067 long getCategory() { 1068 return libsbmlJNI.XMLError_getCategory(swigCPtr, this); 1069 } 1070 1071 1072/** 1073 * Returns a string describing the category of this error. 1074 <p> 1075 * {@link XMLError} defines an enumeration of category codes for the XML layer. 1076 * Applications that build on {@link XMLError} by subclassing it may add their 1077 * own categories with numbers higher than those in the predefined 1078 * set of category codes. 1079 <p> 1080 * Categories can be used to partition errors into distinct groups. 1081 * Among other things, this can be used to prevent id conflicts by 1082 * uniquely identifying an {@link XMLError} by both id and category. 1083 <p> 1084 * @return string representing the category of this {@link XMLError}. 1085 <p> 1086 * @see #getCategory() 1087 * @see #getSeverityAsString() 1088 */ public 1089 String getCategoryAsString() { 1090 return libsbmlJNI.XMLError_getCategoryAsString(swigCPtr, this); 1091 } 1092 1093 1094/** 1095 * Predicate returning <code>true</code> or <code>false</code> depending on whether this 1096 * error object is for information purposes only. 1097 <p> 1098 * This is equivalent to obtaining the severity code from an {@link XMLError} 1099 * object (via {@link XMLError#getSeverity()}) and then comparing it to the 1100 * value {@link libsbmlConstants#LIBSBML_SEV_INFO LIBSBML_SEV_INFO} from the 1101 * set of predefined 1102 * severity codes. 1103 <p> 1104 * @return <code>true</code> if this {@link XMLError} is for informational purposes only, 1105 * <code>false</code> otherwise. 1106 <p> 1107 * @see #isWarning() 1108 * @see #isError() 1109 * @see #isFatal() 1110 */ public 1111 boolean isInfo() { 1112 return libsbmlJNI.XMLError_isInfo(swigCPtr, this); 1113 } 1114 1115 1116/** 1117 * Predicate returning <code>true</code> or <code>false</code> depending on whether 1118 * this error object is a warning. 1119 <p> 1120 * This is equivalent to obtaining the severity code from an {@link XMLError} 1121 * object (via {@link XMLError#getSeverity()}) and then comparing it to the 1122 * value {@link libsbmlConstants#LIBSBML_SEV_WARNING LIBSBML_SEV_WARNING} from the 1123 * set of predefined 1124 * severity codes. 1125 <p> 1126 * @return <code>true</code> if this error is a warning, <code>false</code> otherwise. 1127 <p> 1128 * @see #isInfo() 1129 * @see #isError() 1130 * @see #isFatal() 1131 */ public 1132 boolean isWarning() { 1133 return libsbmlJNI.XMLError_isWarning(swigCPtr, this); 1134 } 1135 1136 1137/** 1138 * Predicate returning <code>true</code> or <code>false</code> depending on whether this 1139 * error is a significant error. 1140 <p> 1141 * This is equivalent to obtaining the severity code from an {@link XMLError} 1142 * object (via {@link XMLError#getSeverity()}) and then comparing it to the 1143 * value {@link libsbmlConstants#LIBSBML_SEV_ERROR LIBSBML_SEV_ERROR} from the 1144 * set of predefined 1145 * severity codes. 1146 <p> 1147 * @return <code>true</code> if this error is an error, <code>false</code> otherwise. 1148 <p> 1149 * @see #isInfo() 1150 * @see #isWarning() 1151 * @see #isFatal() 1152 */ public 1153 boolean isError() { 1154 return libsbmlJNI.XMLError_isError(swigCPtr, this); 1155 } 1156 1157 1158/** 1159 * Predicate returning <code>true</code> or <code>false</code> depending on whether this 1160 * error is a fatal run-time error. 1161 <p> 1162 * This is equivalent to obtaining the severity code from an {@link XMLError} 1163 * object (via {@link XMLError#getSeverity()}) and then comparing it to the 1164 * value {@link libsbmlConstants#LIBSBML_SEV_FATAL LIBSBML_SEV_FATAL} from the 1165 * set of predefined severity codes. 1166 <p> 1167 * @return <code>true</code> if this error is a fatal error, <code>false</code> otherwise. 1168 <p> 1169 * @see #isInfo() 1170 * @see #isWarning() 1171 * @see #isError() 1172 */ public 1173 boolean isFatal() { 1174 return libsbmlJNI.XMLError_isFatal(swigCPtr, this); 1175 } 1176 1177 1178/** 1179 * Predicate returning <code>true</code> or <code>false</code> depending on whether this 1180 * error resulted from an internal program error. 1181 <p> 1182 * This is equivalent to obtaining the category identifier from an 1183 * {@link XMLError} object (via {@link XMLError#getCategory()}) and then comparing it to 1184 * the value {@link libsbmlConstants#LIBSBML_CAT_INTERNAL LIBSBML_CAT_INTERNAL} from the 1185 * set of predefined category codes. 1186 <p> 1187 * @return a boolean indicating whether the error is an internal error. 1188 <p> 1189 * @see #isSystem() 1190 * @see #isXML() 1191 */ public 1192 boolean isInternal() { 1193 return libsbmlJNI.XMLError_isInternal(swigCPtr, this); 1194 } 1195 1196 1197/** 1198 * Predicate returning <code>true</code> or <code>false</code> depending on whether this 1199 * error was generated by the operating system. 1200 <p> 1201 * This is equivalent to obtaining the category identifier from an 1202 * {@link XMLError} object (via {@link XMLError#getCategory()}) and then comparing it to 1203 * the value {@link libsbmlConstants#LIBSBML_CAT_SYSTEM LIBSBML_CAT_SYSTEM} from the 1204 * set of predefined category codes. 1205 <p> 1206 * @return boolean indicating whether the error is a system error. 1207 <p> 1208 * @see #isInternal() 1209 * @see #isXML() 1210 */ public 1211 boolean isSystem() { 1212 return libsbmlJNI.XMLError_isSystem(swigCPtr, this); 1213 } 1214 1215 1216/** 1217 * Predicate returning <code>true</code> or <code>false</code> depending on whether this 1218 * error resulted from a problem in the XML input (e.g., an XML syntax 1219 * error). 1220 <p> 1221 * This is equivalent to obtaining the category identifier from an 1222 * {@link XMLError} object (via {@link XMLError#getCategory()}) and then comparing it to 1223 * the value {@link libsbmlConstants#LIBSBML_CAT_XML LIBSBML_CAT_XML} from the 1224 * set of predefined category codes. 1225 <p> 1226 * @return a boolean indicating whether the error is an XML catetory error. 1227 <p> 1228 * @see #isInternal() 1229 * @see #isSystem() 1230 */ public 1231 boolean isXML() { 1232 return libsbmlJNI.XMLError_isXML(swigCPtr, this); 1233 } 1234 1235 1236/** 1237 * Predicate returning <code>true</code> or <code>false</code> depending on whether this 1238 * error resulted from a problem or whether it was logged as an unknown 1239 * error. 1240 <p> 1241 * This is equivalent to obtaining the error identifier from an 1242 * {@link XMLError} object (via {@link XMLError#getErrorId()}) and then comparing it to 1243 * the value XMLUnknownError or UnknownError from the 1244 * set of predefined error codes. 1245 <p> 1246 * @return a boolean indicating whether the error is a valid error (<code>true</code>) 1247 * or whether it is unknown (<code>false</code>). 1248 */ public 1249 boolean isValid() { 1250 return libsbmlJNI.XMLError_isValid(swigCPtr, this); 1251 } 1252 1253 1254/** 1255 * Sets the line number where this error occurred. 1256 <p> 1257 * @param line a long integer, the line number to set. 1258 <p> 1259 * <p> 1260 * @return integer value indicating success/failure of the 1261 * function. This particular 1262 * function only does one thing irrespective of user input or 1263 * object state, and thus will only return a single value: 1264 * <ul> 1265 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1266 * 1267 * </ul> <p> 1268 * @see #setColumn(long column) 1269 */ public 1270 int setLine(long line) { 1271 return libsbmlJNI.XMLError_setLine(swigCPtr, this, line); 1272 } 1273 1274 1275/** 1276 * Sets the column number where this error occurred. 1277 <p> 1278 * @param column a long integer, the column number to set. 1279 <p> 1280 * <p> 1281 * @return integer value indicating success/failure of the 1282 * function. This particular 1283 * function only does one thing irrespective of user input or 1284 * object state, and thus will only return a single value: 1285 * <ul> 1286 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 1287 * 1288 * </ul> <p> 1289 * @see #setLine(long line) 1290 */ public 1291 int setColumn(long column) { 1292 return libsbmlJNI.XMLError_setColumn(swigCPtr, this, column); 1293 } 1294 1295 1296/** 1297 * Returns a copy of the message string associated with the given 1298 * predefined {@link XMLError} code. 1299 <p> 1300 * @param code the error code whose message is sought; it must be a 1301 * predefined value from <a class='el' href='#error-codes'>the set 1302 * of predefined error identifiers</a>. 1303 */ public 1304 static String getStandardMessage(int code) { 1305 return libsbmlJNI.XMLError_getStandardMessage(code); 1306 } 1307 1308 1309/** 1310 * Returns the SBML Level 3 package extension (if any) that logged 1311 * this error. 1312 <p> 1313 * Each error logged by an libSBML extension for SBML Level 3 packages 1314 * includes a record of the package that logged it. The field is a simple 1315 * text string. If the string is empty or has the value <code>'core'</code>, then 1316 * the error came from libSBML core; otherwise, the string will be the 1317 * short-form name of the package (e.g., <code>'comp'</code> for the Hierarchical 1318 * {@link Model} Composition package). 1319 <p> 1320 * @return a string representing the name of the package that logged this 1321 * error. If the error did not come from a package extension, the value 1322 * will be the empty string or <code>'core'.</code> 1323 */ public 1324 String getPackage() { 1325 return libsbmlJNI.XMLError_getPackage(swigCPtr, this); 1326 } 1327 1328 1329/** 1330 * Returns libSBML's internal numerical offset for the error code 1331 * associated with this error. 1332 <p> 1333 * In the SBML Level 3 package specifications, package validation 1334 * rules are identified by 5-digit numbers prefixed with the nickname of 1335 * the package itself—e.g., “comp-10101”, 1336 * “fbc-20301”, etc. Historically, libSBML reported error 1337 * codes as pure integers, and some application software systems make 1338 * decisions based on the numerical values of the error codes. To permit 1339 * these applications to continue to function in this fashion, libSBML 1340 * internally continues to maintain error identifiers as pure integers. To 1341 * handle the possibility that errors may come from package extensions, 1342 * libSBML uses numerical offsets added to the internal error codes. These 1343 * offsets add two leading digits to the regular 5-digit error codes; for 1344 * example, “comp” error codes are stored as 1010101, 1020102, 1345 * etc. The offset in this case is 1000000. Another package will have the 1346 * offset 2000000, yet another will have 3000000, etc. 1347 <p> 1348 * This method returns the integer offset in this error's error code. 1349 * Calling applications can get the 5-digit package-specific number for a 1350 * given error code by subtracting the offset from the value reported by 1351 * getErrorId(): 1352 * <pre class='fragment'> 1353 getErrorId() - getErrorIdOffset() 1354 </pre> 1355 * When libSBML produces error messages, it combines the text string 1356 * returned by getPackage() with the subtracted value of the error code, 1357 * to produce a text string of the form “comp-10101”. 1358 <p> 1359 * @see #getErrorId() 1360 * @see #getPackage() 1361 */ public 1362 long getErrorIdOffset() { 1363 return libsbmlJNI.XMLError_getErrorIdOffset(swigCPtr, this); 1364 } 1365 1366}