|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.OutputStream
java.io.FilterOutputStream
wt.htmlutil.TemplateOutputStream
An output stream filter used when processing templates.
This filter grounds out flush calls so that frequent flushes to character writer objects do not cause a flush of the underlying output stream which might cause frequent calls to the operating system.
Since templates processing will often call methods that want to write text to the template
output stream, utility methods are provided here to efficiently reuse an existing print writer
and to chose a character encoding compatible with a template's locale. Unlike a standard
print writer which ignores IOException
, this one will raise a runtime exception
in order to abort template processing if there are exceptions writing to the underlying output
stream.
All templates for a given locale are expected to share the same character encoding. Since
they may differ for each locale and from the platform's default file encoding, property settings
of the form wt.template.encoding.xxx
where xxx is a locale can be used to override the
default character encoding.
Nested Class Summary | |
(package private) class |
TemplateOutputStream.KeepAlive
Deprecated. |
(package private) static class |
TemplateOutputStream.Writer
Deprecated. |
Field Summary | |
private String |
encoding
Deprecated. |
private Locale |
locale
Deprecated. |
private PrintWriter |
printWriter
Deprecated. |
Fields inherited from class java.io.FilterOutputStream |
out |
Constructor Summary | |
TemplateOutputStream(OutputStream out,
Locale locale)
Deprecated. |
Method Summary | |
void |
cancelKeepAlive()
Deprecated. |
void |
close()
Deprecated. |
void |
flush()
Deprecated. |
void |
flushAll()
Deprecated. |
static void |
flushAll(OutputStream output_stream)
Deprecated. |
static void |
flushAll(Properties parameters,
Locale locale,
OutputStream os)
Deprecated. Script callable method to flush all pending output to the response stream. |
String |
getEncoding()
Deprecated. |
static String |
getEncoding(Locale locale)
Deprecated. |
static String |
getEncoding(OutputStream output_stream,
Locale locale)
Deprecated. |
PrintWriter |
getPrintWriter()
Deprecated. |
static PrintWriter |
getPrintWriter(OutputStream output_stream,
Locale locale)
Deprecated. |
private OutputStream |
getProtectedOut()
Deprecated. |
void |
setEncoding(String encoding)
Deprecated. |
static void |
setKeepAlive(OutputStream output_stream,
String message,
int interval)
Deprecated. |
static void |
setKeepAlive(Properties parameters,
Locale locale,
OutputStream os)
Deprecated. Set a message to be periodically flushed to the template output stream until normal output is written. |
void |
setKeepAlive(String message,
int interval)
Deprecated. |
private void |
setProtectedOut(OutputStream out)
Deprecated. |
static void |
sleep(Properties parameters,
Locale locale,
OutputStream os)
Deprecated. |
void |
write(byte[] b,
int off,
int len)
Deprecated. |
Methods inherited from class java.io.FilterOutputStream |
write, write |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private PrintWriter printWriter
private Locale locale
private String encoding
Constructor Detail |
public TemplateOutputStream(OutputStream out, Locale locale)
Method Detail |
public void write(byte[] b, int off, int len) throws IOException
IOException
public void flush()
public void flushAll() throws IOException
IOException
public void close() throws IOException
IOException
public String getEncoding()
public void setEncoding(String encoding)
public PrintWriter getPrintWriter()
private OutputStream getProtectedOut()
private void setProtectedOut(OutputStream out)
public static void flushAll(OutputStream output_stream) throws IOException
IOException
public static void flushAll(Properties parameters, Locale locale, OutputStream os) throws IOException
parameters
- The arguments that were passed to the Windchill script call.locale
- The Locale to send to the invoked methods for localization.os
- The output stream.
IOException
public static String getEncoding(Locale locale)
public static PrintWriter getPrintWriter(OutputStream output_stream, Locale locale)
public static String getEncoding(OutputStream output_stream, Locale locale)
public static void setKeepAlive(Properties parameters, Locale locale, OutputStream os)
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD