Class ShapeTreeFactory

java.lang.Object
com.janeirodigital.shapetrees.core.validation.ShapeTreeFactory

public class ShapeTreeFactory extends Object
Provides a factory to look up and initialize ShapeTrees. Includes a simple in-memory local cache to avoid repeated fetching of remote shape tree resources.
  • Method Details

    • getShapeTree

      public static ShapeTree getShapeTree(URL shapeTreeUrl) throws ShapeTreeException
      Looks up and parses the shape tree at shapeTreeUrl. Shape trees linked via st:contains and st:references are parsed recursively. Maintains a cache to avoid parsing the same shape tree more than once.
      Parameters:
      shapeTreeUrl - URL of the shape tree to get
      Returns:
      Parsed and initialized shape tree
      Throws:
      ShapeTreeException
    • clearCache

      public static void clearCache()
      Clears the local shape tree cache
    • getLocalShapeTreeCache

      public static Map<URI,ShapeTree> getLocalShapeTreeCache()