}
private void addFieldAndChildren( PDFieldTreeNode docField, List<FDFField> fdfFields ) throws IOException
{
Object fieldValue = docField.getValue();
FDFField fdfField = new FDFField();
fdfField.setPartialFieldName( docField.getPartialName() );
fdfField.setValue( fieldValue );
List<COSObjectable> kids = docField.getKids();
List<FDFField> childFDFFields = new ArrayList<FDFField>();
if( kids != null )
{
for (COSObjectable kid : kids)
{
addFieldAndChildren((PDFieldTreeNode) kid, childFDFFields);
}
if( childFDFFields.size() > 0 )
{
fdfField.setKids( childFDFFields );
}
}
if( fieldValue != null || childFDFFields.size() > 0 )
{
fdfFields.add( fdfField );