當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。