001/* ----------------------------------------------------------------------------
002 * This file was automatically generated by SWIG (http://www.swig.org).
003 * Version 3.0.8
004 *
005 * Do not make changes to this file unless you know what you are doing--modify
006 * the SWIG interface file instead.
007 * ----------------------------------------------------------------------------- */
008
009package org.sbml.libsbml;
010
011/** 
012 *  Exception used by package extensions
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 * <p>
023 * Certain situations can result in an exception being thrown by libSBML
024 * package extensions.  A prominent example involves the constructor for
025 * {@link SBMLNamespaces} (and its subclasses), which will throw
026 * {@link SBMLExtensionException} if the arguments it is given refer to an unknown
027 * SBML Level&nbsp;3 package.  The situation can arise for legitimate SBML
028 * files if the necessary package extension has not been registered with
029 * a given copy of libSBML.
030 <p>
031 * @see SBMLNamespaces
032 */
033
034public class SBMLExtensionException {
035   private long swigCPtr;
036   protected boolean swigCMemOwn;
037
038   protected SBMLExtensionException(long cPtr, boolean cMemoryOwn)
039   {
040     swigCMemOwn = cMemoryOwn;
041     swigCPtr    = cPtr;
042   }
043
044   protected static long getCPtr(SBMLExtensionException obj)
045   {
046     return (obj == null) ? 0 : obj.swigCPtr;
047   }
048
049   protected static long getCPtrAndDisown (SBMLExtensionException obj)
050   {
051     long ptr = 0;
052
053     if (obj != null)
054     {
055       ptr             = obj.swigCPtr;
056       obj.swigCMemOwn = false;
057     }
058
059     return ptr;
060   }
061
062  protected void finalize() {
063    delete();
064  }
065
066  public synchronized void delete() {
067    if (swigCPtr != 0) {
068      if (swigCMemOwn) {
069        swigCMemOwn = false;
070        libsbmlJNI.delete_SBMLExtensionException(swigCPtr);
071      }
072      swigCPtr = 0;
073    }
074  }
075
076  
077/**
078   * Creates a new {@link SBMLExtensionException} object with a given message.
079   <p>
080   * @param errmsg a string, the text of the error message to store
081   * with this exception
082   */ public
083 SBMLExtensionException(String errmsg) {
084    this(libsbmlJNI.new_SBMLExtensionException(errmsg), true);
085  }
086
087}