private void findTargets ( final IndexTerm term ) { final List < IndexTerm > subTerms = term . getSubTerms ( ) ; List < IndexTermTarget > subTargets = null ; if ( subTerms != null && ! subTerms . isEmpty ( ) ) { for ( final IndexTerm subTerm : subTerms ) { subTargets = subTerm . getTargetList ( ) ; if ( subTargets != null && ! subTargets . isEmpty ( ) ) { //findTargets(subTerm); //add targets(child term) term . addTargets ( subTerm . getTargetList ( ) ) ; } else { //term.addTargets(subTerm.getTargetList()); //recursive search child's child term findTargets ( subTerm ) ; } //add target to parent indexterm term . addTargets ( subTerm . getTargetList ( ) ) ; } } }
find the targets in its subterms when the current term doesn t have any target