java.io.Serializable
, java.lang.Cloneable
, javax.swing.tree.TreeNode
, NamedSBase
, SBase
, UniqueNamedSBase
, UniqueSId
, TreeNodeWithChangeSupport
public 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.JSBML_WRONG_SBO_TERM
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() |
Returns a hash code value for this
SBase instance. |
void |
initDefaults() |
Initializes the default values using the namespace.
|
boolean |
isIdMandatory() |
Returns
true if the identifier of this
SBase is required to be defined (i.e., not null )
in the definition of SBML. |
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) |
Sets the given attribute in this
SBase . |
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() |
Returns a map with all the attributes of this
SBase that
need to be written out in XML. |
isValidId
addCVTerm, addDeclaredNamespace, addExtension, addPlugin, addResources, appendAnnotation, appendAnnotation, appendNotes, appendNotes, 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, 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, registerChild, removeCVTerm, removeCVTerm, removeDeclaredNamespaceByNamespace, removeDeclaredNamespaceByPrefix, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, removeTopLevelAnnotationElement, replaceTopLevelAnnotationElement, replaceTopLevelAnnotationElement, setAnnotation, setAnnotation, setAnnotation, setHistory, setId, setLevel, setMetaId, setName, setNamespace, setNotes, setNotes, setPackageVersion, setSBOTerm, setSBOTerm, setThisAsParentSBMLObject, setVersion, toString, unregisterChild, unsetAnnotation, unsetCVTerms, unsetExtension, unsetHistory, unsetId, unsetMetaId, unsetName, unsetNamespace, unsetNotes, unsetPlugin, unsetSBOTerm
addAllChangeListeners, addAllChangeListeners, addTreeNodeChangeListener, addTreeNodeChangeListener, children, clearUserObjects, containsUserObjectKey, filter, filter, filter, fireNodeAddedEvent, getIndex, getListOfTreeNodeChangeListeners, getNumChildren, getRoot, getTreeNodeChangeListenerCount, getUserObject, indexOf, isLeaf, isRoot, isSetParent, isSetUserObjects, putUserObject, removeAllTreeNodeChangeListeners, removeAllTreeNodeChangeListeners, removeFromParent, removeTreeNodeChangeListener, removeTreeNodeChangeListener, removeUserObject, setParent, userObjectKeySet
getId, getName, isSetId, isSetName, setId, setName, unsetId, unsetName
addCVTerm, 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, unsetSBOTerm
children, getAllowsChildren, getChildAt, getChildCount, getIndex, getParent, isLeaf
addAllChangeListeners, addAllChangeListeners, addTreeNodeChangeListener, addTreeNodeChangeListener, clearUserObjects, containsUserObjectKey, filter, filter, filter, fireNodeAddedEvent, fireNodeRemovedEvent, firePropertyChange, getListOfTreeNodeChangeListeners, getRoot, getTreeNodeChangeListenerCount, getUserObject, isRoot, isSetParent, isSetUserObjects, putUserObject, removeAllTreeNodeChangeListeners, removeAllTreeNodeChangeListeners, removeFromParent, removeTreeNodeChangeListener, removeUserObject, userObjectKeySet
public 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 SBase
clone
in class AbstractSBase
public void initDefaults()
public int hashCode()
SBase
SBase
instance.hashCode
in interface SBase
hashCode
in class AbstractSBase
SBase
instance.Object.hashCode()
public boolean equals(java.lang.Object obj)
SBase
public 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 false
public 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 false
public 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 false
public java.util.Map<java.lang.String,java.lang.String> writeXMLAttributes()
SBase
SBase
that
need to be written out in XML.
The attribute name is used as a key and the attribute value as value. If a prefix is needed for the attribute name, it need to be set directly in this map.
writeXMLAttributes
in interface SBase
writeXMLAttributes
in class AbstractSBase
Map
containing the XML attributes of this object.public boolean readAttribute(java.lang.String attributeName, java.lang.String prefix, java.lang.String value)
SBase
SBase
.
If the given attribute name is not recognized, nothing is done and
false
is returned.
readAttribute
in interface SBase
readAttribute
in class AbstractSBase
attributeName
- localName of the XML attributeprefix
- prefix of the XML attributevalue
- value of the XML attributetrue
if the attribute has been successfully read.public boolean isIdMandatory()
SBase
true
if the identifier of this
SBase
is required to be defined (i.e., not null
)
in the definition of SBML.isIdMandatory
in interface NamedSBase
isIdMandatory
in interface SBase
isIdMandatory
in class AbstractSBase
true
if the identifier of this element must be set in
order to create a valid SBML representation. false
otherwise, i.e., if the identifier can be understood as an optional
attribute.public 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
Submodel
s referencing further (external) ModelDefinition
s.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 methodModel
java.io.IOException
- if the source cannot be found/resolvedjavax.xml.stream.XMLStreamException
- if the file at source is not a valid SBMLDocument.java.net.URISyntaxException
public 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
Submodel
s referencing further (external) ModelDefinition
s.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.URISyntaxException
java.net.MalformedURLException
public 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.MalformedURLException
java.net.URISyntaxException