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