@Override public String getContent() { if(pieces == null) { // || pieces.length == 0){ return ""; } StringBuilder sb = new StringBuilder(""); for (ParagraphPiece piece : pieces) { sb.append(piece.getContent()); } String txt = " <w:p wsp:rsidR=\"008979E8\" wsp:rsidRDefault=\"00000000\">" +"\n {styleText}" // {styleText} is inside styleText +"\n {tabs}" +"\n {value}" +"\n </w:p>"; if("".equals(sb.toString())){ //if there is no content in the pieces, there is no return - just empty string. return ""; }else{ txt = doAddTabs(txt); //For convention, it should be the last thing before returning the xml content. txt = style.getNewContentWithStyle(txt); return txt.replace("{value}", sb.toString()); } }
@Override public String getContent() { if(pieces == null) { // || pieces.length == 0){ return ""; } StringBuilder sb = new StringBuilder(""); for (ParagraphPiece piece : pieces) { sb.append(piece.getContent()); } String txt = " <w:p wsp:rsidR=\"008979E8\" wsp:rsidRDefault=\"00000000\">" +"\n {styleText}" // {styleText} is inside styleText +"\n {tabs}" +"\n {value}" +"\n </w:p>"; if("".equals(sb.toString())){ //if there is no content in the pieces, there is no return - just empty string. return ""; }else{ txt = doAddTabs(txt); //For convention, it should be the last thing before returning the xml content. txt = style.getNewContentWithStyle(txt); return txt.replace("{value}", sb.toString()); } }