|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object freemarker.ext.beans2.StaticClassWrapper<T>
public class StaticClassWrapper<T>
Wrapper for static or uninstantiated classes. Provides access to static fields and methods of a given class.
Field Summary | |
---|---|
protected java.lang.Class<T> |
clazz
The class being wrapped by this wrapper |
Constructor Summary | |
---|---|
StaticClassWrapper()
Default constructor where a class is not provided initially. |
|
StaticClassWrapper(java.lang.Class<T> clazz)
Constructor that takes a class to be wrapped. |
Method Summary | |
---|---|
TemplateModel |
get(java.lang.String key)
Gets a TemplateModel from the hash. |
java.lang.String |
getAsString()
Returns the class's name as a String . |
boolean |
isEmpty()
Is the object empty? |
void |
put(java.lang.String key,
TemplateModel model)
Sets a value in the hash model. |
void |
setClazz(java.lang.Class<T> clazz)
Sets the class to be wrapped by this class wrapper. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.Class<T> clazz
Constructor Detail |
---|
public StaticClassWrapper()
public StaticClassWrapper(java.lang.Class<T> clazz)
clazz
- the class to be wrappedMethod Detail |
---|
public void setClazz(java.lang.Class<T> clazz)
clazz
- the class to be wrappedpublic boolean isEmpty() throws TemplateModelException
isEmpty
in interface TemplateModel
true
if this object is empty, otherwise false
TemplateModelException
public TemplateModel get(java.lang.String key) throws TemplateModelException
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.String getAsString() throws TemplateModelException
String
.
getAsString
in interface TemplateScalarModel
String
representation of this class.
TemplateModelException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |