List retval = null;
COSBase next = action.getDictionaryObject( "Next" );
if( next instanceof COSDictionary )
{
PDAction pdAction = PDActionFactory.createAction( (COSDictionary) next );
retval = new COSArrayList(pdAction, next, action, "Next" );
}
else if( next instanceof COSArray )
{
COSArray array = (COSArray)next;
List actions = new ArrayList();
for( int i=0; i<array.size(); i++ )
{
actions.add( PDActionFactory.createAction( (COSDictionary) array.getObject( i )));
}
retval = new COSArrayList( actions, array );
}
return retval;
}