@Override public boolean hasValidLevelVersionNamespaceCombination() { return isValidLevelAndVersionCombination(getLevel(), getVersion()); }
@Override public String getNamespace() { if (getPackageName().equals("core") && elementNamespace == null) { return JSBML.getNamespaceFrom(getLevel(), getVersion()); } return elementNamespace; }
/** * Checks if the sID is a valid identifier. * * @param sID * the identifier to be checked. If null or an invalid * identifier, an exception will be thrown. * @return {@code true} only if the sID is a valid identifier. * Otherwise this method throws an {@link IllegalArgumentException}. * This is an intended behavior. * @throws IllegalArgumentException * if the given id is not valid in this model. */ protected boolean checkIdentifier(String sID) { if ((sID == null) || !SyntaxChecker.isValidId(sID, getLevel(), getVersion())) { throw new IllegalArgumentException(format( resourceBundle.getString("AbstractNamedSBase.checkIdentifier"), sID, getElementName())); } return true; }
/** * Checks if the attribute conforms to the SBML specifications of the level * and version of this object. The final values of {@link TreeNodeChangeEvent} * could be used as attribute name. * * <p>WARNING: this is a placeholder method, most classes have no attribute * validations implemented. * * @param attributeName - the attribute name * @return {@code true} if the attribute conforms the the SBML specifications. */ protected boolean checkAttribute(String attributeName) { // do not do the checks if we are reading a model or in the process of cloning any TreeNode if (! (isReadingInProgress() || isCloningInProgress())) { AbstractSBase.attributeValidator.setLevelAndVersion(getLevel(), getVersion()); Class<?> clazz = this.getClass(); attributeValidator.loadConstraintsForAttribute(clazz, attributeName); boolean valid = attributeValidator.validate(this); if (!valid) { logger.error("Invalid value for attribute " + attributeName + " on " + clazz.getSimpleName() + " with id = " + metaId + "!"); } return valid; } return true; }
attributes.put("metaid", getMetaId()); if (((level == 2) && (getVersion() >= 2)) || (level > 2)) { if (isSetSBOTerm()) { attributes.put("sboTerm", getSBOTermID());
&& (sbase.getLevel() == getLevel()) && !sbase.isSetVersion())) && (sbase instanceof AbstractSBase)) { ((AbstractSBase) sbase).setLevelAndVersion(getLevel(), getVersion(), true); return true;