/** * Replace whole of inside the tag by replacement.<br> * If this tag can not have String directory (ex. <table> tag), do nothing. * * @param replacement */ public void replaceInner(String replacement) { ReplaceInnerUtil.replaceInner(this, replacement); }
/** * Replace whole of inside the tag by the whole elements of the list.<br> * If the element can not be use in this tag, There is a case that will be exclude. * * @param replacement */ public void replaceInner(List<java.lang.Object> replacement) { ReplaceInnerUtil.replaceInner(this, replacement); }
/** * Replace whole of inside the tag by replacement.<br> * For various reasons, this method does NOT use deep copy of replacement.<br> * It is recommended to use copy(T) in method argument. * * <p>このタグの中身の全てをreplacementで完全に置換します。<br> * このメソッドではreplacementのディープコピーで置換するのではない点に注意してください。<br> * 他のメソッドとおなじようにディープコピーで置換するために、copy(T)を使って引数を渡すことを推奨します。 <b>recommended pattern.</b> * * <pre> * // div and p is instance of Div, p tag object. * Div div = TagCreator.div(); * P p = TagCreator.p(); * p.getContent().add("foo"); * div.replaceInner(p.copy(P.class)); // *** using copy() * p.getContent().add("bar"); * System.out.println(mixer2Engine.saveToString(div)); * // you get <div><p>foo</p></div> * </pre> * * <b>anti pattern. use with caution.</b> * * <pre> * // divA and divB is instance of Div tag object. * Div div = TagCreator.div(); * P p = TagCreator.p(); * p.getContent().add("foo"); * div.replaceInner(p); // *** without copy() * p.getContent().add("bar"); * System.out.println(mixer2Engine.saveToString(div)); * // you get <div><p>foo bar</p></div> * </pre> * * @param replacement */ public <T extends AbstractJaxb> void replaceInner(T replacement) { ReplaceInnerUtil.replaceInner(this, replacement); }