Exemple #1
0
 /**
  * Updates FilterRef recursively from an XML DOM tree. <b>NOTE:</b> No properties are removed,
  * only added or updated.
  *
  * @param element Root of the XML DOM tree to construct a model object graph from.
  * @param model Handler for the OME model which keeps track of instances and references seen
  *     during object population.
  * @throws EnumerationException If there is an error instantiating an enumeration during model
  *     object creation.
  */
 public void update(Element element, OMEModel model) throws EnumerationException {
   super.update(element, model);
   String tagName = element.getTagName();
   if (!"FilterRef".equals(tagName)) {
     LOGGER.debug("Expecting node name of FilterRef got {}", tagName);
   }
   if (!element.hasAttribute("ID") && getID() == null) {
     // TODO: Should be its own exception
     throw new RuntimeException(String.format("FilterRef missing required ID property."));
   }
   if (element.hasAttribute("ID")) {
     // ID property
     setID(String.valueOf(element.getAttribute("ID")));
     // Adding this model object to the model handler
     model.addModelObject(getID(), this);
   }
 }