You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Zachary Mitchell <za...@internode.on.net> on 2010/09/28 11:38:16 UTC
Using reflection to invoke a protected method in the Range class.
/*
Can anyone tell me why the following won't invoke, given that
all the correct packages have been imported?
*/
//Java Version 1.6.0_20-b02
Class [] types = {ParagraphProperties.class,Integer.class,String.class};
Method insertAfter = overall.getClass().getDeclaredMethod(new String("insertAfter"),types);
insertAfter.setAccessible(true);
insertAfter.invoke(properties,0,"/r");
insertAfter.setAccessible(false);