http://jsbml.svn.sourceforge.net/viewvc/jsbml/trunk/src/org/sbml/jsbml/AbstractMathContainer.java?r1=444&r2=443&pathrev=444
> --- trunk/src/org/sbml/jsbml/AbstractMathContainer.java 2010/11/22
> 14:00:58 443
> +++ trunk/src/org/sbml/jsbml/AbstractMathContainer.java 2010/11/22
> 17:29:51 444
> @@ -290,10 +290,10 @@
> value);
>
> if (!isAttributeRead) {
> - if (attributeName.equals("formula") && isSetLevel()
> - && (getLevel() < 2)) {
> + if (attributeName.equals("formula")) {
> try {
> setFormula(value);
> + return true;
> } catch (ParseException exc) {
> throw new IllegalArgumentException(exc);
> }
> @@ -309,6 +309,9 @@
> */
> @Deprecated
> public void setFormula(String formula) throws ParseException {
> + if (1 < getLevel()) {
> + throw new
> PropertyNotAvailableError(SBaseChangedEvent.formula, this);
> + }
> setMath(ASTNode.parseFormula(formula));
> }
I found this test a bit too restrictive. Software allowing user to enter
math expression as infix formula could use this method to set the math
whatever the level and version ?