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