libSBML Python API  5.18.0
libsbml.SBMLExtensionRegistry Class Reference
Inheritance diagram for libsbml.SBMLExtensionRegistry:
[legend]

Detailed Description

Registry where package extensions are registered.

This class of objects is defined by libSBML only and has no direct equivalent in terms of SBML components. This class is not prescribed by the SBML specifications, although it is used to implement features defined in SBML.

This class provides a central registry of all extensions known to libSBML. Each package extension must be registered with the registry. The registry class is accessed by various classes to retrieve information about known package extensions and to create additional attributes and/or elements by factory objects of the package extensions.

The package extension registry is implemented as a singleton instance of SBMLExtensionRegistry. The class provides only utility functionality; implementations of SBML packages do not need to implement any subclasses or methods of this class. SBMLExtensionRegistry is useful for its facilities to query the known packages, and to enable or disable packages selectively.

Public Member Functions

def addExtension (self, ext)
 Add the given SBMLExtension object to this SBMLExtensionRegistry. More...
 
def addL2Namespaces (self, xmlns)
 Adds SBML Level 2 namespaces to the namespace list. More...
 
def disablePackage (package)
 Disables the package with the given URI or name. More...
 
def disableUnusedPackages (self, doc)
 Disables unused packages. More...
 
def enableL2NamespaceForDocument (self, doc)
 Enables package extensions that support serialization to SBML annotations. More...
 
def enablePackage (package)
 Enables the package with the given URI / name. More...
 
def getAllRegisteredPackageNames ()
 Returns a list of registered packages. More...
 
def getASTPlugin (self, i)
 
def getASTPlugins (self)
 
def getExtension (self, package)
 Returns an SBMLExtension object with the given package URI or package name. More...
 
def getInstance ()
 Returns a singleton instance of the registry. More...
 
def getNumASTPlugins (self)
 
def getNumExtension (self, extPoint)
 Returns the number of extensions that have a given extension point. More...
 
def getNumRegisteredPackages ()
 Returns the number of registered packages. More...
 
def getRegisteredPackageName (index)
 Returns the nth registered package. More...
 
def isEnabled (self, uri)
 Returns True if the given extension is enabled. More...
 
def isPackageEnabled (package)
 Returns True if the named package is enabled. More...
 
def isRegistered (self, uri)
 Returns True if a package extension is registered for the corresponding package URI. More...
 
def removeL2Namespaces (self, xmlns)
 Removes SBML Level 2 namespaces from the namespace list. More...
 
def setEnabled (self, uri, isEnabled)
 Enables or disable the package with the given URI. More...
 

Member Function Documentation

def libsbml.SBMLExtensionRegistry.addExtension (   self,
  ext 
)

Add the given SBMLExtension object to this SBMLExtensionRegistry.

addExtension(SBMLExtension ext)   int
Parameters
extthe SBMLExtension object to be added.
Returns
integer value indicating success/failure of the function. The possible values returned by this function are:
def libsbml.SBMLExtensionRegistry.addL2Namespaces (   self,
  xmlns 
)

Adds SBML Level 2 namespaces to the namespace list.

addL2Namespaces(XMLNamespaces xmlns)
Parameters
xmlnsan XMLNamespaces object providing one or more namespaces to be added.
def libsbml.SBMLExtensionRegistry.disablePackage (   package)

Disables the package with the given URI or name.

disablePackage(string package)
Parameters
packagea string representing the URI or name of the SBML package whose package extension is to be disabled.
def libsbml.SBMLExtensionRegistry.disableUnusedPackages (   self,
  doc 
)

Disables unused packages.

disableUnusedPackages(SBMLDocument doc)

This method walks through all extensions in the list of plugins of the given SBML document doc, and disables all that are not being used.

Parameters
docthe SBMLDocument object whose unused package extensions should be disabled.
def libsbml.SBMLExtensionRegistry.enableL2NamespaceForDocument (   self,
  doc 
)

Enables package extensions that support serialization to SBML annotations.

enableL2NamespaceForDocument(SBMLDocument doc)

SBML Level 2 does not have a package mechanism in the way that SBML Level 3 does. However, SBML annotations can be used to store SBML constructs. In fact, a widely-used approach to developing SBML Level 3 packages involves first using them as annotations.

Parameters
docthe SBMLDocument object for which this should be enabled.
def libsbml.SBMLExtensionRegistry.enablePackage (   package)

Enables the package with the given URI / name.

enablePackage(string package)
Parameters
packagethe name or URI of a package to enable.
def libsbml.SBMLExtensionRegistry.getAllRegisteredPackageNames ( )

Returns a list of registered packages.

getAllRegisteredPackageNames()   std::vector< std::string >

This method returns a vector of strings containing the nicknames of the SBML packages for which package extensions are registered with this copy of libSBML. The vector will contain string objects.

Returns
a vector of strings of the registered package names.
def libsbml.SBMLExtensionRegistry.getASTPlugin (   self,
  i 
)
getASTPlugin(long  i)   ASTBasePlugin
 
def libsbml.SBMLExtensionRegistry.getASTPlugins (   self)
getASTPlugins()   std::vector< ASTBasePlugin * >
 
def libsbml.SBMLExtensionRegistry.getExtension (   self,
  package 
)

Returns an SBMLExtension object with the given package URI or package name.

getExtension(string package)   SBMLExtension
Parameters
packagea string representing the URI or name of the SBML package whose package extension is being sought.
Returns
a clone of the SBMLExtension object with the given package URI or name.
Note
The caller is responsible for freeing the object returned. Since the object is a clone, freeing it will not result in the deletion of the original package extension object.
def libsbml.SBMLExtensionRegistry.getInstance ( )

Returns a singleton instance of the registry.

getInstance()   SBMLExtensionRegistry

Callers need to obtain a copy of the package extension registry before they can invoke its methods. The registry is implemented as a singleton, and this is the method callers can use to get a copy of it.

Returns
the instance of the SBMLExtensionRegistry object.
def libsbml.SBMLExtensionRegistry.getNumASTPlugins (   self)
getNumASTPlugins()   long
 
def libsbml.SBMLExtensionRegistry.getNumExtension (   self,
  extPoint 
)

Returns the number of extensions that have a given extension point.

getNumExtension(SBaseExtensionPoint extPoint)   long
Parameters
extPointthe SBaseExtensionPoint object.
Returns
the number of SBMLExtension-derived objects with the given extension point.
def libsbml.SBMLExtensionRegistry.getNumRegisteredPackages ( )

Returns the number of registered packages.

getNumRegisteredPackages()   long
Returns
a count of the registered package extensions.
def libsbml.SBMLExtensionRegistry.getRegisteredPackageName (   index)

Returns the nth registered package.

getRegisteredPackageName(long  index)   string
Parameters
indexzero-based index of the package name to return.
Returns
the package name with the given index, or None if none such exists.
See also
getNumRegisteredPackages()
def libsbml.SBMLExtensionRegistry.isEnabled (   self,
  uri 
)

Returns True if the given extension is enabled.

isEnabled(string uri)   bool
Parameters
urithe URI of the target package.
Returns
False if the given package is disabled or not registered, True otherwise.
def libsbml.SBMLExtensionRegistry.isPackageEnabled (   package)

Returns True if the named package is enabled.

isPackageEnabled(string package)   bool
Parameters
packagethe name or URI of a package to test.
Returns
True if the package is enabled, False otherwise.
def libsbml.SBMLExtensionRegistry.isRegistered (   self,
  uri 
)

Returns True if a package extension is registered for the corresponding package URI.

isRegistered(string uri)   bool
Parameters
urithe URI of the target package.
Returns
True if the package with the given URI is registered, otherwise returns False.
def libsbml.SBMLExtensionRegistry.removeL2Namespaces (   self,
  xmlns 
)

Removes SBML Level 2 namespaces from the namespace list.

removeL2Namespaces(XMLNamespaces xmlns)
Parameters
xmlnsan XMLNamespaces object listing one or more namespaces to be removed.
def libsbml.SBMLExtensionRegistry.setEnabled (   self,
  uri,
  isEnabled 
)

Enables or disable the package with the given URI.

setEnabled(string uri, bool isEnabled)   bool
Parameters
urithe URI of the target package.
isEnabledTrue to enable the package, False to disable.
Returns
False if isEnabled is False or the given package is not registered, otherwise this method returns True.