public class SBMLDocumentPlugin extends SBasePlugin
SBMLDocument
in packages.
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.
The SBMLDocumentPlugin
class is a specialization of SBasePlugin
designed specifically for extending SBMLDocument
. All package
extensions must extend SBMLDocument
to implement support for SBML
Level 3 packages these extensions can be subclasses of this
class or from a derived class of this class.
SBML Level 3's package structure permits modular extensions to the core SBML format. In libSBML, support for SBML Level 3 packages is provided through optional package extensions that can be plugged into libSBML at the time it is built/compiled. Users of libSBML can thus choose which extensions are enabled in their software applications.
LibSBML defines a number of classes that developers of package extensions
can use to implement support for an SBML Level 3 package. These
classes make it easier to extend libSBML objects with new attributes
and/or subobjects as needed by a particular Level 3 package.
Three overall categories of classes make up libSBML's facilities for
implementing package extensions. There are (1) classes that serve as base
classes meant to be subclassed, (2) template classes meant to be
instantiated rather than subclassed, and (3) support classes that provide
utility features. A given package implementation for libSBML will take
the form of code using these and other libSBML classes, placed in a
subdirectory of src/sbml/packages/
.
The basic libSBML distribution includes a number of package extensions implementing support for officially-endorsed SBML Level 3 packages among these are Flux Balance Constraints ('fbc'), Hierarchical Model Composition ('comp'), Layout ('layout'), and Qualitative Models ('qual'). They can serve as working examples for developers working to implement other packages.
Extensions in libSBML can currently only be implemented in C++ or C there is no mechanism to implement them first in languages such as Java or Python. However, once implemented in C++ or C, language interfaces can be generated semi-automatically using the framework in place in libSBML. (The approach is based on using SWIG and facilities in libSBML's build system.)
Constructor and Description |
---|
SBMLDocumentPlugin(SBMLDocumentPlugin orig)
Copy constructor.
|
SBMLDocumentPlugin(java.lang.String uri,
java.lang.String prefix,
SBMLNamespaces sbmlns)
Creates a new
SBMLDocumentPlugin object using the given parameters. |
Modifier and Type | Method and Description |
---|---|
SBasePlugin |
cloneObject()
Creates and returns a deep copy of this
SBMLDocumentPlugin object. |
void |
delete()
Explicitly deletes the underlying native object.
|
boolean |
getRequired()
Returns the value of the 'required' attribute.
|
boolean |
isSetRequired()
Returns the value of the 'required' attribute.
|
int |
setRequired(boolean value)
Sets the SBML 'required' attribute value.
|
int |
unsetRequired()
Unsets the value of the 'required' attribute of this
SBMLDocumentPlugin . |
getElementByMetaId, getElementBySId, getElementNamespace, getLevel, getListOfAllElements, getListOfAllElements, getPackageName, getPackageVersion, getParentSBMLObject, getPrefix, getSBMLDocument, getURI, getVersion, isValidTypeForList, renameMetaIdRefs, renameSIdRefs, renameUnitSIdRefs, setElementNamespace
public SBMLDocumentPlugin(java.lang.String uri, java.lang.String prefix, SBMLNamespaces sbmlns)
SBMLDocumentPlugin
object using the given parameters.
In the XML representation of an SBML document, XML namespaces are used to
identify the origin of each XML construct used. XML namespaces are
identified by their unique resource identifiers (URIs). The core SBML
specifications stipulate the namespaces that must be used for core SBML
constructs for example, all XML elements that belong to SBML Level 3
Version 1 Core must be placed in the XML namespace identified by the URI
'http://www.sbml.org/sbml/level3/version1/core'
. Individual
SBML Level 3 packages define their own XML namespaces for example,
all elements belonging to the SBML Level 3 Layout Version 1
package must be placed in the XML namespace
'http://www.sbml.org/sbml/level3/version1/layout/version1/'
.
The SBMLNamespaces
object encapsulates SBML Level/Version/namespaces
information. It is used to communicate the SBML Level, Version, and (in
Level 3) packages used in addition to SBML Level 3 Core. A
common approach to using libSBML's SBMLNamespaces
facilities is to create an
SBMLNamespaces
object somewhere in a program once, then hand that object
as needed to object constructors that accept SBMLNamespaces
as arguments.
uri
- the URI of the SBML Level 3 package implemented by
this libSBML package extension.
prefix
- the XML namespace prefix being used for the package.
sbmlns
- the SBMLNamespaces
object for the package.public SBMLDocumentPlugin(SBMLDocumentPlugin orig)
This creates a copy of this object.
orig
- the SBMLDocumentPlugin
instance to copy.public void delete()
In general, application software will not need to call this method directly. The Java language binding for libSBML is implemented as a language wrapper that provides a Java interface to libSBML's underlying C++/C code. Some of the Java methods return objects that are linked to objects created not by Java code, but by C++ code. The Java objects wrapped around them will be deleted when the garbage collector invokes the corresponding C++ finalize()
methods for the objects. The finalize()
methods in turn call the SBMLDocumentPlugin.delete()
method on the libSBML object.
This method is exposed in case calling programs want to ensure that the underlying object is freed immediately, and not at some arbitrary time determined by the Java garbage collector. In normal usage, callers do not need to invoke SBMLDocumentPlugin.delete()
themselves.
delete
 in class SBasePlugin
public SBasePlugin cloneObject()
SBMLDocumentPlugin
object.
cloneObject
 in class SBasePlugin
SBMLDocumentPlugin
object.public int setRequired(boolean value)
SBML Level 3 requires that every package defines an attribute named
'required' on the root <sbml>
element in an SBML file
or data stream. The attribute, being in the namespace of the Level 3
package in question, must be prefixed by the XML namespace prefix
associated with the package. The value of the 'required' attribute
indicates whether constructs in that package may change the mathematical
interpretation of constructs defined in SBML Level 3 Core. A
'required' value of true
indicates that the package may do so. The
value of the attribute is set by the Level 3 package specification,
and does not depend on the actual presence or absence of particular
package constructs in a given SBML document: in other words, if the
package specification defines any construct that can change the model's
meaning, the value of the 'required' attribute must always be set to
true
in any SBML document that uses the package.
The XML namespace declaration for an SBML Level 3 package is an indication that a model makes use of features defined by that package, while the 'required' attribute indicates whether the features may be ignored without compromising the mathematical meaning of the model. Both are necessary for a complete reference to an SBML Level 3 package.
value
- the value to be assigned to the 'required' attribute.
The 'required' attribute takes a Boolean value, either true
or
false.
SBMLDocumentPlugin.getRequired()
,
SBMLDocumentPlugin.isSetRequired()
,
SBMLDocumentPlugin.unsetRequired()
public boolean getRequired()
SBML Level 3 requires that every package defines an attribute named
'required' on the root <sbml>
element in an SBML file
or data stream. The attribute, being in the namespace of the Level 3
package in question, must be prefixed by the XML namespace prefix
associated with the package. The value of the 'required' attribute
indicates whether constructs in that package may change the mathematical
interpretation of constructs defined in SBML Level 3 Core. A
'required' value of true
indicates that the package may do so. The
value of the attribute is set by the Level 3 package specification,
and does not depend on the actual presence or absence of particular
package constructs in a given SBML document: in other words, if the
package specification defines any construct that can change the model's
meaning, the value of the 'required' attribute must always be set to
true
in any SBML document that uses the package.
The XML namespace declaration for an SBML Level 3 package is an indication that a model makes use of features defined by that package, while the 'required' attribute indicates whether the features may be ignored without compromising the mathematical meaning of the model. Both are necessary for a complete reference to an SBML Level 3 package.
SBMLDocumentPlugin.setRequired(boolean value)
,
SBMLDocumentPlugin.isSetRequired()
,
SBMLDocumentPlugin.unsetRequired()
public boolean isSetRequired()
SBML Level 3 requires that every package defines an attribute named
'required' on the root <sbml>
element in an SBML file
or data stream. The attribute, being in the namespace of the Level 3
package in question, must be prefixed by the XML namespace prefix
associated with the package. The value of the 'required' attribute
indicates whether constructs in that package may change the mathematical
interpretation of constructs defined in SBML Level 3 Core. A
'required' value of true
indicates that the package may do so. The
value of the attribute is set by the Level 3 package specification,
and does not depend on the actual presence or absence of particular
package constructs in a given SBML document: in other words, if the
package specification defines any construct that can change the model's
meaning, the value of the 'required' attribute must always be set to
true
in any SBML document that uses the package.
The XML namespace declaration for an SBML Level 3 package is an indication that a model makes use of features defined by that package, while the 'required' attribute indicates whether the features may be ignored without compromising the mathematical meaning of the model. Both are necessary for a complete reference to an SBML Level 3 package.
true
if the 'required' attribute of this SBMLDocument
has been set to true
, false
otherwise.public int unsetRequired()
SBMLDocumentPlugin
.