public class DisplayHierarchyNode extends Object
Modifier and Type | Field and Description |
---|---|
static int |
MAX_RELATED_LINK_LABEL_LENGTH
Maximum label length in a related link
|
static String |
SORT_BY_FORMAT |
Constructor and Description |
---|
DisplayHierarchyNode(PropertyPath pathTo,
DisplayHierarchyNode parent,
DisplayRdfNode rdfNode,
ShortNameRenderer shortNameRenderer) |
Modifier and Type | Method and Description |
---|---|
void |
addHint(String hint)
Add a new hint to this node's list of display hints
|
void |
addSibling(DisplayHierarchyNode sibling)
Add a sibling node to this node
|
List<DisplayHierarchyNode> |
children() |
Set<PropertyPath> |
explicitPaths() |
List<DisplayHierarchyNode> |
extractByPredicate(List<Object> properties)
Extract the given properties, so that they can be treated in a particular
way by the renderer.
|
List<DisplayHierarchyNode> |
extractByPredicate(Object... properties)
Extract the given properties, so that they can be treated in a particular
way by the renderer.
|
boolean |
findAncestor(DisplayRdfNode resource) |
protected Link |
generateLink(String paramName,
String paramNameLabel,
String paramValue,
String paramValueLabel,
String rel,
String hint,
boolean set,
Page page)
Generate a link to an adjacent point in API space, by changing the value of a parameter
of the URI.
|
protected Link |
generateSortLink(String paramName,
String paramHTML,
String hint,
boolean asc,
Page page)
Generate a link to an adjacent point in API space by adding or removing a sort parameter.
|
String |
getLexicalForm() |
String |
getName() |
String |
getURI() |
Object |
getValue() |
boolean |
hasAllProperties(List<Object> properties) |
boolean |
hasAllProperties(Object... properties) |
boolean |
hasHint(String hint) |
boolean |
hasSiblings() |
String |
hintsString() |
protected int |
indexOfChildProperty(com.hp.hpl.jena.rdf.model.Property prop) |
boolean |
isAnon() |
boolean |
isLeaf(DisplayHierarchy.DisplayHierarchyContext context)
A node is a leaf of the hierarchy if any of the following apply:
it is a literal
it has already occurred among its own ancestors (ie is a loop)
it is not a top-level root node, has been previously expanded
and is not on an explicit property path
|
boolean |
isList() |
boolean |
isLiteral() |
boolean |
isLoop() |
boolean |
isOnExplicitPath() |
boolean |
isResource() |
boolean |
isRoot() |
boolean |
isSimpleResource()
Return true if this node is a simple resource node: that is,
it is a resource, and has no properties other than either
rdfs:label or skos:prefLabel . |
DisplayHierarchyNode |
parent() |
PropertyPath |
pathTo() |
void |
pullToStart(List<Object> properties)
Promote the given properties to the front of the list of properties attached
to this node.
|
void |
pullToStart(Object... properties)
Promote the given properties to the front of the list of properties attached
to this node.
|
DisplayRdfNode |
rdfNode() |
List<Link> |
relatedLinks() |
String |
relatedLinksHTML() |
List<DisplayHierarchyNode> |
siblings() |
com.epimorphics.rdfutil.RDFNodeWrapper |
terminalLink() |
public static final String SORT_BY_FORMAT
public static final int MAX_RELATED_LINK_LABEL_LENGTH
public DisplayHierarchyNode(PropertyPath pathTo, DisplayHierarchyNode parent, DisplayRdfNode rdfNode, ShortNameRenderer shortNameRenderer)
public PropertyPath pathTo()
public com.epimorphics.rdfutil.RDFNodeWrapper terminalLink()
public boolean isOnExplicitPath()
public Set<PropertyPath> explicitPaths()
public DisplayHierarchyNode parent()
public boolean isRoot()
public DisplayRdfNode rdfNode()
public boolean isLoop()
public boolean findAncestor(DisplayRdfNode resource)
resource
, or if any of my ancestors dopublic boolean isLeaf(DisplayHierarchy.DisplayHierarchyContext context)
context
- The current context, which contains the list of seen nodespublic List<DisplayHierarchyNode> children()
public void addSibling(DisplayHierarchyNode sibling)
public List<DisplayHierarchyNode> siblings()
public boolean hasSiblings()
public void addHint(String hint)
public String hintsString()
public boolean hasHint(String hint)
public boolean isSimpleResource()
rdfs:label
or skos:prefLabel
.public String relatedLinksHTML()
public boolean hasAllProperties(Object... properties)
public boolean hasAllProperties(List<Object> properties)
public void pullToStart(Object... properties)
a,b,c,d,e
, and we pullToStart(c,d,f)
the children of the node will become c,d,a,b,e
properties
- RDF properties which will identify the children of this node to
move to the front of the children list. Order within the properties
is preserved.public void pullToStart(List<Object> properties)
a,b,c,d,e
, and we pullToStart(c,d,f)
the children of the node will become c,d,a,b,e
properties
- RDF properties which will identify the children of this node to
move to the front of the children list. Order within the properties
is preserved.public List<DisplayHierarchyNode> extractByPredicate(Object... properties)
properties
- One or more RDF properties as Property objects or qName stringspublic List<DisplayHierarchyNode> extractByPredicate(List<Object> properties)
properties
- One or more RDF properties as Property objects or qName stringspublic boolean isResource()
RDFNodeWrapper.isResource()
public boolean isLiteral()
RDFNodeWrapper.isLiteral()
public boolean isAnon()
RDFNodeWrapper.isAnon()
public boolean isList()
RDFNodeWrapper.isList()
public String getLexicalForm()
RDFNodeWrapper.getLexicalForm()
public String getName()
RDFNodeWrapper.getName()
public Object getValue()
RDFNodeWrapper.getValue()
public String getURI()
RDFNodeWrapper.getURI()
protected Link generateLink(String paramName, String paramNameLabel, String paramValue, String paramValueLabel, String rel, String hint, boolean set, Page page)
paramName
- The name of the parameter to changeparamNameLabel
- Presentation form of paramNameparamValue
- The value to changeparamValueLabel
- The value on the label to show to the userrel
- The relationship of the parameter value to the new statehint
- CSS hintset
- If true, set the value rather than add it (see EldaURL.OPERATION
)page
- The current page objectprotected Link generateSortLink(String paramName, String paramHTML, String hint, boolean asc, Page page)
paramName
- The name of the parameter to changeparamHTML
- The parameter's name in HTML formhint
- CSS hintasc
- If true, sort ascendingpage
- The current page objectprotected int indexOfChildProperty(com.hp.hpl.jena.rdf.model.Property prop)
Copyright © 2014. All Rights Reserved.