当前位置: 首页>>代码示例>>Java>>正文


Java Environment.getObjectWrapper方法代码示例

本文整理汇总了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);
}
 
开发者ID:equella,项目名称:Equella,代码行数:23,代码来源:ButtonListDirective.java

示例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());
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:21,代码来源:WrappingOptions.java

示例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;
    }
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:18,代码来源:ObjectWrapperUtil.java

示例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;
}
 
开发者ID:equella,项目名称:Equella,代码行数:10,代码来源:ListRendererDirective.java

示例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;
}
 
开发者ID:equella,项目名称:Equella,代码行数:10,代码来源:BooleanListDirective.java

示例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;
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:8,代码来源:MultiVarMethod.java

示例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;
    }
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:13,代码来源:LangFtlUtil.java

示例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;
        }
    }
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:13,代码来源:ObjectWrapperUtil.java

示例9: getCurrentObjectWrapper

import freemarker.core.Environment; //导入方法依赖的package包/类
/**
 * Gets current object wrapper, whatever it may be.
 */
public static ObjectWrapper getCurrentObjectWrapper(Environment env) {
    return env.getObjectWrapper();
}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:7,代码来源:LangFtlUtil.java


注:本文中的freemarker.core.Environment.getObjectWrapper方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。