@Override protected Object createListOfChild(ListOf<?> listOf, String elementName) { // We need to create the plugin beforehand in some cases if (elementName.equals(MultiConstants.intraSpeciesReaction) || elementName.equals(MultiConstants.bindingSiteSpeciesType)) { // getPlugin will create the plugin if it does not already exist listOf.getParent().getPlugin(MultiConstants.shortLabel); } return super.createListOfChild(listOf, elementName); }
protected Object createListOfChild(ListOf<?> listOf, String elementName) { Object parentSBase = listOf.getParent();
Object parentSBase = listOf.getParent(); SBasePlugin parentPlugin = null;
SBase sBase = listOf.getParent(); ArraysSBasePlugin arraysPlugin = (ArraysSBasePlugin) sBase.getPlugin(ArraysConstants.shortLabel);
@Override public boolean check(ValidationContext ctx, LocalParameter lp) { if (lp.isSetUserObjects() && lp.getUserObject(JSBML.UNKNOWN_XML) != null) { XMLNode unknownNode = (XMLNode) lp.getUserObject(JSBML.UNKNOWN_XML); // System.out.println("UnknownAttributeValidationFunction - attributes.length = " + unknownNode.getAttributesLength()); if (unknownNode.getAttributesLength() > 0 && unknownNode.getAttrIndex("constant") != -1) { String constant = unknownNode.getAttrValue("constant"); if (! "true".equals(constant)) { ValidationConstraint.logError(ctx, CORE_21124, lp, lp.getId(), ((SBase) lp.getParent().getParent().getParent()).getId()); return false; } } } return true; } };
@Override public boolean check(ValidationContext ctx, LocalParameter lp) { boolean check = true; if (lp.isSetId()) { String localParameterId = lp.getId(); Reaction r = (Reaction) lp.getParent().getParent().getParent(); String type = "reactant"; if (r.getReactantForSpecies(localParameterId) != null) { check = false; } if (r.getProductForSpecies(localParameterId) != null) { type = "product"; check = false; } if (r.getModifierForSpecies(localParameterId) != null) { type = "modifier"; check = false; } if (!check) { ValidationConstraint.logError(ctx, CORE_21173, lp, localParameterId, r.getId(), type); } } return check; } };