Class ShapeTreeFactory
java.lang.Object
com.janeirodigital.shapetrees.core.validation.ShapeTreeFactory
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 Summary
Modifier and TypeMethodDescriptionstatic voidClears the local shape tree cachestatic ShapeTreegetShapeTree(URL shapeTreeUrl) Looks up and parses the shape tree atshapeTreeUrl.
-
Method Details
-
getShapeTree
Looks up and parses the shape tree atshapeTreeUrl. 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
-