java.io.Serializable, java.lang.Cloneable, javax.swing.tree.TreeNode, NamedSBase, SBase, UniqueNamedSBase, UniqueSId, TreeNodeWithChangeSupportpublic class ExternalModelDefinition extends AbstractNamedSBase implements UniqueNamedSBase
ExternalModelDefinition objects are model definitions - in and of
themselves, they are definitions of the models but not uses of those models.
The class provides a way to declare and identify them so that Model
objects in the present SBMLDocument can use them in SubModel
objects.ignoredExtensions, ignoredXMLElements, JSBML_WRONG_SBO_TERM, packageNamelistOfListeners, parent, resourceBundle| Constructor | Description |
|---|---|
ExternalModelDefinition() |
Creates an ExternalModelDefinition instance
|
ExternalModelDefinition(java.lang.String id) |
Creates a ExternalModelDefinition instance with an id.
|
ExternalModelDefinition(java.lang.String id,
int level,
int version) |
Creates a ExternalModelDefinition instance with an id, level, and version.
|
ExternalModelDefinition(java.lang.String id,
java.lang.String name,
int level,
int version) |
Creates a ExternalModelDefinition instance with an id, name, level, and
version.
|
ExternalModelDefinition(ExternalModelDefinition obj) |
Clone constructor
|
| Modifier and Type | Method | Description |
|---|---|---|
ExternalModelDefinition |
clone() |
clones this class
|
boolean |
equals(java.lang.Object obj) |
|
java.net.URI |
getAbsoluteSourceURI() |
Finds the absolute URI of the source-file specified: If the source is
specified through a relative path, will try to use the containing
SBMLDocument's
SBMLDocument.getLocationURI() to turn it into an
absolute URI in the current context. |
java.net.URI |
getAbsoluteSourceURI(java.net.URI absoluteContainingURI) |
Finds the absolute URI of the source-file specified: If the source is
specified through a relative path, will try to use the given
absoluteContainingURI to turn it into an absolute URI in the current
context.
|
java.lang.String |
getMd5() |
Returns the value of md5 or an empty
String if it is not set. |
java.lang.String |
getModelRef() |
Returns the value of modelRef or an empty
String if it is not set. |
Model |
getReferencedModel() |
Resolves the external
Model referenced by this and returns that
model, under the assumption that the containing SBMLDocument a)
exists and b) has a valid locationURI set (cf
SBMLDocument.isSetLocationURI()). |
Model |
getReferencedModel(java.net.URI absoluteContainingURI) |
Resolves the external
Model referenced by this and
returns that model, for a given path to the directory containing the
SBML-file wherein this
ExternalModelDefinition was made/the root directory for references
by relative paths. |
java.lang.String |
getSource() |
Returns the value of source or an empty
String if it is not set. |
int |
hashCode() |
|
void |
initDefaults() |
Initializes the default values using the namespace.
|
boolean |
isIdMandatory() |
|
boolean |
isSetMd5() |
Returns whether md5 is set
|
boolean |
isSetModelRef() |
Returns whether modelRef is set
|
boolean |
isSetSource() |
Returns whether source is set
|
boolean |
readAttribute(java.lang.String attributeName,
java.lang.String prefix,
java.lang.String value) |
|
void |
setMd5(java.lang.String md5) |
Sets the value of the optional md5 attribute.
|
void |
setModelRef(java.lang.String modelRef) |
Sets the value of the optional modelRef attribute.
|
void |
setSource(java.lang.String source) |
Sets the value of the required source attribute.
|
boolean |
unsetMd5() |
Unsets the variable md5
|
boolean |
unsetModelRef() |
Unsets the variable modelRef
|
boolean |
unsetSource() |
Unsets the variable source
|
java.util.Map<java.lang.String,java.lang.String> |
writeXMLAttributes() |
isValidIdaddCVTerm, addDeclaredNamespace, addExtension, addPlugin, addResources, appendAnnotation, appendAnnotation, appendNotes, appendNotes, checkAndSetPackageNamespaceAndVersion, checkAndSetPackageNamespaceAndVersion, checkAttribute, checkIdentifier, checkLevelAndVersionCompatibility, createHistory, createPlugin, disablePackage, enablePackage, enablePackage, filterCVTerms, filterCVTerms, filterCVTerms, filterCVTerms, fireNodeRemovedEvent, firePropertyChange, getAllDeclaredNamespaces, getAllowsChildren, getAnnotation, getAnnotationString, getChildAt, getChildCount, getCVTerm, getCVTermCount, getCVTerms, getDeclaredNamespaces, getElementByMetaId, getElementBySId, getElementName, getExtension, getExtensionCount, getExtensionPackages, getFirstElementIndex, getHistory, getId, getIdManager, getLevel, getLevelAndVersion, getMetaId, getModel, getName, getNamespace, getNotes, getNotesString, getNumCVTerms, getNumPlugins, getPackageName, getPackageVersion, getParent, getParentSBMLObject, getPlugin, getSBMLDocument, getSBOTerm, getSBOTermID, getURI, getVersion, hasExtension, hasValidAnnotation, hasValidLevelVersionNamespaceCombination, isExtendedByOtherPackages, isPackageEnabled, isPackageURIEnabled, isPkgEnabled, isPkgURIEnabled, isSetAnnotation, isSetHistory, isSetId, isSetLevel, isSetLevelAndVersion, isSetMetaId, isSetName, isSetNotes, isSetPackageVErsion, isSetParentSBMLObject, isSetPlugin, isSetSBOTerm, isSetVersion, isValidLevelAndVersionCombination, isValidMetaId, notifyChildChange, registerChild, removeCVTerm, removeCVTerm, removeDeclaredNamespaceByNamespace, removeDeclaredNamespaceByPrefix, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, replaceTopLevelAnnotationElement, replaceTopLevelAnnotationElement, setAnnotation, setAnnotation, setAnnotation, setHistory, setId, setLevel, setMetaId, setName, setNamespace, setNotes, setNotes, setPackageVersion, setParentSBML, setParentSBMLObject, setSBOTerm, setSBOTerm, setThisAsParentSBMLObject, setVersion, toString, unregisterChild, unsetAnnotation, unsetCVTerms, unsetExtension, unsetHistory, unsetId, unsetMetaId, unsetName, unsetNamespace, unsetNotes, unsetPlugin, unsetSBOTermaddAllChangeListeners, addAllChangeListeners, addTreeNodeChangeListener, addTreeNodeChangeListener, children, clearUserObjects, containsUserObjectKey, filter, filter, filter, fireNodeAddedEvent, getIndex, getListOfTreeNodeChangeListeners, getNumChildren, getRoot, getTreeNodeChangeListenerCount, getUserObject, indexOf, isCloningInProgress, isInvalidSBMLAllowed, isLeaf, isReadingInProgress, isRoot, isSetParent, isSetUserObjects, putUserObject, removeAllTreeNodeChangeListeners, removeAllTreeNodeChangeListeners, removeFromParent, removeTreeNodeChangeListener, removeTreeNodeChangeListener, removeUserObject, setParent, userObjectKeySetgetId, getName, isSetId, isSetName, setId, setName, unsetId, unsetNamefinalize, getClass, notify, notifyAll, wait, wait, waitaddCVTerm, addDeclaredNamespace, addExtension, addPlugin, appendAnnotation, appendAnnotation, appendNotes, appendNotes, createPlugin, disablePackage, enablePackage, enablePackage, filterCVTerms, filterCVTerms, filterCVTerms, filterCVTerms, getAnnotation, getAnnotationString, getCVTerm, getCVTermCount, getCVTerms, getDeclaredNamespaces, getElementByMetaId, getElementBySId, getElementName, getExtension, getExtensionCount, getExtensionPackages, getHistory, getLevel, getLevelAndVersion, getMetaId, getModel, getNamespace, getNotes, getNotesString, getNumCVTerms, getNumPlugins, getPackageName, getPackageVersion, getParentSBMLObject, getPlugin, getSBMLDocument, getSBOTerm, getSBOTermID, getURI, getVersion, hasExtension, hasValidAnnotation, hasValidLevelVersionNamespaceCombination, isExtendedByOtherPackages, isPackageEnabled, isPackageURIEnabled, isPkgEnabled, isPkgURIEnabled, isSetAnnotation, isSetHistory, isSetLevel, isSetLevelAndVersion, isSetMetaId, isSetNotes, isSetPackageVErsion, isSetParentSBMLObject, isSetPlugin, isSetSBOTerm, isSetVersion, registerChild, removeCVTerm, removeCVTerm, removeDeclaredNamespaceByNamespace, removeDeclaredNamespaceByPrefix, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, removeTreeNodeChangeListener, replaceTopLevelAnnotationElement, replaceTopLevelAnnotationElement, setAnnotation, setAnnotation, setAnnotation, setHistory, setLevel, setMetaId, setNotes, setNotes, setPackageVersion, setSBOTerm, setSBOTerm, setThisAsParentSBMLObject, setVersion, unregisterChild, unsetAnnotation, unsetCVTerms, unsetExtension, unsetHistory, unsetMetaId, unsetNotes, unsetPlugin, unsetSBOTermchildren, getAllowsChildren, getChildAt, getChildCount, getIndex, getParent, isLeafaddAllChangeListeners, addAllChangeListeners, addTreeNodeChangeListener, addTreeNodeChangeListener, clearUserObjects, containsUserObjectKey, filter, filter, filter, fireNodeAddedEvent, fireNodeRemovedEvent, firePropertyChange, getListOfTreeNodeChangeListeners, getRoot, getTreeNodeChangeListenerCount, getUserObject, isRoot, isSetParent, isSetUserObjects, putUserObject, removeAllTreeNodeChangeListeners, removeAllTreeNodeChangeListeners, removeFromParent, removeTreeNodeChangeListener, removeUserObject, userObjectKeySetpublic ExternalModelDefinition()
public ExternalModelDefinition(java.lang.String id)
id - the idpublic ExternalModelDefinition(java.lang.String id,
int level,
int version)
id - the idlevel - the SBML levelversion - the SBML versionpublic ExternalModelDefinition(java.lang.String id,
java.lang.String name,
int level,
int version)
id - the idname - the namelevel - the SBML levelversion - the SBML versionpublic ExternalModelDefinition(ExternalModelDefinition obj)
obj - the instance to clonepublic ExternalModelDefinition clone()
clone in interface SBaseclone in class AbstractSBasepublic void initDefaults()
public int hashCode()
hashCode in interface SBasehashCode in class AbstractSBasepublic boolean equals(java.lang.Object obj)
equals in interface SBaseequals in class AbstractSBasepublic java.lang.String getSource()
String if it is not set.String if it is not set.public boolean isSetSource()
public void setSource(java.lang.String source)
The source attribute is used to locate the SBML document containing an
ExternalModelDefinition. The value of the attribute must be a URI,
which includes URLs, URNs, or relative/absolute file locations. The source
attribute must refer specifically to an SBML Level 3 Version 1 document.
The
entire file at the given location is referenced. The source attribute must
have a value for every ExternalModelDefinition.
source - the value of the sourcepublic boolean unsetSource()
true , if source was set before, otherwise falsepublic java.lang.String getModelRef()
String if it is not set.String if it is not set.public boolean isSetModelRef()
public void setModelRef(java.lang.String modelRef)
modelRef is used to identify a Model or
ExternalModelDefinition object within the SBML document located at
source. The object referenced may be the main model in the document, or it
may be a model definition contained in the SBML document's
listOfModelDefinitions or listOfExternalModelDefinitions. Loops are not
allowed: it must be possible to follow a chain of
ExternalModelDefinition objects to its end in a Model
object.
In core SBML, the id on Model is an optional attribute, and
therefore, it is possible that the Model object in a given SBML
document does not have an identifier. In that case, there is no value to
give
to the modelRef attribute in ExternalModelDefinition. If modelRef
does not have a value, then the main model (i.e., the model element within
the sbml element) in the referenced file is interpreted as being the model
referenced by this ExternalModelDefinition instance.
modelRef - the value of modelRefpublic boolean unsetModelRef()
true, if modelRef was set before, otherwise falsepublic java.lang.String getMd5()
String if it is not set.String if it is not set.public boolean isSetMd5()
public void setMd5(java.lang.String md5)
The md5 attribute takes a string value. If set, it must be an MD5 checksum
value computed over the document referenced by source. This checksum can
serve as a data integrity check over the contents of the source.
Applications
may use this to verify that the contents have not changed since the time
that
the ExternalModelDefinition reference was constructed.
md5 - the value of md5public boolean unsetMd5()
true, if md5 was set before, otherwise falsepublic java.util.Map<java.lang.String,java.lang.String> writeXMLAttributes()
writeXMLAttributes in interface SBasewriteXMLAttributes in class AbstractSBasepublic boolean readAttribute(java.lang.String attributeName,
java.lang.String prefix,
java.lang.String value)
readAttribute in interface SBasereadAttribute in class AbstractSBasepublic boolean isIdMandatory()
isIdMandatory in interface NamedSBaseisIdMandatory in interface SBaseisIdMandatory in class AbstractSBasepublic Model getReferencedModel(java.net.URI absoluteContainingURI) throws javax.xml.stream.XMLStreamException, java.io.IOException, java.net.URISyntaxException
Model referenced by this and
returns that model, for a given path to the directory containing the
SBML-file wherein this
ExternalModelDefinition was made/the root directory for references
by relative paths.
Model is not modified and may thus contain
Submodels referencing further (external) ModelDefinitions.absoluteContainingURI - absolute URI to the directory containing the
file that defines this (needed to resolve local
references): Undefined behaviour for opaque URIs (URNs or other),
resolve URNs before calling this methodModeljava.io.IOException - if the source cannot be found/resolvedjavax.xml.stream.XMLStreamException - if the file at source is not a valid SBMLDocument.java.net.URISyntaxExceptionpublic Model getReferencedModel() throws javax.xml.stream.XMLStreamException, java.io.IOException, java.net.URISyntaxException
Model referenced by this and returns that
model, under the assumption that the containing SBMLDocument a)
exists and b) has a valid locationURI set (cf
SBMLDocument.isSetLocationURI()). This location of the containing
file is needed to resolve references to external models by relative paths.
URNs/opaque URIs cannot be resolved by this method, resolve them before
calling it.
Model is not modified and may thus contain
Submodels referencing further (external) ModelDefinitions.Model referenced by thisjavax.xml.stream.XMLStreamException - if the file referenced by this is not a valid xml/sbmljava.io.IOException - if the file referenced by this cannot be foundjava.net.URISyntaxException - if parent's locationURI is not a valid URIjava.lang.NullPointerException - if the parent SBMLDocument's locationURI is not set.public java.net.URI getAbsoluteSourceURI()
throws java.net.URISyntaxException,
java.net.MalformedURLException
SBMLDocument.getLocationURI() to turn it into an
absolute URI in the current context.
getSource()) of this
ExternalModelDefinitionjava.net.URISyntaxExceptionjava.net.MalformedURLExceptionpublic java.net.URI getAbsoluteSourceURI(java.net.URI absoluteContainingURI)
throws java.net.MalformedURLException,
java.net.URISyntaxException
absoluteContainingURI - absolute URI to the directory containing the
file that defines this (needed to resolve local
references)getSource()) of this
ExternalModelDefinitionjava.net.MalformedURLExceptionjava.net.URISyntaxExceptionCopyright © 2009–2022. All rights reserved.