本文整理汇总了Java中freemarker.core.Environment.getObjectWrapper方法的典型用法代码示例。如果您正苦于以下问题:Java Environment.getObjectWrapper方法的具体用法?Java Environment.getObjectWrapper怎么用?Java Environment.getObjectWrapper使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类freemarker.core.Environment
的用法示例。
在下文中一共展示了Environment.getObjectWrapper方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ButtonListTagRenderer
import freemarker.core.Environment; //导入方法依赖的package包/类
@SuppressWarnings("nls")
public ButtonListTagRenderer(String tag, HtmlListState state, Environment env, TemplateDirectiveBody body,
TemplateModel[] loopVars, boolean hideDisabledOptions)
{
super(tag, state); //$NON-NLS-1$
this.wrapper = (BeansWrapper) env.getObjectWrapper();
this.listState = state;
this.body = body;
this.loopVars = loopVars;
this.hideDisabledOptions = hideDisabledOptions;
this.hiddenId = new AppendedElementId(state, "_hid");
ScriptVariable valVar = new ScriptVariable("val");
JSStatements changeBody = new AssignStatement(new ElementValueExpression(hiddenId), valVar);
JSHandler lsChangeHandler = state.getHandler(JSHandler.EVENT_CHANGE);
if( lsChangeHandler != null )
{
changeBody = StatementBlock.get(changeBody, lsChangeHandler);
}
clickFunc = new SimpleFunction(JSHandler.EVENT_CHANGE, state, changeBody, valVar);
}
示例2: makeOptions
import freemarker.core.Environment; //导入方法依赖的package包/类
public static WrappingOptions makeOptions(String wrapper, String mode, Environment env) throws TemplateModelException {
ObjectWrapper targetWrapper = ObjectWrapperUtil.getObjectWrapperByName(wrapper, env);
if (targetWrapper == null) {
throw new TemplateModelException("Unrecognized wrapper name: " + wrapper);
}
if (wrapper == null) {
wrapper = "";
}
RewrapMode rewrapMode = RewrapMode.ALWAYS_DEEP;
if (mode != null && !mode.isEmpty()) {
rewrapMode = RewrapMode.fromString(mode);
if (rewrapMode == null) {
throw new TemplateModelException("Unrecognized rewrapping mode: " + mode);
}
}
return new WrappingOptions(wrapper, ObjectWrapperUtil.getObjectWrapperByName(wrapper, env),
rewrapMode, env.getObjectWrapper());
}
示例3: getWrapper
import freemarker.core.Environment; //导入方法依赖的package包/类
@Override
public ObjectWrapper getWrapper(Environment env) {
ObjectWrapper curr = env.getObjectWrapper();
if (curr instanceof ScipioExtendedObjectWrapper) {
if (curr instanceof ScipioBeansWrapper) {
if (((BeansWrapper) curr).isSimpleMapWrapper()) {
return FreeMarkerWorker.getDefaultOfbizSimpleMapWrapper();
} else {
return FreeMarkerWorker.getDefaultOfbizWrapper();
}
} else {
return FreeMarkerWorker.getDefaultOfbizSimpleMapWrapper();
}
} else {
return curr;
}
}
示例4: FreemarkerListRenderer
import freemarker.core.Environment; //导入方法依赖的package包/类
public FreemarkerListRenderer(HtmlMutableListState state, Environment env, TemplateDirectiveBody body,
TemplateModel[] loopVars)
{
super("ul", state); //$NON-NLS-1$
this.wrapper = (BeansWrapper) env.getObjectWrapper();
this.listState = state;
this.body = body;
this.loopVars = loopVars;
}
示例5: FreemarkerCheckListRenderer
import freemarker.core.Environment; //导入方法依赖的package包/类
public FreemarkerCheckListRenderer(BooleanListRenderer renderer, Environment env, TemplateDirectiveBody body,
TemplateModel[] loopVars)
{
super("ul", renderer.getListState()); //$NON-NLS-1$
this.wrapper = (BeansWrapper) env.getObjectWrapper();
this.body = body;
this.loopVars = loopVars;
this.renderer = renderer;
}
示例6: toMapModel
import freemarker.core.Environment; //导入方法依赖的package包/类
public TemplateHashModelEx toMapModel(Environment env) {
SimpleHash map = new SimpleHash(env.getObjectWrapper());
map.put("ctxVars", ctxVars);
map.put("globalCtxVars", globalCtxVars);
map.put("reqAttribs", reqAttribs);
return map;
}
示例7: getNonEscapingObjectWrapper
import freemarker.core.Environment; //导入方法依赖的package包/类
/**
* Checks if the current env wrapper is a special escaping wrapper, and if so,
* returns a non-escaping one.
*/
public static ObjectWrapper getNonEscapingObjectWrapper(Environment env) {
ObjectWrapper objectWrapper = env.getObjectWrapper();
if (objectWrapper instanceof ScipioExtendedObjectWrapper) {
return FreeMarkerWorker.getDefaultOfbizWrapper();
} else {
return objectWrapper;
}
}
示例8: getObjectWrapperByName
import freemarker.core.Environment; //导入方法依赖的package包/类
public static ObjectWrapper getObjectWrapperByName(String wrapper, Environment env) throws TemplateModelException {
if (wrapper == null || wrapper.isEmpty()) {
return env.getObjectWrapper();
} else {
ObjectWrapperFetcher fetcher = objectWrapperFetcherMap.get(wrapper);
if (fetcher != null) {
return fetcher.getWrapper(env);
} else {
return null;
}
}
}
示例9: getCurrentObjectWrapper
import freemarker.core.Environment; //导入方法依赖的package包/类
/**
* Gets current object wrapper, whatever it may be.
*/
public static ObjectWrapper getCurrentObjectWrapper(Environment env) {
return env.getObjectWrapper();
}