-// $Id$
/**
* Copyright (C) 2007 EDIT
* European Distributed Institute of Taxonomy
import eu.etaxonomy.cdm.model.description.DescriptionBase;
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
import eu.etaxonomy.cdm.model.description.Feature;
-import eu.etaxonomy.cdm.model.description.FeatureNode;
-import eu.etaxonomy.cdm.model.description.FeatureTree;
+import eu.etaxonomy.cdm.model.term.FeatureNode;
+import eu.etaxonomy.cdm.model.term.FeatureTree;
import eu.etaxonomy.cdm.model.description.TaxonDescription;
/**
- private FeatureNode featureNode;
+ private FeatureNode<Feature> featureNode;
private List<FeatureNodeContainer> children = new ArrayList<FeatureNodeContainer>();
private List<DescriptionElementBase> descriptionElements = new ArrayList<DescriptionElementBase>();
* @param description
* @return
*/
- protected void findLeaves(FeatureNode featureNode) {
+ protected void findLeaves(FeatureNode<Feature> featureNode) {
if(featureNode.isLeaf()){
buildLeaf(featureNode);
}else{
- for(FeatureNode childNode : featureNode.getChildNodes()){
+ for(FeatureNode<Feature> childNode : featureNode.getChildNodes()){
findLeaves(childNode);
}
}
* @param description
* @return
*/
- private void buildLeaf(FeatureNode featureNode){
- if(featureNode.getFeature() == null){
+ private void buildLeaf(FeatureNode<Feature> featureNode){
+ if(featureNode.getTerm() == null){
throw new IllegalArgumentException("The given feature node does not have a feature.");
}
- Feature feature = (Feature) HibernateProxyHelper.deproxy(featureNode.getFeature());
+ Feature feature = HibernateProxyHelper.deproxy(featureNode.getTerm());
// get feature node container for the given feature
FeatureNodeContainer container = containerTree.getFeatureNodeContainer(feature);
*/
private void buildBranch(){
if(getParent() == null){
- FeatureNode parentFeatureNode = getFeatureNode().getParent();
+ FeatureNode<Feature> parentFeatureNode = getFeatureNode().getParent();
if(parentFeatureNode.isRoot()){
containerTree.getRoot().addChild(this);
/**
* <p>Setter for the field <code>featureNode</code>.</p>
*
- * @param featureNode a {@link eu.etaxonomy.cdm.model.description.FeatureNode} object.
+ * @param featureNode a {@link eu.etaxonomy.cdm.model.term.FeatureNode} object.
*/
- public void setFeatureNode(FeatureNode featureNode) {
+ public void setFeatureNode(FeatureNode<Feature> featureNode) {
this.featureNode = featureNode;
}
/**
* <p>Getter for the field <code>featureNode</code>.</p>
*
- * @return a {@link eu.etaxonomy.cdm.model.description.FeatureNode} object.
+ * @return a {@link eu.etaxonomy.cdm.model.term.FeatureNode} object.
*/
- public FeatureNode getFeatureNode() {
+ public FeatureNode<Feature> getFeatureNode() {
return featureNode;
}
*/
public Feature getFeature(){
if(featureNode != null){
- return featureNode.getFeature();
+ return featureNode.getTerm();
}
return null;
}