|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectfreemarker.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 Form| Field 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 TemplateModeltrue if this object is empty, otherwise false
TemplateModelException
public java.lang.String getAsString()
throws TemplateModelException
String.
getAsString in interface TemplateScalarModelString value of this scalar.
TemplateModelExceptionpublic 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.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objecto - the object to be compared against
true if the object is equal, otherwise
falsepublic int hashCode()
hashCode in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||