@Override public String toString() { return "SBMLDocument Level " + getLevel() + " Version " + getVersion(); }
@Override public boolean check(ValidationContext ctx, SBMLDocument d) { String sbmlNamespace = getSBMLDocumentNamespace(d); if (sbmlNamespace == null) { return false; } int level = d.getLevel(); int version = d.getVersion(); String levelAndVersionNamespace = JSBML.getNamespaceFrom(level, version); if (sbmlNamespace == null || levelAndVersionNamespace == null) { return false; } return sbmlNamespace.equals(levelAndVersionNamespace); } };
@Override public Map<String, String> writeXMLAttributes() { Map<String, String> attributes = super.writeXMLAttributes(); attributes.putAll(SBMLDocumentAttributes); if (isSetLevel()) { attributes.put("level", Integer.toString(getLevel())); } if (isSetVersion()) { attributes.put("version", Integer.toString(getVersion())); } Iterator<Map.Entry<String, String>> it = getDeclaredNamespaces().entrySet().iterator(); while (it.hasNext()) { Map.Entry<String, String> entry = it.next(); if (!entry.getKey().equals("xmlns")) { attributes.put(entry.getKey(), entry.getValue()); } } return attributes; }
int version = d.getVersion(); int namespaceVersion = -1;
/** * Creates a new instance of Model from id and the level and version of this * SBMLDocument. * * @param id * @return the new {@link Model} instance. */ public Model createModel(String id) { setModel(new Model(id, getLevel(), getVersion())); return getModel(); }
elementNamespace = packageParser.getNamespaceFor(doc.getLevel(), doc.getVersion(), packageVersion); if (!silent) { logger.warn("Could not find a namespace for the package '" + packageName + "' using SBML level '" + doc.getLevel() + "' version '" + doc.getVersion() + "', package version '" + packageVersion + "'.");
LoggingValidationContext ctx = new LoggingValidationContext(getLevel(), getVersion());
public Unit buildUnit(double multiplier, int scale, Kind kind, double exponent) { Unit unit = new Unit(doc.getLevel(), doc.getVersion()); unit.setKind(kind); unit.setMultiplier(multiplier); unit.setScale(scale); unit.setExponent(exponent); return unit; }
/** * Creates a new Model inside this {@link SBMLDocument}, and returns a * pointer to it. * In SBML Level 2, the use of an identifier on a {@link Model} object is * optional. This method takes an optional argument, sid, for setting the * identifier. If not supplied, the identifier attribute on the Model * instance is not set. * * @return the new {@link Model} instance. */ public Model createModel() { Model oldValue = getModel(); setModel(new Model(getLevel(), getVersion())); firePropertyChange(TreeNodeChangeEvent.model, oldValue, getModel()); return getModel(); }
sbmlDocument.getVersion()); SMOutputContext context = outputDocument.getContext(); context.setIndentation('\n' + createIndentationString(indentCount), 1, 2);
Model model = (Model) newContextObject; model.setLevel(sbmlDocument.getLevel()); model.setVersion(sbmlDocument.getVersion()); model.initDefaults(); sbmlDocument.setModel(model);