freemarker.ext.beans
Class StaticModel

java.lang.Object
  extended by freemarker.ext.beans.StaticModel
All Implemented Interfaces:
TemplateHashModel, TemplateModel

Deprecated. this class is deprecated in favour of the classes in the freemarker.ext.beans2 package

public final class StaticModel
extends java.lang.Object
implements TemplateHashModel

Wraps the static fields and methods of a class in a TemplateHashModel. Fields are wrapped using BeansWrapper.wrap(Object), and methods are wrapped into MethodModel instances. Unfortunately, there is currently no support for bean property-style calls of static methods, as in ObjectModel.

Version:
$Id: StaticModel.java 1101 2013-04-01 04:17:32Z run2000 $
Author:
Attila Szegedi, attila@szegedi.org

Method Summary
static StaticModel create(java.lang.Class clazz)
          Deprecated. Creates a model representing the static fields and methods of the passed class.
 TemplateModel get(java.lang.String key)
          Deprecated. Returns the field or method named by the key parameter.
 boolean isEmpty()
          Deprecated. Returns true if there is at least one public static field or method in the underlying class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static final StaticModel create(java.lang.Class clazz)
Deprecated. 
Creates a model representing the static fields and methods of the passed class. Models are cached, meaning that calling create twice with a same class parameter will yield the same object.


get

public TemplateModel get(java.lang.String key)
                  throws TemplateModelException
Deprecated. 
Returns the field or method named by the key parameter.

Specified by:
get in interface TemplateHashModel
Parameters:
key - the name by which the TemplateModel is identified in the template.
Returns:
the TemplateModel referred to by the key, or null if not found.
Throws:
TemplateModelException - there was a problem getting the value for the given key

isEmpty

public boolean isEmpty()
Deprecated. 
Returns true if there is at least one public static field or method in the underlying class.

Specified by:
isEmpty in interface TemplateModel
Returns:
true if this object is empty, otherwise false