freemarker.template
Class SimpleScalar
java.lang.Object
|
+--freemarker.template.SimpleScalar
- public class SimpleScalar
- extends java.lang.Object
- implements TemplateScalarModel, java.io.Serializable
A simple implementation of the TemplateScalarModel
interface, using a String.
All the public methods in this implementation are synchronized.
- See Also:
- Serialized Form
Field Summary |
protected java.lang.String |
value
|
Constructor Summary |
SimpleScalar()
Constructs an empty SimpleScalar. |
SimpleScalar(boolean value)
Constructs a SimpleScalar containing a boolean value. |
SimpleScalar(java.lang.String value)
Constructs a SimpleScalar containing a string value. |
Method Summary |
java.lang.String |
getAsString()
|
boolean |
isEmpty()
|
void |
setValue(boolean value)
Sets the boolean value of this SimpleScalar. |
void |
setValue(java.lang.String value)
Sets the string value of this SimpleScalar. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
value
protected java.lang.String value
SimpleScalar
public SimpleScalar()
- Constructs an empty SimpleScalar.
SimpleScalar
public SimpleScalar(java.lang.String value)
- Constructs a SimpleScalar containing a string value.
- Parameters:
value
- the string value.
SimpleScalar
public SimpleScalar(boolean value)
- Constructs a SimpleScalar containing a boolean value.
- Parameters:
value
- the boolean value.
isEmpty
public boolean isEmpty()
throws TemplateModelException
getAsString
public java.lang.String getAsString()
throws TemplateModelException
- Specified by:
- getAsString in interface TemplateScalarModel
setValue
public void setValue(java.lang.String value)
- Sets the string value of this SimpleScalar.
- Parameters:
value
- the string value.
setValue
public void setValue(boolean value)
- Sets the boolean value of this SimpleScalar.
- Parameters:
value
- the boolean value.