public class Options extends java.lang.Object implements E4GLConstants
These options can be manipulated and set externally as well.
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
contentType
Encoded content type found in meta element.
|
private CompatibilityHelper |
hlp
Helper to emit text that exactly matches a given implementation.
|
private boolean |
include
Flag controlling whether this emits as a procedure or include file.
|
private java.lang.String |
input
Input HTML filename.
|
private boolean |
keepContentType
Content-Type meta element is left alone (not commented out).
|
private int |
mode
Compatibility mode (see
E4GLConstants ). |
private java.lang.String |
opsys
Operating system name for which preprocessing must account.
|
private java.lang.String |
output
Output HTML filename.
|
private java.util.Set<java.lang.String> |
wsoptions
Encoded wsoptions found in meta element.
|
BLUE_DIAMOND, DEFAULT_MODE, MODE_NAMES, OPT_FOUND, OPT_INCLUDE, OPT_KEEP, OPT_WEB_OBJ, UNKNOWN_MODE, WEBSPEED, WEBSPEED_STRICT
Constructor and Description |
---|
Options()
Create an instance that processes options with
WEBSPEED
compatibility. |
Options(int mode)
Create an instance that processes options with the specified
compatibility.
|
Modifier and Type | Method and Description |
---|---|
CompatibilityHelper |
getCompatibilityHelper()
Obtain the current compatibility helper instance based on the mode
that was specified.
|
java.lang.String |
getContentType()
Access the
content-type string. |
java.lang.String |
getInput()
Access the specified input filename.
|
int |
getMode()
Access the compatibility mode (see
E4GLConstants ). |
java.lang.String |
getOpsys()
Gets the operating system name which must be used to determine how
escape characters are treated.
|
java.lang.String |
getOutput()
Access the output filename.
|
java.lang.String |
getWSOptions()
Access the
wsoptions string. |
boolean |
isInclude()
Determine if the generated 4GL code should be an include file or a
procedure file ("web-object").
|
boolean |
isKeepContentType()
Determine if the generated 4GL code should have the content-type meta
element left behind.
|
void |
processWSOptions(java.lang.String options,
boolean html)
Parse the options string (as found in a meta element) and set the flags
and state variables as needed based on the options specified.
|
void |
setContentType(java.lang.String contentType)
Set the
content-type string. |
void |
setInclude(boolean include)
Set the flag for whether the generated 4GL code should be an include
file or a procedure file ("web-object").
|
void |
setInput(java.lang.String input)
Set the specified input filename.
|
void |
setKeepContentType(boolean keepContentType)
Set the flag for whether the generated 4GL code should have the
content-type meta element left behind.
|
void |
setMode(int mode)
Set the compatibility mode (see
E4GLConstants ). |
void |
setOpsys(java.lang.String opsys)
Sets the operating system name which must be used to determine how
escape characters are treated.
|
void |
setOutput(java.lang.String output)
Set the specified output filename.
|
java.lang.String |
toString()
Create a text representation of the state of this instance.
|
private int mode
E4GLConstants
).private boolean include
private boolean keepContentType
private java.lang.String contentType
private java.util.Set<java.lang.String> wsoptions
private java.lang.String input
private java.lang.String output
private java.lang.String opsys
private CompatibilityHelper hlp
public Options()
WEBSPEED
compatibility.public Options(int mode)
mode
- Compatibility mode (see E4GLConstants
).public int getMode()
E4GLConstants
).public void setMode(int mode)
E4GLConstants
). If this mode
is different from the previously set value, the compatibility helper
reference is set to null
. Any following call to
getCompatibilityHelper()
will subsequently return a new instance
that matches the new mode.mode
- The compatibility mode for this HTML file.public java.lang.String getInput()
public void setInput(java.lang.String input)
input
- A filename.public java.lang.String getOutput()
public void setOutput(java.lang.String output)
output
- A filename.public java.lang.String getOpsys()
public void setOpsys(java.lang.String opsys)
opsys
- The new operating system name.public void processWSOptions(java.lang.String options, boolean html)
Since this code safely merges options with any that were previously stored, this is suitable for handling multiple meta elements in the same file (and additionally, any number of manual calls to add options).
This can be used to manually add a list of options (as opposed to reading these options from the meta element of an HTML file).
Processing is always additive. There is no way to delete options once set.
options
- A comma-separated list of options.html
- true
if wsoptions
was read from an
HTML file meta element. In that case, the "wsoptions-found"
will be appended to the options string if it is not already
present in the options.public java.lang.String getWSOptions()
wsoptions
string.
Try to call this only once (or at least infrequently) since it dynamically builds the options string off an internal collection of options. This is much more expensive than just returning a string member.
public java.lang.String getContentType()
content-type
string.public void setContentType(java.lang.String contentType)
content-type
string.contentType
- The content-type for this HTML file.public boolean isInclude()
true
if this is an include file.public void setInclude(boolean include)
include
- true
if this is an include file.public boolean isKeepContentType()
true
if the content-type meta element is to be
left uncommented in the generated code.public void setKeepContentType(boolean keepContentType)
keepContentType
- true
if the content-type meta element is to be
left uncommented in the generated code.public CompatibilityHelper getCompatibilityHelper()
setMode(int)
.public java.lang.String toString()
toString
in class java.lang.Object