Revert changes from r8901 since caused unit test failure.
This commit is contained in:
parent
092f6ed4d8
commit
5fd6020035
4 changed files with 47 additions and 59 deletions
|
@ -1,21 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
package freemarker.ext.beans;
|
||||
|
||||
|
||||
/**
|
||||
* Class to expose template model wrapper. Used as workaround to gaps
|
||||
* in the Freemarker template model API (can't get wrapper for an
|
||||
* arbitrary template model object).
|
||||
*/
|
||||
public class WrapperExtractor {
|
||||
|
||||
public static BeansWrapper getWrapper(BeanModel model) {
|
||||
return model.wrapper;
|
||||
}
|
||||
|
||||
public static int getWrapperExposureLevel(BeanModel model) {
|
||||
return model.wrapper.getExposureLevel();
|
||||
}
|
||||
|
||||
}
|
25
webapp/src/freemarker/ext/beans/WrapperUtils.java
Normal file
25
webapp/src/freemarker/ext/beans/WrapperUtils.java
Normal file
|
@ -0,0 +1,25 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
package freemarker.ext.beans;
|
||||
|
||||
import java.lang.reflect.Member;
|
||||
|
||||
/**
|
||||
* Class to expose protected information about template models and their data
|
||||
* and wrappers to dump methods. Used as workaround to some problems and gaps
|
||||
* in the Freemarker template model API.
|
||||
*/
|
||||
public class WrapperUtils {
|
||||
|
||||
public static BeansWrapper getWrapper(BeanModel model) {
|
||||
return model.wrapper;
|
||||
}
|
||||
|
||||
public static int getWrapperExposureLevel(BeanModel model) {
|
||||
return model.wrapper.getExposureLevel();
|
||||
}
|
||||
|
||||
public static Member getMember(SimpleMethodModel model) {
|
||||
return model.getMember();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue