Allow the nav bean to count children. This could be done directly in jelly, but I hate jelly. And I can write

test cases in the same format as the other test cases.
PR: MAVEN-579


git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@113658 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
bwalding committed 2003-07-17 09:33:12 +00:00
1 parent c3b706102f
commit 6ba41dd168
2 files changed
+50 -21

No files matched your search

+11 -1
View File
@@ -64,7 +64,7 @@ import org.dom4j.tree.DefaultElement;
/**
* @author <a href="bwalding@jakarta.org">Ben Walding</a>
* @version $Id: NavBean.java,v 1.4 2003/03/10 14:18:41 bwalding Exp $
* @version $Id: NavBean.java,v 1.5 2003/07/17 09:33:12 bwalding Exp $
*/
public class NavBean
{
@@ -95,6 +95,16 @@ public class NavBean
{
return getAttribute(elem, "href", null);
}
/**
* Assumes that the node is visible.
* @param o
* @return the number of children for this node
*/
public int countChildren(DefaultElement elem) {
List l = elem.selectNodes("./item");
return l.size();
}
/**
* Determines if the given node is collapsed. If a parent of this node is