本文整理汇总了Java中org.apache.commons.lang3.SystemUtils.IS_JAVA_1_6属性的典型用法代码示例。如果您正苦于以下问题:Java SystemUtils.IS_JAVA_1_6属性的具体用法?Java SystemUtils.IS_JAVA_1_6怎么用?Java SystemUtils.IS_JAVA_1_6使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.commons.lang3.SystemUtils
的用法示例。
在下文中一共展示了SystemUtils.IS_JAVA_1_6属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getCommonVars
/**
* Gets the common vars.
*
* @param session the session
* @return the common vars
*/
public Map<String,Object> getCommonVars(Session session){
Map<String,Object> vars = new HashMap<String,Object>();
if(SystemUtils.IS_JAVA_1_6){
//for rhino we can continue to use instances of classes usually used for static util methods.
vars.put(Const.FUNCTION, this.getFunction());
vars.put(Const.VAR_SESSION, session);
vars.put(Const.VAR_BUNDLE_UTILS, new BundleUtils());
vars.put(Const.VAR_TERM_SIGNAL, TermSignal.insta());
vars.put(Const.VAR_CACHE, ScriptCache.insta());
vars.put(Const.VAR_SCRIPT,new ScriptWrapper(this));
vars.put(Const.VAR_B64, Base64.class);
vars.put(Const.VAR_STRUTILS, StrUtils.insta());
vars.put(Const.VAR_COLUTILS, ColUtils.insta());
vars.put(Const.VAR_STOPWATCH, new StopWatch());
vars.put(Const.VAR_FILEUTILS, new FileUtils());
vars.put(Const.VAR_IOUTILS, new IOUtils());
vars.put(Const.VAR_ATTACHUTILS, AttachUtils.insta());
}else{
//for nashorn we require class reference then call with static (e.g. bundleUtils.static.load(...,...)
vars.put(Const.FUNCTION, this.getFunction());
vars.put(Const.VAR_SESSION, session);
vars.put(Const.VAR_BUNDLE_UTILS,BundleUtils.class);
vars.put(Const.VAR_TERM_SIGNAL, TermSignal.insta());
vars.put(Const.VAR_CACHE, ScriptCache.insta());
vars.put(Const.VAR_SCRIPT,new ScriptWrapper(this));
vars.put(Const.VAR_B64, Base64.class);
vars.put(Const.VAR_STRUTILS,StrUtils.class);
vars.put(Const.VAR_COLUTILS, ColUtils.class);
vars.put(Const.VAR_STOPWATCH, new StopWatch());
vars.put(Const.VAR_FILEUTILS, FileUtils.class);
vars.put(Const.VAR_IOUTILS,IOUtils.class);
vars.put(Const.VAR_ATTACHUTILS, AttachUtils.class);
}
SimpleClient client = guicer.inject(new SimpleClient(this));
vars.put(Const.VAR_WEBSOCKET_CLIENT, client);
String from = this.getFrom();
//add application scoped objects
String key = "/" + dbPath();
this.applyVars("/" + dbPath(), vars);
//now add user scoped objects
if(!StrUtils.isEmpty(from)){
IUser user = client.getUser(from);
if(user!=null){
key = "/" + dbPath() + "/" + user.getSessionId();
this.applyVars(key, vars);
}
}
//last bit, make sure db is available.
try{
vars.put(Const.VAR_DB, session.getDatabase("", this.dbPath()));
}catch(NotesException n){
LOG.log(Level.SEVERE, null, n);
}
return vars;
}