本文整理匯總了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();
}