Package org.thymeleaf.engine
Class ThrottledTemplateWriter
- java.lang.Object
-
- java.io.Writer
-
- org.thymeleaf.engine.ThrottledTemplateWriter
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.Appendable,java.lang.AutoCloseable,IThrottledTemplateWriterControl
- Direct Known Subclasses:
SSEThrottledTemplateWriter
class ThrottledTemplateWriter extends java.io.Writer implements IThrottledTemplateWriterControl
- Since:
- 3.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static interfaceThrottledTemplateWriter.IThrottledTemplateWriterAdapter
-
Field Summary
Fields Modifier and Type Field Description private ThrottledTemplateWriter.IThrottledTemplateWriterAdapteradapterprivate TemplateFlowControllerflowControllerprivate booleanflushableprivate java.lang.StringtemplateNameprivate java.io.Writerwriter
-
Constructor Summary
Constructors Constructor Description ThrottledTemplateWriter(java.lang.String templateName, TemplateFlowController flowController)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidallow(int limit)voidclose()voidflush()intgetMaxOverflowSize()intgetOverflowGrowCount()intgetWrittenCount()booleanisOverflown()booleanisStopped()(package private) voidsetOutput(java.io.OutputStream outputStream, java.nio.charset.Charset charset, int maxOutputInBytes)(package private) voidsetOutput(java.io.Writer writer)voidwrite(char[] cbuf)voidwrite(char[] cbuf, int off, int len)voidwrite(int c)voidwrite(java.lang.String str)voidwrite(java.lang.String str, int off, int len)
-
-
-
Field Detail
-
templateName
private final java.lang.String templateName
-
flowController
private final TemplateFlowController flowController
-
adapter
private ThrottledTemplateWriter.IThrottledTemplateWriterAdapter adapter
-
writer
private java.io.Writer writer
-
flushable
private boolean flushable
-
-
Constructor Detail
-
ThrottledTemplateWriter
ThrottledTemplateWriter(java.lang.String templateName, TemplateFlowController flowController)
-
-
Method Detail
-
setOutput
void setOutput(java.io.Writer writer)
-
setOutput
void setOutput(java.io.OutputStream outputStream, java.nio.charset.Charset charset, int maxOutputInBytes)
-
isOverflown
public boolean isOverflown() throws java.io.IOException- Specified by:
isOverflownin interfaceIThrottledTemplateWriterControl- Throws:
java.io.IOException
-
isStopped
public boolean isStopped() throws java.io.IOException- Specified by:
isStoppedin interfaceIThrottledTemplateWriterControl- Throws:
java.io.IOException
-
getWrittenCount
public int getWrittenCount()
- Specified by:
getWrittenCountin interfaceIThrottledTemplateWriterControl
-
getMaxOverflowSize
public int getMaxOverflowSize()
- Specified by:
getMaxOverflowSizein interfaceIThrottledTemplateWriterControl
-
getOverflowGrowCount
public int getOverflowGrowCount()
- Specified by:
getOverflowGrowCountin interfaceIThrottledTemplateWriterControl
-
allow
void allow(int limit)
-
write
public void write(int c) throws java.io.IOException- Overrides:
writein classjava.io.Writer- Throws:
java.io.IOException
-
write
public void write(java.lang.String str) throws java.io.IOException- Overrides:
writein classjava.io.Writer- Throws:
java.io.IOException
-
write
public void write(java.lang.String str, int off, int len) throws java.io.IOException- Overrides:
writein classjava.io.Writer- Throws:
java.io.IOException
-
write
public void write(char[] cbuf) throws java.io.IOException- Overrides:
writein classjava.io.Writer- Throws:
java.io.IOException
-
write
public void write(char[] cbuf, int off, int len) throws java.io.IOException- Specified by:
writein classjava.io.Writer- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOException- Specified by:
flushin interfacejava.io.Flushable- Specified by:
flushin classjava.io.Writer- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein classjava.io.Writer- Throws:
java.io.IOException
-
-