fc.util.pagetemplate
Class TemplatePage
java.lang.Object
fc.util.pagetemplate.TemplatePage
public abstract class TemplatePage
- extends java.lang.Object
A superclass for generated template pages. All templates derive from this class. Runs
outside the web environment (intended to be invoked from the command line)
Pages are always assumed to be written in UTF-8 (a superset of regular
ascii/IS0-8859-1). If the template page is sent as HTML to a device (via some outside
mechanism that uses the templates as part of its workflow), then the HTML contained in
the page template should set the appropriate content type/encoding meta header to say
UTF-8, if UTF-8 characters (such as emojis) are used in the page.
See TemplateMgr
Method Summary |
void |
bug(java.io.Writer writer,
java.lang.Object str1)
Prints a debug statement if debugging is turned on for this page. |
void |
bug(java.io.Writer writer,
java.lang.Object str1,
java.lang.Object... args)
|
void |
dbg(boolean val)
|
java.lang.String |
getSourcePath()
|
void |
render(java.io.File out)
|
void |
render(java.io.OutputStream out)
|
abstract void |
render(java.io.PrintWriter out)
|
void |
render(java.io.Writer out)
|
void |
setConnection(java.sql.Connection con)
|
void |
setContext(java.util.Map m)
|
void |
setSourcePath(java.io.File templateFile)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PACKAGE_NAME
public static java.lang.String PACKAGE_NAME
DEFAULT_ENCODING
public static java.lang.String DEFAULT_ENCODING
log
public Log log
out
public java.io.Writer out
templateFile
public java.io.File templateFile
con
public java.sql.Connection con
context
public java.util.Map context
TemplatePage
public TemplatePage()
setSourcePath
public void setSourcePath(java.io.File templateFile)
getSourcePath
public java.lang.String getSourcePath()
setConnection
public void setConnection(java.sql.Connection con)
setContext
public void setContext(java.util.Map m)
render
public void render(java.io.Writer out)
throws java.lang.Exception
- Throws:
java.lang.Exception
render
public void render(java.io.File out)
throws java.lang.Exception
- Throws:
java.lang.Exception
render
public void render(java.io.OutputStream out)
throws java.lang.Exception
- Throws:
java.lang.Exception
render
public abstract void render(java.io.PrintWriter out)
throws java.lang.Exception
- Throws:
java.lang.Exception
dbg
public final void dbg(boolean val)
bug
public final void bug(java.io.Writer writer,
java.lang.Object str1)
throws java.io.IOException
- Prints a debug statement if debugging is turned on for this page.
Typically the implicit page printwriter (the out
variable) will be passed to this method and debug statements will be
printed at the point where they are lexically invoked at the page.
- Throws:
java.io.IOException
bug
public final void bug(java.io.Writer writer,
java.lang.Object str1,
java.lang.Object... args)
throws java.io.IOException
- Throws:
java.io.IOException