)
{
for(PdfDirectObject fieldObject : fieldObjects)
{
PdfReference fieldReference = (PdfReference)fieldObject;
PdfArray kidReferences = (PdfArray)File.resolve(
((PdfDictionary)fieldReference.getDataObject()).get(PdfName.Kids)
);
PdfDictionary kidObject;
if(kidReferences == null)
{kidObject = null;}
else
{kidObject = (PdfDictionary)((PdfReference)kidReferences.get(0)).getDataObject();}
// Terminal field?
if(kidObject == null // Merged single widget annotation.
|| (!kidObject.containsKey(PdfName.FT) // Multiple widget annotations.
&& kidObject.containsKey(PdfName.Subtype)
&& kidObject.get(PdfName.Subtype).equals(PdfName.Widget)))