use of cbit.vcell.mapping.ReactionRuleSpec.ReactionRuleMappingType in project vcell by virtualcell.
the class XmlReader method getReactionRuleSpecs.
public ReactionRuleSpec[] getReactionRuleSpecs(SimulationContext simContext, Element reactionRuleSpecsElement) throws XmlParseException {
List<Element> reactionRulesSpecIterator = reactionRuleSpecsElement.getChildren(XMLTags.ReactionRuleSpecTag, vcNamespace);
ArrayList<ReactionRuleSpec> reactionRuleSpecs = new ArrayList<ReactionRuleSpec>();
for (Element rrElement : reactionRulesSpecIterator) {
String rrName = unMangle(rrElement.getAttributeValue(XMLTags.ReactionRuleRefAttrTag));
String rrMappingString = rrElement.getAttributeValue(XMLTags.ReactionRuleMappingAttrTag);
ReactionRuleMappingType rrMapping = ReactionRuleMappingType.fromDatabaseName(rrMappingString);
ReactionRule reactionRule = simContext.getModel().getRbmModelContainer().getReactionRule(rrName);
ReactionRuleSpec reactionRuleSpec = new ReactionRuleSpec(reactionRule);
reactionRuleSpec.setReactionRuleMapping(rrMapping);
reactionRuleSpecs.add(reactionRuleSpec);
}
return reactionRuleSpecs.toArray(new ReactionRuleSpec[0]);
}
Aggregations