@Override public boolean readAttribute(String attributeName, String prefix, String value) { boolean isAttributeRead = super.readAttribute(attributeName, prefix, value); if (!isAttributeRead) { if (attributeName.equals(MultiConstants.value)) { setValue(value); isAttributeRead = true; } } return isAttributeRead; }
@Override public boolean readAttribute(String attributeName, String prefix, String value) { boolean isAttributeRead = super.readAttribute(attributeName, prefix, value); if (!isAttributeRead) { if (attributeName.equals("formula")) { try { setFormula(value); return true; } catch (ParseException exc) { throw new IllegalArgumentException(exc); } } } return isAttributeRead; }
@Override public boolean readAttribute(String attributeName, String prefix, String value) { boolean isAttributeRead = super.readAttribute(attributeName, prefix, value); if (!isAttributeRead) { isAttributeRead = true; if (attributeName.equals(SpatialConstants.spatialId)) { try { setSpatialId(value); } catch (Exception e) { logger.warn(MessageFormat.format( SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.spatialId, getElementName())); } } else { isAttributeRead = false; } } return isAttributeRead; }
@Override public boolean readAttribute(String attributeName, String prefix, String value) { boolean isAttributeRead = (super.readAttribute(attributeName, prefix, value)) && (SpatialConstants.shortLabel == prefix); if (!isAttributeRead) { isAttributeRead = true; System.out.println(attributeName); if (attributeName.equals(SpatialConstants.coordinate)) { try { setCoordinate(value); } catch (Exception e) { logger.warn(MessageFormat.format( SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.coordinate, getElementName())); } } else { isAttributeRead = false; } } return isAttributeRead; }
@Override public boolean readAttribute(String attributeName, String prefix, String value) { boolean isAttributeRead = (super.readAttribute(attributeName, prefix, value)) && (SpatialConstants.shortLabel == prefix); if (!isAttributeRead) {
@Override public boolean readAttribute(String attributeName, String prefix, String value) { boolean isAttributeRead = (super.readAttribute(attributeName, prefix, value)) && (SpatialConstants.shortLabel == prefix); if (!isAttributeRead) { isAttributeRead = true; if (attributeName.equals(SpatialConstants.components)) { StringTokenizer test = new StringTokenizer(value); Double[] componentsTemp = new Double[test.countTokens()]; int i = 0; while(test.hasMoreTokens()) { try { componentsTemp[i] = StringTools.parseSBMLDouble(test.nextToken()); } catch (Exception e) { logger.warn(MessageFormat.format( SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.components, getElementName())); } i++; } if (componentsTemp.length > 0) { unsetComponents(); setComponents(componentsTemp); } } else { isAttributeRead = false; // TODO - need to read componentsLength attribute as well. } } return isAttributeRead; }
@Override public boolean readAttribute(String attributeName, String prefix, String value) { boolean isAttributeRead = super.readAttribute(attributeName, prefix, value); if (!isAttributeRead) { isAttributeRead = true; if (attributeName.equals(MultiConstants.reactant)) { setReactant(value); } else if (attributeName.equals(MultiConstants.reactantComponent)) { setReactantComponent(value); } else if (attributeName.equals(MultiConstants.productComponent)) { setProductComponent(value); } else { isAttributeRead = false; } } return isAttributeRead; } }
@Override public boolean readAttribute(String attributeName, String prefix, String value) { boolean isAttributeRead = (super.readAttribute(attributeName, prefix, value)) && (SpatialConstants.shortLabel == prefix); if (!isAttributeRead) { isAttributeRead = true; if (attributeName.equals(SpatialConstants.spatialRef)) { try { setSpatialRef(value); } catch (Exception e) { logger.warn(MessageFormat.format( SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.spatialRef, getElementName())); } } else if (attributeName.equals(SpatialConstants.variable)) { try { setVariable(value); } catch (Exception e) { logger.warn(MessageFormat.format( SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.variable, getElementName())); } } else { isAttributeRead = false; } } return isAttributeRead; }
@Override public boolean readAttribute(String attributeName, String prefix, String value) { boolean isAttributeRead = (super.readAttribute(attributeName, prefix, value)) && (SpatialConstants.shortLabel == prefix); if (!isAttributeRead) { isAttributeRead = true; if (attributeName.equals(SpatialConstants.ordinal)) { try { setOrdinal(StringTools.parseSBMLInt(value)); } catch (Exception e) { logger.warn(MessageFormat.format( SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.ordinal, getElementName())); } } else if (attributeName.equals(SpatialConstants.geometryDefinition)) { try { setGeometryDefinition(value); } catch (Exception e) { logger.warn(MessageFormat.format( SpatialConstants.bundle.getString("COULD_NOT_READ_ATTRIBUTE"), value, SpatialConstants.geometryDefinition, getElementName())); } } else { isAttributeRead = false; } } return isAttributeRead; }
@Override public boolean readAttribute(String attributeName, String prefix, String value) { boolean isAttributeRead = super.readAttribute(attributeName, prefix, value); if (!isAttributeRead) { isAttributeRead = true; if (attributeName.equals(CompConstants.portRef)) { setPortRef(value); } else if (attributeName.equals(CompConstants.idRef)) { setIdRef(value); } else if (attributeName.equals(CompConstants.unitRef)) { setUnitRef(value); } else if (attributeName.equals(CompConstants.metaIdRef)) { setMetaIdRef(value); } else { isAttributeRead = false; } } return isAttributeRead; }
@Override public boolean readAttribute(String attributeName, String prefix, String value) { boolean isAttributeRead = super.readAttribute(attributeName, prefix, value); if (!isAttributeRead) { isAttributeRead = true; if (attributeName.equals("level")) { setLevel(StringTools.parseSBMLInt(value)); } else if (attributeName.equals("version")) { setVersion(StringTools.parseSBMLInt(value)); } else if (prefix != null && prefix.trim().length() > 0) { getSBMLDocumentAttributes().put(prefix + ':' + attributeName, value); } else { getSBMLDocumentAttributes().put(attributeName, value); } } return isAttributeRead; }
@Override public boolean readAttribute(String attributeName, String prefix, String value) { boolean isAttributeRead = (super.readAttribute(attributeName, prefix, value)) && (SpatialConstants.shortLabel == prefix); if(!isAttributeRead) {
@Override public boolean readAttribute(String attributeName, String prefix, String value) { boolean isAttributeRead = super.readAttribute(attributeName, prefix, value); if (!isAttributeRead) { isAttributeRead = true; if (attributeName.equals(MultiConstants.component)) { setComponent(value); } else if (attributeName.equals(MultiConstants.bindingStatus)) { try { setBindingStatus(BindingStatus.valueOf(value)); } catch (Exception e) { throw new SBMLException("Could not recognized the value '" + value + "' for the attribute " + MultiConstants.bindingStatus + " on the '" + MultiConstants.outwardBindingSite + "' element."); } } else { isAttributeRead = false; } } return isAttributeRead; }
@Override public boolean readAttribute(String attributeName, String prefix, String value) { boolean isAttributeRead = (super.readAttribute(attributeName, prefix, value)) && (SpatialConstants.shortLabel == prefix); if (!isAttributeRead) {
@Override public boolean readAttribute(String attributeName, String prefix, String value) { boolean isAttributeRead = super.readAttribute(attributeName, prefix, value); if (!isAttributeRead) { isAttributeRead = true; if (attributeName.equals("kind")) { try { Kind kind = Kind.valueOf(value.toUpperCase()); setKind(kind); } catch (Exception e) { isAttributeRead = false; } } else if (attributeName.equals("exponent")) { setExponent(getLevel() < 3 ? StringTools.parseSBMLInt(value) : StringTools.parseSBMLDouble(value)); } else if (attributeName.equals("scale")) { setScale(StringTools.parseSBMLInt(value)); } else if (attributeName.equals("multiplier")) { setMultiplier(StringTools.parseSBMLDouble(value)); } else if (attributeName.equals("offset")) { setOffset(StringTools.parseSBMLDouble(value)); } else { isAttributeRead = false; } } return isAttributeRead; }