I created a new Document file using the WordprocessingMLPackage.createPackage() method. Now I'm trying to manipulate the contents of the default style ("Heading 1", "Normal", etc.). When I'm trying to printout the values of the style's property, it returns NullPointerException. I'm pretty sure the Styles are there because the names can be printed out. but when I try to access it's paragraph properties it's null.
So now I'm wondering If I'm not accessing the contents properly.
private static void createStyleFile() throws InvalidFormatException
{
WordprocessingMLPackage doc = WordprocessingMLPackage.createPackage();
List<Style> styleList = doc.getMainDocumentPart().getStyleDefinitionsPart().getJaxbElement().getStyle();
for(int x = 0; x < styleList.size(); x++)
{
Style curStyle = styleList.get(x);
//C.out(curStyle.getStyleId());
C.out(curStyle.getName().getVal());
curStyle.getPPr().getInd().getFirstLine().intValue();
}
}