Class AbstractTraverser

java.lang.Object
org.biopax.paxtools.controller.Traverser
org.biopax.paxtools.controller.AbstractTraverser
All Implemented Interfaces:
Visitor
Direct Known Subclasses:
LevelUpgrader

public abstract class AbstractTraverser extends Traverser implements Visitor
This is an all-in-one Traverser/Visitor combination to use when deep recursive visiting is required. Unlike Traverser, it keeps track of where current object is in the model and whether it's been already visited, which helps prevent infinite loops. Like it's for the Traverser, there is no any particular order in which it processes properties.
Author:
rodch
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • visit

      protected abstract void visit(Object range, BioPAXElement domain, Model model, PropertyEditor<?,?> editor)
      This is to implement a real action here: do something, return or even to continue (traverse) into the child (range) element's properties if it's a BioPAX object.
      Parameters:
      range - property value
      domain - parent/owner BioPAX element
      model - the BioPAX model of interest
      editor - the property editor
    • visit

      public void visit(BioPAXElement domain, Object range, Model model, PropertyEditor<?,?> editor)
      Calls the protected abstract method visit that is to be implemented in subclasses of this abstract class.
      Specified by:
      visit in interface Visitor
      Parameters:
      domain - BioPAX Element
      range - property value (can be BioPAX element, primitive, enum, string)
      model - the BioPAX model of interest
      editor - parent's property PropertyEditor
    • traverse

      public <D extends BioPAXElement> void traverse(D element, Model model)
      Description copied from class: Traverser
      Traverse and visit Visitor all properties of the element. This method does not traverse iteratively to the values.
      Overrides:
      traverse in class Traverser
      Type Parameters:
      D - actual BioPAX type which properties and inherited properties will be used
      Parameters:
      element - BioPAX element to be traversed
      model - to be traversed, but not necessarily (depends on the Visitor implementation).
    • reset

      public void reset()
      Clears the internal set of traversed biopax objects. Apply if you're re-using the same traverser instance but start over from a different root biopax element.