public class BaseHelper extends java.lang.Object implements CompatibilityHelper
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<java.lang.String,java.lang.String> |
entities
Replacement mappings for removing HTML entities.
|
protected Options |
opts
Configuration to be honored.
|
protected java.util.Map<java.lang.String,java.lang.String> |
unsafe
Replacement mappings for escaping unsafe HTML characters.
|
NEWLINE| Constructor and Description |
|---|
BaseHelper() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
closeComment(boolean expr)
Return the text used to end a comment that removes the start or end tag
for a statement or expression escape.
|
java.lang.String |
closeContentTypeComment()
Return the text used to end a comment that removes the META or
WSMETA element with an HTTP-EQUIV attribute that is set to
CONTENT-TYPE.
|
java.lang.String |
closeExprEscape()
Return the text used to end the output of an embedded 4GL expression.
|
java.lang.String |
closeHTML(boolean content)
Return the text used to end a line of raw HTML output.
|
java.lang.String |
entityConvert(java.lang.String e4gl)
Convert any HTML entities (in the given E4GL text) into the equivalent
characters.
|
java.lang.String |
escapeHTML(java.lang.String html)
Convert any unsafe characters (in the given HTML text) into equivalents
that are safe to embed in a 4GL string literal and return that converted
text.
|
java.lang.String |
footer()
Return the text for the footer of the generated file.
|
java.lang.String |
header()
Return the text for the header of the generated file.
|
void |
initialize(Options opts)
Provides the known configuration to the helper and allows it to
prepare for use.
|
java.lang.String |
openComment(boolean expr)
Return the text used to start a comment that removes the start or end
tag for a statement or expression escape.
|
java.lang.String |
openContentTypeComment()
Return the text used to start a comment that removes the META or
WSMETA element with an HTTP-EQUIV attribute that is set to
CONTENT-TYPE.
|
java.lang.String |
openExprEscape()
Return the text used to start the output of an embedded 4GL expression.
|
java.lang.String |
openHTML(boolean content)
Return the text used to start a line of raw HTML output.
|
protected java.lang.String |
replace(java.util.Map<java.lang.String,java.lang.String> replace,
java.lang.String txt)
Use the mapped keys to convert any matching characters (in the given
text) into the equivalent mapped value.
|
java.lang.String |
suffix()
Return the filename suffix (extension) to be used.
|
protected Options opts
protected java.util.Map<java.lang.String,java.lang.String> unsafe
protected java.util.Map<java.lang.String,java.lang.String> entities
public void initialize(Options opts)
initialize in interface CompatibilityHelperopts - The configuration.public java.lang.String suffix()
suffix in interface CompatibilityHelperpublic java.lang.String header()
header in interface CompatibilityHelperpublic java.lang.String openHTML(boolean content)
openHTML in interface CompatibilityHelpercontent - true if there is HTML content that is about to
be emitted on the line, false to handle the
no content case (just start the line, without any
content prefix text).public java.lang.String closeHTML(boolean content)
closeHTML in interface CompatibilityHelpercontent - true if there is content that needs to be
finished on the line, false to handle the
no content case (just terminate the line, without any
content termination text).public java.lang.String escapeHTML(java.lang.String html)
escapeHTML in interface CompatibilityHelperpublic java.lang.String entityConvert(java.lang.String e4gl)
entityConvert in interface CompatibilityHelperpublic java.lang.String openExprEscape()
openExprEscape in interface CompatibilityHelperpublic java.lang.String closeExprEscape()
closeExprEscape in interface CompatibilityHelperpublic java.lang.String openComment(boolean expr)
openComment in interface CompatibilityHelperexpr - true if this is an expression escape,
false for a statement escape.null
if the escape should be removed instead of commented.public java.lang.String closeComment(boolean expr)
closeComment in interface CompatibilityHelperexpr - true if this is an expression escape,
false for a statement escape.null
if the escape should be removed instead of commented.public java.lang.String openContentTypeComment()
openContentTypeComment in interface CompatibilityHelperpublic java.lang.String closeContentTypeComment()
closeContentTypeComment in interface CompatibilityHelperpublic java.lang.String footer()
footer in interface CompatibilityHelperprotected java.lang.String replace(java.util.Map<java.lang.String,java.lang.String> replace,
java.lang.String txt)