NIHVIVO-1564 In dump of template model objects, hide methods that take arguments unless the BeansWrapper exposure level exposes these methods to the template.

This commit is contained in:
rjy7 2011-02-22 23:09:01 +00:00
parent 97e6630eb7
commit af7d959ecd
5 changed files with 69 additions and 37 deletions

View file

@ -0,0 +1,20 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
package freemarker.ext.beans;
import freemarker.template.TemplateModel;
/**
* Class to extract information about the wrapper used to wrap an object in
* the template model.
*/
public class WrapperExtractor {
public static BeansWrapper getWrapper(BeanModel model) {
return model.wrapper;
}
public static int getWrapperExposureLevel(BeanModel model) {
return model.wrapper.getExposureLevel();
}
}