Class AddElementToTreeAction
- java.lang.Object
-
- org.gcube.informationsystem.discovery.knowledge.AddElementToTreeAction
-
- All Implemented Interfaces:
DiscoveredElementAction<Element>
public class AddElementToTreeAction extends Object implements DiscoveredElementAction<Element>
ADiscoveredElementActionthat adds discovered elements to aTreeand updates usage knowledge.- Author:
- Luca Frosini (ISTI - CNR)
-
-
Field Summary
Fields Modifier and Type Field Description protected UsageKnowledgefacetKnowledgeThe knowledge base for facet usage.protected UsageKnowledgeresourceKnowledgeThe knowledge base for resource usage.protected Tree<Class<Element>>treeThe tree to which discovered elements will be added.
-
Constructor Summary
Constructors Constructor Description AddElementToTreeAction(Tree<Class<Element>> tree)Constructs a new action with the specified tree.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidanalizeElement(Class<Element> e)Analyzes a discovered element.protected voidcreateUsageKnowledge(Class<Element> e)Creates usage knowledge for the given element by analyzing its type definition.UsageKnowledgegetFacetKnowledge()Returns the facet usage knowledge.UsageKnowledgegetResourceKnowledge()Returns the resource usage knowledge.voidsetFacetKnowledge(UsageKnowledge facetKnowledge)Sets the facet usage knowledge.voidsetResourceKnowledge(UsageKnowledge resourceKnowledge)Sets the resource usage knowledge.
-
-
-
Field Detail
-
facetKnowledge
protected UsageKnowledge facetKnowledge
The knowledge base for facet usage.
-
resourceKnowledge
protected UsageKnowledge resourceKnowledge
The knowledge base for resource usage.
-
-
Method Detail
-
getFacetKnowledge
public UsageKnowledge getFacetKnowledge()
Returns the facet usage knowledge.- Returns:
- The facet usage knowledge.
-
setFacetKnowledge
public void setFacetKnowledge(UsageKnowledge facetKnowledge)
Sets the facet usage knowledge.- Parameters:
facetKnowledge- The facet usage knowledge.
-
getResourceKnowledge
public UsageKnowledge getResourceKnowledge()
Returns the resource usage knowledge.- Returns:
- The resource usage knowledge.
-
setResourceKnowledge
public void setResourceKnowledge(UsageKnowledge resourceKnowledge)
Sets the resource usage knowledge.- Parameters:
resourceKnowledge- The resource usage knowledge.
-
analizeElement
public void analizeElement(Class<Element> e) throws Exception
Analyzes a discovered element.- Specified by:
analizeElementin interfaceDiscoveredElementAction<Element>- Parameters:
e- The class of the discovered element.- Throws:
Exception- if an error occurs during analysis.
-
-