@Override public void release() { super.release(); this.value = null; this.valueSet = false; }
/** * The user customised the output of the error messages - flush the * buffered content into the main {@link javax.servlet.jsp.JspWriter}. */ protected void flushBufferedBodyContent(BodyContent bodyContent) throws JspException { try { bodyContent.writeOut(bodyContent.getEnclosingWriter()); } catch (IOException ex) { throw new JspException("Unable to write buffered body content.", ex); } }
/** * Read the unescaped body content from the page. * @return the original content * @throws IOException if reading failed */ protected String readBodyContent() throws IOException { Assert.state(this.bodyContent != null, "No BodyContent set"); return this.bodyContent.getString(); }
/** * Release state. * * @see Tag#release */ public void release() { bodyContent = null; super.release(); }
/** * The value of the tag's id attribute. * * @return the value of the tag's id attribute, or null if no such * attribute was specified. */ public String getId() { return getAttributeString(TagAttributeInfo.ID); }
/** * Information on the scripting objects created by this tag at runtime. * This is a convenience method on the associated TagExtraInfo class. * * @param data TagData describing this action. * @return if a TagExtraInfo object is associated with this TagInfo, the * result of getTagExtraInfo().getVariableInfo( data ), otherwise * null. */ public VariableInfo[] getVariableInfo(TagData data) { VariableInfo[] result = null; TagExtraInfo tei = getTagExtraInfo(); if (tei != null) { result = tei.getVariableInfo( data ); } return result; }
/** * Get surrounding out JspWriter. * * @return the enclosing JspWriter, from the bodyContent. */ public JspWriter getPreviousOut() { return bodyContent.getEnclosingWriter(); }
/** * Translation-time validation of the attributes. * This is a convenience method on the associated TagExtraInfo class. * * @param data The translation-time TagData instance. * @return Whether the data is valid. */ public boolean isValid(TagData data) { TagExtraInfo tei = getTagExtraInfo(); if (tei == null) { return true; } return tei.isValid(data); }
/** * Translation-time validation of the attributes. * This is a convenience method on the associated TagExtraInfo class. * * @param data The translation-time TagData instance. * @return A null object, or zero length array if no errors, an * array of ValidationMessages otherwise. * @since JSP 2.0 */ public ValidationMessage[] validate( TagData data ) { TagExtraInfo tei = getTagExtraInfo(); if( tei == null ) { return null; } return tei.validate( data ); }
/** * Default processing of the end tag returning EVAL_PAGE. * * @return EVAL_PAGE * @throws JspException if an error occurred while processing this tag * @see Tag#doEndTag */ public int doEndTag() throws JspException { return super.doEndTag(); }
public void onError(Throwable t) throws Throwable { if (isTryCatchFinally) { ((TryCatchFinally) tag).doCatch(t); } else { throw t; } }
@Test(expected = IllegalArgumentException.class) public void hasAncestorOfTypeWhereAncestorTagIsNotATagType() throws Exception { assertFalse(TagUtils.hasAncestorOfType(new TagSupport(), String.class)); }
@Override protected void renderFromBodyContent(BodyContent bodyContent, TagWriter tagWriter) throws JspException { Object value = this.pageContext.getAttribute(VALUE_VARIABLE_NAME); String label = bodyContent.getString(); renderOption(value, label, tagWriter); }
/** * The user customised the output of the error messages - flush the * buffered content into the main {@link javax.servlet.jsp.JspWriter}. */ protected void flushBufferedBodyContent(BodyContent bodyContent) throws JspException { try { bodyContent.writeOut(bodyContent.getEnclosingWriter()); } catch (IOException ex) { throw new JspException("Unable to write buffered body content.", ex); } }
@Override public void release() { super.release(); this.name = ""; this.value = null; this.valueSet = false; }
/** * Write the escaped body content to the page. * <p>Can be overridden in subclasses, e.g. for testing purposes. * @param content the content to write * @throws IOException if writing failed */ protected void writeBodyContent(String content) throws IOException { Assert.state(this.bodyContent != null, "No BodyContent set"); this.bodyContent.getEnclosingWriter().print(content); }
@Test(expected = IllegalArgumentException.class) public void hasAncestorOfTypeWithNullAncestorTagClassArgument() throws Exception { assertFalse(TagUtils.hasAncestorOfType(new TagSupport(), null)); }
@Override public void release() { super.release(); this.value = null; this.valueSet = false; }
@Override public void release() { super.release(); this.name = ""; this.value = null; this.valueSet = false; }