- Code: Select all
public List getListOfPara() {
ArrayList<Para> listPara = new ArrayList<Para>();
List so = new ArrayList();
so = dokument.getMainDocumentPart().getJAXBNodesViaXPath("//w:p", false);
Iterator itOds = so.iterator();
while (itOds.hasNext()) {
P ods = (P) itOds.next();
Style st =getStyleofPara(ods); //it works well, got right style
String text = vratTextOdstavce(ods);
Para odsa = new Para(st, text); [b]//write properties of style works well[/b], it is right style
listPara.add(odsa);
//also right style
}
//but here, styles from the list listPara is different paragraphs(with right content) but with all same styles
//styles of all paragraphs are the same, but in while cykle it was right styles
return listPara;
}
where is the error/mistake?
- Code: Select all
//Para class
public class Para {
private Style stylePara;
private String textPara;
//constructor
public Odstavec(Style stylePara, String textPara) {
this.stylePara = stylePara;
this.textPara = textPara;
}}