Exemplo n.º 1
0
 public boolean link(Reference reference, OMEModelObject o) {
   boolean wasHandledBySuperClass = super.link(reference, o);
   if (wasHandledBySuperClass) {
     return true;
   }
   LOGGER.debug("Unable to handle reference of type: {}", reference.getClass());
   return false;
 }
Exemplo n.º 2
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);
   }
 }
Exemplo n.º 3
0
 public boolean link(Reference reference, OMEModelObject o) {
   boolean wasHandledBySuperClass = super.link(reference, o);
   if (wasHandledBySuperClass) {
     return true;
   }
   if (reference instanceof PlateRef) {
     Plate o_casted = (Plate) o;
     o_casted.linkScreen(this);
     if (!plateLinks.contains(o_casted)) {
       plateLinks.add(o_casted);
     }
     return true;
   }
   if (reference instanceof AnnotationRef) {
     Annotation o_casted = (Annotation) o;
     o_casted.linkScreen(this);
     if (!annotationLinks.contains(o_casted)) {
       annotationLinks.add(o_casted);
     }
     return true;
   }
   LOGGER.debug("Unable to handle reference of type: {}", reference.getClass());
   return false;
 }