|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object freemarker.ext.beans2.NumberWrapper
public class NumberWrapper
Wraps a Number object as a number model. Does not provide any additional Bean methods.
Constructor Summary | |
---|---|
NumberWrapper()
Default constructor where an object is not provided initially. |
|
NumberWrapper(java.lang.Number object)
Constructor that takes a Number object to be wrapped. |
Method Summary | |
---|---|
java.lang.Object |
clone()
Creates and returns a copy of this object. |
long |
getAsNumber()
Returns the number's value as a long . |
java.lang.Object |
getAsObject()
Return the underlying object to the reflection mechanism in the freemarker.ext.beans2 package. |
java.lang.String |
getAsString()
Returns the scalar's value as a String . |
boolean |
isEmpty()
Is the object empty? |
void |
setObject(java.lang.Object object)
Sets the object to be wrapped by this object wrapper. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NumberWrapper()
public NumberWrapper(java.lang.Number object)
object
- the number object to be wrappedMethod Detail |
---|
public void setObject(java.lang.Object object)
ObjectWrapper
setObject
in interface ObjectWrapper
object
- the object to be wrappedpublic boolean isEmpty() throws TemplateModelException
TemplateModel
isEmpty
in interface TemplateModel
true
if this object is empty, otherwise false
TemplateModelException
public java.lang.String getAsString() throws TemplateModelException
TemplateScalarModel
String
.
getAsString
in interface TemplateScalarModel
String
value of this scalar.
TemplateModelException
public long getAsNumber() throws TemplateModelException
TemplateNumberModel
long
.
getAsNumber
in interface TemplateNumberModel
long
value of this scalar.
TemplateModelException
public java.lang.Object getAsObject() throws TemplateModelException
TemplateObjectModel
freemarker.ext.beans2
package. Any variables, methods
or properties can be called directly via reflection.
getAsObject
in interface TemplateObjectModel
TemplateModelException
- the object could not be returnedpublic java.lang.Object clone()
clone
in interface ObjectWrapper
clone
in class java.lang.Object
java.lang.RuntimeException
- the clone operation was not successful
java.lang.OutOfMemoryError
- if there is not enough memory.Cloneable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |