@Override
	public int getChildCount(final List<Integer> row) {
		// Should not occur
		if (row == null || row.isEmpty()) {
			return 0;
		}

		// No expandable levels defined, so always 0
		if (levels.size() == 1) {
			return 0;
		}

		// Check iterations
		if (isIterateFirstLevel() && getMaxIterations() > -1 && row.size() > getMaxIterations()) {
			// Reached limit of iterations
			return 0;
		}

		// Index for current level
		int lvlIndex = getLevelIndex(row);

		// Check there is a Next Level
		int nxtIdx = isIterateFirstLevel() ? 1 : lvlIndex + 1;
		if (nxtIdx >= levels.size()) {
			return 0;
		}
		LevelDetails nxtLevel = levels.get(nxtIdx);

		// Get row bean
		Object rowBean = getRowBean(row);
		if (rowBean == null) {
			return 0;
		}

		// Data for next level
		Object lvlData = getBeanPropertyValue(nxtLevel.getLevelBeanProperty(), rowBean);
		if (lvlData == null) {
			return 0;
		}

		// If row per item, then count children
		if (nxtLevel.isRowPerListItem()) {
			return getSize(lvlData);
		} else {
			// One child
			return 1;
		}

	}
@ Override public int getChildCount ( final List < Integer > row ) { if ( row == null || row . isEmpty ( ) ) { return 0 ; } if ( levels . size ( ) == 1 ) { return 0 ; } if ( isIterateFirstLevel ( ) && getMaxIterations ( ) > - 1 && row . size ( ) > getMaxIterations ( ) ) { return 0 ; } int lvlIndex = getLevelIndex ( row ) ; int nxtIdx = isIterateFirstLevel ( ) ? 1 : lvlIndex + 1 ; if ( nxtIdx >= levels . size ( ) ) { return 0 ; } LevelDetails nxtLevel = levels . get ( nxtIdx ) ; Object rowBean = getRowBean ( row ) ; if ( rowBean == null ) { return 0 ; } Object lvlData = getBeanPropertyValue ( nxtLevel . getLevelBeanProperty ( ) , rowBean ) ; if ( lvlData == null ) { return 0 ; } if ( nxtLevel . isRowPerListItem ( ) ) { return getSize ( lvlData ) ; } else { return 1 ; } }
{@inheritDoc}