Code Example 3: A ScriptEngineFactory object provides detailed information about the engine it provides.
2012-02-20 14:53
453 查看
Scripting for the Java Platform
Code Example 3: A
Code Example 3 produces the following output:
ScriptEngineFactoryobject provides detailed information about the engine it provides.
ScriptEngineManager mgr = new ScriptEngineManager(); List<ScriptEngineFactory> factories = mgr.getEngineFactories(); for (ScriptEngineFactory factory: factories) { System.out.println("ScriptEngineFactory Info"); String engName = factory.getEngineName(); String engVersion = factory.getEngineVersion(); String langName = factory.getLanguageName(); String langVersion = factory.getLanguageVersion(); System.out.printf("\tScript Engine: %s (%s)\n", engName, engVersion); List<String> engNames = factory.getNames(); for(String name: engNames) { System.out.printf("\tEngine Alias: %s\n", name); } System.out.printf("\tLanguage: %s (%s)\n", langName, langVersion); } |
ScriptEngineFactory Info Script Engine: Mozilla Rhino (1.6 release 2) Engine Alias: js Engine Alias: rhino Engine Alias: JavaScript Engine Alias: javascript Engine Alias: ECMAScript Engine Alias: ecmascript Language: ECMAScript (1.6) |
相关文章推荐
- The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
- Unable to start debugging on the web server. The web server is not configured correctly. See help for common configuration errors. Running the web page outside of the debugger may provide further information.
- atitit.解决struts2 SpringObjectFactory.getClassInstance NullPointerException
- Caused by: Cannot locate the chosen ObjectFactory implementation: spring - [unknown location] 的解决方式
- (15.1.7)What can information-asymmetric games tell us about the context of Crick’s ‘frozen accident’
- The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
- The rules about Object IDs
- About the Monitor object in .NET framework
- Cordova页面解析页面中script标签内容失败,Refused to execute inline script because it violates the following
- Cannot locate the chosen ObjectFactory implementation: spring - [unknown locati
- webview使用遇到 It is possible that this object was over-released, or is in the process of deallocation错误的解决办法
- Error!]the type java.lang.object cannot be resolved. it is indirectly referenced from required .class files
- Refused to load the script because it violates the following Content Security Policy directive
- If you object has an "Id' property, it will be set with the generated Id from MongoDB.
- ChromeDriver - selenium - Information about the Chrome Driver - Browser automation framework - Google Project Hosting
- "The object cannot be deleted because it was not found in the ObjectStateManager."
- Getting Information About the Contents of a Folder
- About the Height and Width property of DisplayObject
- Debugging C++ Release Projects - Finding the Lost Object Information
- The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files