TemplateModel
, TemplateScalarModel
, java.io.Serializable
public final class SimpleScalar extends java.lang.Object implements TemplateScalarModel, java.io.Serializable
This class is thread-safe.
SimpleSequence
,
SimpleHash
,
Serialized FormNOTHING
EMPTY_STRING
Constructor | Description |
---|---|
SimpleScalar(java.lang.String value) |
Constructs a SimpleScalar containing a string value.
|
Modifier and Type | Method | Description |
---|---|---|
java.lang.String |
getAsString() |
Returns the string representation of this model.
|
static SimpleScalar |
newInstanceOrNull(java.lang.String s) |
Same as calling the constructor, except that for a
null parameter it returns null. |
java.lang.String |
toString() |
public SimpleScalar(java.lang.String value)
value
- the string value. If this is null
, its value in FTL will be ""
.public java.lang.String getAsString()
TemplateScalarModel
null
, as that will cause exception.
(In classic-compatible mode the engine will convert null
into empty string, though.)getAsString
in interface TemplateScalarModel
public java.lang.String toString()
toString
in class java.lang.Object
public static SimpleScalar newInstanceOrNull(java.lang.String s)
null
parameter it returns null.