public class ComponentLookup extends Object
| Constructor and Description |
|---|
ComponentLookup(ComponentNode top) |
| Modifier and Type | Method and Description |
|---|---|
void |
addComponentNodeToLookup(ComponentNode parent,
ComponentNode node) |
boolean |
containsComponent(Object obj) |
<N> Map<String,N> |
getChildren(ComponentNode node,
Class<N> classFilter)
gets the children of a Component in the ComponentNode and filters by
Class.
|
Object |
getComponentByPath(String path)
return any object registered by the componentNodeDictionaries of the service.
|
ComponentNode |
getComponentNodeForObject(Object obj) |
String |
getNameOfComponent(Object obj) |
ComponentNode |
getNodeByPath(String path)
return any object registered by the componentNodeDictionaries of the service.
|
ComponentNode |
getTopComponentNode()
Get the top ComponentNode, ie the tip of the tree structure.
|
<Q> List<Q> |
listChildren(ComponentNode node,
Class<Q> klass)
lists the children of a component.
|
<N> List<N> |
listDescendants(ComponentNode node,
Class<N> classFilter)
Finds all the children of the given class in the sub-tree starting at the
node named
parentName |
void |
setComponentNodeName(ComponentNode node,
String name) |
public ComponentLookup(ComponentNode top)
public ComponentNode getTopComponentNode()
public void setComponentNodeName(ComponentNode node, String name)
public void addComponentNodeToLookup(ComponentNode parent, ComponentNode node)
parent - the parent component to which the node is added.node - public Object getComponentByPath(String path)
path - the absolute path to the node component OR the name of the node componentRuntimeException - when the path matches multiple componentspublic ComponentNode getNodeByPath(String path)
path - public ComponentNode getComponentNodeForObject(Object obj)
public <N> Map<String,N> getChildren(ComponentNode node, Class<N> classFilter)
N - the type of nodenode - classFilter - the class filter. Any class if set to nullparentName, mapped by their name. The
returned map preserves the order in which nodes were inserted in
the component nodepublic <N> List<N> listDescendants(ComponentNode node, Class<N> classFilter)
parentNameN - node - the node to start getting the children
from. If set to null, the whole component tree is tested against the
filter, even the top node.classFilter - the class filter. Any class if set to nullpublic <Q> List<Q> listChildren(ComponentNode node, Class<Q> klass)
Q - the type of nodeparentName - klass - public boolean containsComponent(Object obj)
Copyright © 2020 LSST. All rights reserved.