|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfreemarker.ext.beans2.BeanWrapper<T>
public class BeanWrapper<T>
Field Summary | |
---|---|
protected static java.lang.Object[] |
emptyParams
|
protected T |
object
|
Constructor Summary | |
---|---|
BeanWrapper()
|
|
BeanWrapper(T object)
|
Method Summary | |
---|---|
java.lang.Object |
clone()
Creates and returns a copy of this object. |
TemplateModel |
get(java.lang.String key)
Gets a TemplateModel from the hash. |
java.lang.Object |
getAsObject()
Return the underlying object to the reflection mechanism. |
java.lang.String |
getAsString()
Returns the bean's value as a String using the object's
toString method. |
boolean |
isEmpty()
Is the object empty? |
void |
put(java.lang.String key,
TemplateModel model)
Sets a value in the hash model. |
void |
setObject(java.lang.Object object)
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected T object
protected static final java.lang.Object[] emptyParams
Constructor Detail |
---|
public BeanWrapper()
public BeanWrapper(T object)
Method Detail |
---|
public void setObject(java.lang.Object object)
setObject
in interface ObjectWrapper
public boolean isEmpty() throws TemplateModelException
TemplateModel
isEmpty
in interface TemplateModel
true
if this object is empty, otherwise false
TemplateModelException
public TemplateModel get(java.lang.String key) throws TemplateModelException
TemplateHashModel
TemplateModel
from the hash.
get
in interface TemplateHashModel
key
- the name by which the TemplateModel
is identified in the template.
TemplateModel
referred to by the key,
or null
if not found.
TemplateModelException
- there was a problem getting the value
for the given keypublic void put(java.lang.String key, TemplateModel model) throws TemplateModelException
put
in interface TemplateWriteableHashModel
key
- the hash keymodel
- the value to be added to the hash model
TemplateModelException
- there was a problem setting the value
for the given keypublic java.lang.Object getAsObject() throws TemplateModelException
getAsObject
in interface TemplateObjectModel
TemplateModelException
- the object could not be returnedpublic java.lang.String getAsString() throws TemplateModelException
String
using the object's
toString method.
getAsString
in interface TemplateScalarModel
String
value of this object.
TemplateModelException
public 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 |