Search in sources :

Example 1 with ReactionRuleMappingType

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]);
}
Also used : ReactionRule(cbit.vcell.model.ReactionRule) ReactionRuleSpec(cbit.vcell.mapping.ReactionRuleSpec) Element(org.jdom.Element) ArrayList(java.util.ArrayList) ReactionRuleMappingType(cbit.vcell.mapping.ReactionRuleSpec.ReactionRuleMappingType)

Aggregations

ReactionRuleSpec (cbit.vcell.mapping.ReactionRuleSpec)1 ReactionRuleMappingType (cbit.vcell.mapping.ReactionRuleSpec.ReactionRuleMappingType)1 ReactionRule (cbit.vcell.model.ReactionRule)1 ArrayList (java.util.ArrayList)1 Element (org.jdom.Element)1