public class DisplayHierarchy extends Object
Modifier and Type | Class and Description |
---|---|
static class |
DisplayHierarchy.DisplayHierarchyContext
A collection of the state information we keep while expanding the display hierarchy
|
Constructor and Description |
---|
DisplayHierarchy(Page page)
Construct a new display hierarchy for the given page
|
Modifier and Type | Method and Description |
---|---|
protected void |
annotateNodeList(DisplayHierarchy.DisplayHierarchyContext context,
List<DisplayHierarchyNode> nodes,
String firstHint) |
protected void |
annotateNodes(DisplayHierarchy.DisplayHierarchyContext context,
DisplayHierarchyNode node)
Walk the tree from a node and add display hints
|
protected void |
annotateSiblings(DisplayHierarchy.DisplayHierarchyContext context,
DisplayHierarchyNode node) |
void |
expand()
Expand the hierarchy from the given roots
|
protected void |
expandNode(DisplayHierarchy.DisplayHierarchyContext context,
DisplayHierarchyNode parent)
Expand a hierarchy node by extracting the properties of the node, matching
paths to properties, and appending the children to the expansion queue if appropriate.
|
protected DisplayHierarchy.DisplayHierarchyContext |
initialiseContext() |
protected boolean |
isLiteralValued(DisplayHierarchyNode node) |
protected Set<PropertyPath> |
matchingPaths(DisplayHierarchy.DisplayHierarchyContext context,
com.hp.hpl.jena.rdf.model.Property p,
Set<PropertyPath> paths)
Select which of the given property paths matches the given property p.
|
List<DisplayHierarchyNode> |
roots() |
public DisplayHierarchy(Page page)
page
- public List<DisplayHierarchyNode> roots()
public void expand()
protected void expandNode(DisplayHierarchy.DisplayHierarchyContext context, DisplayHierarchyNode parent)
context
- The current display hierarchy contextparent
- The node to be expandedprotected Set<PropertyPath> matchingPaths(DisplayHierarchy.DisplayHierarchyContext context, com.hp.hpl.jena.rdf.model.Property p, Set<PropertyPath> paths)
PropertyPath.beginsWith(Property, ShortNameRenderer)
context
- The current context, including the short name rendererp
- An RDF propertypaths
- The paths for considerationpaths
, possibly empty, which start with the
given property or *
protected DisplayHierarchy.DisplayHierarchyContext initialiseContext()
protected void annotateNodes(DisplayHierarchy.DisplayHierarchyContext context, DisplayHierarchyNode node)
context
- node
- protected void annotateSiblings(DisplayHierarchy.DisplayHierarchyContext context, DisplayHierarchyNode node)
protected void annotateNodeList(DisplayHierarchy.DisplayHierarchyContext context, List<DisplayHierarchyNode> nodes, String firstHint)
protected boolean isLiteralValued(DisplayHierarchyNode node)
Copyright © 2014. All Rights Reserved.