Class SourceItemVisitor


  • public class SourceItemVisitor
    extends java.lang.Object
    A helper class for visiting all items recursively in a tree of source items.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void onVisit​(SourceItemVisitCallback callback)
      Provides a callback which will be called once for each source item located.
      protected void recursivelyVisit​(nuix.SourceItem sourceItem)
      Recursively visits source items and their children unless callback specifies skipping children for a given source item.
      void visit​(java.io.File file, java.util.Map<?,​?> sourceItemFactorySettings, java.util.Map<?,​?> fileSettings)
      Creates a SourceItemFactory and begins recursing the source item tree for the provided file.
      void visit​(java.lang.String file, java.util.Map<?,​?> sourceItemFactorySettings, java.util.Map<?,​?> fileSettings)
      Creates a SourceItemFactory and begins recursing the source item tree for the provided file.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SourceItemVisitor

        public SourceItemVisitor()
    • Method Detail

      • onVisit

        public void onVisit​(SourceItemVisitCallback callback)
        Provides a callback which will be called once for each source item located.
        Parameters:
        callback - A callback which will be invoked each time a source item is visited.
      • visit

        public void visit​(java.io.File file,
                          java.util.Map<?,​?> sourceItemFactorySettings,
                          java.util.Map<?,​?> fileSettings)
                   throws java.io.FileNotFoundException
        Creates a SourceItemFactory and begins recursing the source item tree for the provided file.
        Parameters:
        file - The file to recurse.
        sourceItemFactorySettings - Settings you might provide to a call to Utilities.getSourceItemFactory, can be null to use defaults
        fileSettings - Settings you might provide to a call to SourceItemFactory.openFile, can be null to use defaults
        Throws:
        java.io.FileNotFoundException - Thrown by SourceItemFactory if the provided file does not exist.
      • visit

        public void visit​(java.lang.String file,
                          java.util.Map<?,​?> sourceItemFactorySettings,
                          java.util.Map<?,​?> fileSettings)
                   throws java.io.FileNotFoundException
        Creates a SourceItemFactory and begins recursing the source item tree for the provided file.
        Parameters:
        file - The file to recurse.
        sourceItemFactorySettings - Settings you might provide to a call to Utilities.getSourceItemFactory, can be null to use defaults
        fileSettings - Settings you might provide to a call to SourceItemFactory.openFile, can be null to use defaults
        Throws:
        java.io.FileNotFoundException - Thrown by SourceItemFactory if the provided file does not exist.
      • recursivelyVisit

        protected void recursivelyVisit​(nuix.SourceItem sourceItem)
        Recursively visits source items and their children unless callback specifies skipping children for a given source item.
        Parameters:
        sourceItem - The source item to visit and potentially recursively visit children of.