/** * Sets the text of this text run * * @param value the literal text which shall be displayed in the document */ public void setText(String value) { setText(value, run.sizeOfTArray()); }
/** * Return the string content of this text run * * @return the text of this text run or <code>null</code> if not set */ public String getText(int pos) { return run.sizeOfTArray() == 0 ? null : run.getTArray(pos) .getStringValue(); }
/** * Sets the text of this text run in the * * @param value the literal text which shall be displayed in the document * @param pos - position in the text array (NB: 0 based) */ public void setText(String value, int pos) { if (pos > run.sizeOfTArray()) { throw new ArrayIndexOutOfBoundsException("Value too large for the parameter position in XWPFRun.setText(String value,int pos)"); } CTText t = (pos < run.sizeOfTArray() && pos >= 0) ? run.getTArray(pos) : run.addNewT(); t.setStringValue(value); preserveSpaces(t); }
/** * Sets the text of this text run * * @param value the literal text which shall be displayed in the document */ public void setText(String value) { setText(value, run.sizeOfTArray()); }
/** * Sets the text of this text run in the * * @param value the literal text which shall be displayed in the document * @param pos - position in the text array (NB: 0 based) */ public void setText(String value, int pos) { if(pos > run.sizeOfTArray()) throw new ArrayIndexOutOfBoundsException("Value too large for the parameter position in XWPFRun.setText(String value,int pos)"); CTText t = (pos < run.sizeOfTArray() && pos >= 0) ? run.getTArray(pos) : run.addNewT(); t.setStringValue(value); preserveSpaces(t); }
/** * Return the string content of this text run * * @return the text of this text run or <code>null</code> if not set */ public String getText(int pos) { return run.sizeOfTArray() == 0 ? null : run.getTArray(pos) .getStringValue(); }
/** * Sets the text of this text run in the * * @param value the literal text which shall be displayed in the document * @param pos - position in the text array (NB: 0 based) */ public void setText(String value, int pos) { if (pos > run.sizeOfTArray()) { throw new ArrayIndexOutOfBoundsException("Value too large for the parameter position in XWPFRun.setText(String value,int pos)"); } CTText t = (pos < run.sizeOfTArray() && pos >= 0) ? run.getTArray(pos) : run.addNewT(); t.setStringValue(value); preserveSpaces(t); }
/** * Return the string content of this text run * * @return the text of this text run or <code>null</code> if not set */ public String getText(int pos) { return run.sizeOfTArray() == 0 ? null : run.getTArray(pos) .getStringValue(); }