|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object freemarker.template.SimpleScalar
public class SimpleScalar
A synchronized implementation of the TemplateScalarModel
interface, using a String
or a boolean
.
All the public methods in this implementation are synchronized.
SimpleNumber
,
SimpleList
,
SimpleHash
,
Serialized FormField Summary | |
---|---|
protected boolean |
booleanValue
The value of this SimpleScalar if it wraps a boolean . |
protected java.lang.String |
stringValue
The value of this SimpleScalar if it wraps a String . |
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 | |
---|---|
boolean |
equals(java.lang.Object o)
Tests this object for equality with the given object. |
java.lang.String |
getAsString()
Returns the scalar's value as a String . |
int |
hashCode()
Return the hash value for this object. |
boolean |
isEmpty()
Is this SimpleScalar empty? |
void |
setValue(boolean value)
Sets the boolean value of this SimpleScalar. |
void |
setValue(java.lang.String value)
Sets the String value of this SimpleScalar . |
java.lang.String |
toString()
Retrieve the String value of this object. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.lang.String stringValue
SimpleScalar
if it wraps a String
.
protected boolean booleanValue
SimpleScalar
if it wraps a boolean
.
Constructor Detail |
---|
public SimpleScalar()
SimpleScalar
.
public SimpleScalar(java.lang.String value)
SimpleScalar
containing a string value.
value
- the string value.public SimpleScalar(boolean value)
SimpleScalar
containing a boolean value.
value
- the boolean value.Method Detail |
---|
public boolean isEmpty() throws TemplateModelException
SimpleScalar
empty?
isEmpty
in interface TemplateModel
true
if this object is empty, otherwise false
TemplateModelException
public java.lang.String getAsString() throws TemplateModelException
String
.
getAsString
in interface TemplateScalarModel
String
value of this scalar.
TemplateModelException
public void setValue(java.lang.String value)
String
value of this SimpleScalar
.
value
- the String
value.public void setValue(boolean value)
boolean
value of this SimpleScalar.
value
- the public java.lang.String toString()
String
value of this object.
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- the object to be compared against
true
if the object is equal, otherwise
false
public int hashCode()
hashCode
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |