- Direct Known Subclasses:
OutTag
- Author:
- AO Industries, Inc.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
doTag()
Deprecated.protected void
abstract MediaType
Gets the output type of this tag.protected void
invoke
(JspFragment body) Invokes the body.protected void
setMediaEncoderOptions
(MediaEncoder mediaEncoder) Sets the media encoder options.protected void
writeEncoderPrefix
(MediaEncoder mediaEncoder, Writer out) protected void
writeEncoderSuffix
(MediaEncoder mediaEncoder, Writer out, boolean trim) protected void
writePrefix
(MediaType containerType, Writer out) Writes any prefix in the container's media type.protected void
writeSuffix
(MediaType containerType, Writer out) Writes any suffix in the container's media type.Methods inherited from class javax.servlet.jsp.tagext.SimpleTagSupport
findAncestorWithClass, getJspBody, getJspContext, getParent, setJspBody, setJspContext, setParent
-
Constructor Details
-
EncodingNullTag
public EncodingNullTag()
-
-
Method Details
-
getOutputType
Gets the output type of this tag. This is used to determine the correct encoder. If the tag never has any output this should returnnull
. Whennull
is returned, any output will result in an error. -
doTag
Deprecated.You should probably be implementing indoTag(java.io.Writer)
- Specified by:
doTag
in interfaceSimpleTag
- Overrides:
doTag
in classSimpleTagSupport
- Throws:
JspException
IOException
- See Also:
-
invoke
Invokes the body. This is only called when a body exists. Subclasses may override this to perform actions before and/or after invoking the body. Any overriding implementation should callsuper.invoke(JspFragment)
to invoke the body, unless it wants to suppress the body invocation.The
RequestEncodingContext
has been set toRequestEncodingContext.DISCARD
because no validation of the content is necessary as the output is discarded. This means nested tags that attempt to produce valid output will not be limited by the parent encoding context of this tag.This implementation invokes
JspFragment.invoke(java.io.Writer)
while discarding all nested output.- Throws:
JspException
IOException
-
writePrefix
Writes any prefix in the container's media type. The output must be valid for the provided type. This will not be called when the output type is
null
.This default implementation prints nothing.
- Parameters:
out
- Validates all characters against the container media type. Already optimized viaCoercion.optimize(java.io.Writer, com.aoapps.lang.io.Encoder)
.- Throws:
JspException
IOException
- See Also:
-
setMediaEncoderOptions
Sets the media encoder options. This is how subclass tag attributes can effect the encoding. -
writeEncoderPrefix
protected void writeEncoderPrefix(MediaEncoder mediaEncoder, Writer out) throws JspException, IOException - Parameters:
out
- Validates all characters against the container media type. Already optimized viaCoercion.optimize(java.io.Writer, com.aoapps.lang.io.Encoder)
.- Throws:
JspException
IOException
-
doTag
Once the outJspWriter
has been replaced to output the proper content type, this version ofdoTag()
is called.The body, if present, has already been invoked with any output discarded.
This default implementation does nothing.
- Parameters:
out
- When the output type isnull
, will throw an exception if anything written, otherwise validates all characters against the output type. Already optimized viaCoercion.optimize(java.io.Writer, com.aoapps.lang.io.Encoder)
.- Throws:
JspException
IOException
-
writeEncoderSuffix
protected void writeEncoderSuffix(MediaEncoder mediaEncoder, Writer out, boolean trim) throws JspException, IOException - Parameters:
out
- Validates all characters against the container media type. Already optimized viaCoercion.optimize(java.io.Writer, com.aoapps.lang.io.Encoder)
.- Throws:
JspException
IOException
-
writeSuffix
Writes any suffix in the container's media type. The output must be valid for the provided type. This will not be called when the output type is
null
.This default implementation prints nothing.
- Parameters:
out
- Validates all characters against the container media type. Already optimized viaCoercion.optimize(java.io.Writer, com.aoapps.lang.io.Encoder)
.- Throws:
JspException
IOException
- See Also:
-
doTag(java.io.Writer)