/** * Close the current opening tag (if necessary) and appends the * supplied value as inner text. * @throws IllegalStateException if no tag is open */ public void appendValue(String value) throws JspException { if (!inTag()) { throw new IllegalStateException("Cannot write tag value. No open tag available."); } closeTagAndMarkAsBlock(); this.writer.append(value); }
/** * Close the current opening tag (if necessary) and appends the * supplied value as inner text. * @throws IllegalStateException if no tag is open */ public void appendValue(String value) throws JspException { if (!inTag()) { throw new IllegalStateException("Cannot write tag value. No open tag available."); } closeTagAndMarkAsBlock(); this.writer.append(value); }
/** * Start a new tag with the supplied name. Leaves the tag open so * that attributes, inner text or nested tags can be written into it. * @see #endTag() */ public void startTag(String tagName) throws JspException { if (inTag()) { closeTagAndMarkAsBlock(); } push(tagName); this.writer.append("<").append(tagName); }
/** * Start a new tag with the supplied name. Leaves the tag open so * that attributes, inner text or nested tags can be written into it. * @see #endTag() */ public void startTag(String tagName) throws JspException { if (inTag()) { closeTagAndMarkAsBlock(); } push(tagName); this.writer.append("<").append(tagName); }
/** * Close the current tag, allowing to enforce a full closing tag. * <p>Correctly writes an empty tag if no inner text or nested tags * have been written. * @param enforceClosingTag whether a full closing tag should be * rendered in any case, even in case of a non-block tag */ public void endTag(boolean enforceClosingTag) throws JspException { if (!inTag()) { throw new IllegalStateException("Cannot write end of tag. No open tag available."); } boolean renderClosingTag = true; if (!currentState().isBlockTag()) { // Opening tag still needs to be closed... if (enforceClosingTag) { this.writer.append(">"); } else { this.writer.append("/>"); renderClosingTag = false; } } if (renderClosingTag) { this.writer.append("</").append(currentState().getTagName()).append(">"); } this.tagState.pop(); }
/** * Close the current tag, allowing to enforce a full closing tag. * <p>Correctly writes an empty tag if no inner text or nested tags * have been written. * @param enforceClosingTag whether a full closing tag should be * rendered in any case, even in case of a non-block tag */ public void endTag(boolean enforceClosingTag) throws JspException { if (!inTag()) { throw new IllegalStateException("Cannot write end of tag. No open tag available."); } boolean renderClosingTag = true; if (!currentState().isBlockTag()) { // Opening tag still needs to be closed... if (enforceClosingTag) { this.writer.append(">"); } else { this.writer.append("/>"); renderClosingTag = false; } } if (renderClosingTag) { this.writer.append("</").append(currentState().getTagName()).append(">"); } this.tagState.pop(); }
/** * Close the current opening tag (if necessary) and appends the * supplied value as inner text. * @throws IllegalStateException if no tag is open */ public void appendValue(String value) throws JspException { if (!inTag()) { throw new IllegalStateException("Cannot write tag value. No open tag available."); } closeTagAndMarkAsBlock(); this.writer.append(value); }
/** * Start a new tag with the supplied name. Leaves the tag open so * that attributes, inner text or nested tags can be written into it. * @see #endTag() */ public void startTag(String tagName) throws JspException { if (inTag()) { closeTagAndMarkAsBlock(); } push(tagName); this.writer.append("<").append(tagName); }
/** * Close the current tag, allowing to enforce a full closing tag. * <p>Correctly writes an empty tag if no inner text or nested tags * have been written. * @param enforceClosingTag whether a full closing tag should be * rendered in any case, even in case of a non-block tag */ public void endTag(boolean enforceClosingTag) throws JspException { if (!inTag()) { throw new IllegalStateException("Cannot write end of tag. No open tag available."); } boolean renderClosingTag = true; if (!currentState().isBlockTag()) { // Opening tag still needs to be closed... if (enforceClosingTag) { this.writer.append(">"); } else { this.writer.append("/>"); renderClosingTag = false; } } if (renderClosingTag) { this.writer.append("</").append(currentState().getTagName()).append(">"); } this.tagState.pop(); }