Java Doc for ScriptEngineFactory.java in  » Scripting » beanshell » javax » script » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Scripting » beanshell » javax.script 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


javax.script.ScriptEngineFactory

All known Subclasses:   bsh.engine.BshScriptEngineFactory,
ScriptEngineFactory
public interface ScriptEngineFactory (Code)
ScriptEngineFactory is used to describe and instantiate ScriptEngines.

Each class implementing ScriptEngine has a corresponding factory that exposes metadata describing the engine class.

The ScriptEngineManager uses the service provider mechanism described in the Jar File Specification to obtain instances of all ScriptEngineFactories available in the current ClassLoader.
since:
   1.6




Method Summary
public  StringgetEngineName()
     Returns the full name of the ScriptEngine.
public  StringgetEngineVersion()
     Returns the version of the ScriptEngine.
public  List<String>getExtensions()
     Returns an immutable list of filename extensions, which generally identify scripts written in the language supported by this ScriptEngine.
public  StringgetLanguageName()
     Returns the name of the scripting langauge supported by this ScriptEngine.
public  StringgetLanguageVersion()
     Returns the version of the scripting language supported by this ScriptEngine.
public  StringgetMethodCallSyntax(String obj, String m, String... args)
     Returns a String which can be used to invoke a method of a Java object using the syntax of the supported scripting language.
public  List<String>getMimeTypes()
     Returns an immutable list of mimetypes, associated with scripts that can be executed by the engine.
public  List<String>getNames()
     Returns an immutable list of short names for the ScriptEngine, which may be used to identify the ScriptEngine by the ScriptEngineManager.
public  StringgetOutputStatement(String toDisplay)
     Returns a String that can be used as a statement to display the specified String using the syntax of the supported scripting language.
public  ObjectgetParameter(String key)
     Returns the value of an attribute whose meaning may be implementation-specific. Keys for which the value is defined in all implementations are:
  • ScriptEngine.ENGINE
  • ScriptEngine.ENGINE_VERSION
  • ScriptEngine.NAME
  • ScriptEngine.LANGUAGE
  • ScriptEngine.LANGUAGE_VERSION

The values for these keys are the Strings returned by getEngineName, getEngineVersion, getName, getLanguageName and getLanguageVersion respectively.

A reserved key, THREADING, whose value describes the behavior of the engine with respect to concurrent execution of scripts and maintenance of state is also defined. These values for the THREADING key are:

    null - The engine implementation is not thread safe, and cannot be used to execute scripts concurrently on multiple threads.

    "MULTITHREADED" - The engine implementation is internally thread-safe and scripts may execute concurrently although effects of script execution on one thread may be visible to scripts on other threads.

    "THREAD-ISOLATED" - The implementation satisfies the requirements of "MULTITHREADED", and also, the engine maintains independent values for symbols in scripts executing on different threads.

    "STATELESS" - The implementation satisfies the requirements of "THREAD-ISOLATED".

public  StringgetProgram(String... statements)
     Returns A valid scripting language executable progam with given statements. For instance an implementation for a PHP engine might be:


 public String getProgram(String...
public  ScriptEnginegetScriptEngine()
     Returns an instance of the ScriptEngine associated with this ScriptEngineFactory.



Method Detail
getEngineName
public String getEngineName()(Code)
Returns the full name of the ScriptEngine. For instance an implementation based on the Mozilla Rhino Javascript engine might return Rhino Mozilla Javascript Engine. The name of the engine implementation.



getEngineVersion
public String getEngineVersion()(Code)
Returns the version of the ScriptEngine. The ScriptEngine implementation version.



getExtensions
public List<String> getExtensions()(Code)
Returns an immutable list of filename extensions, which generally identify scripts written in the language supported by this ScriptEngine. The array is used by the ScriptEngineManager to implement its getEngineByExtension method. The list of extensions.



getLanguageName
public String getLanguageName()(Code)
Returns the name of the scripting langauge supported by this ScriptEngine. The name of the supported language.



getLanguageVersion
public String getLanguageVersion()(Code)
Returns the version of the scripting language supported by this ScriptEngine. The version of the supported language.



getMethodCallSyntax
public String getMethodCallSyntax(String obj, String m, String... args)(Code)
Returns a String which can be used to invoke a method of a Java object using the syntax of the supported scripting language. For instance, an implementaton for a Javascript engine might be;

 public String getMethodCallSyntax(String obj,
 String method, String... args) {
 int ret = obj;
 obj += "." + method + "(";
 for (int i = 0; i < args.length; i++) {
 return += args[i];
 if (i == args.length - 1) {
 obj += ")";
 } else {
 obj += ",");
 }
 }
 return ret;
 }
 


Parameters:
  obj - The name representing the object whose method is to be invoked. Thename is the one used to create bindings using the put method ofScriptEngine, the put method of an ENGINE_SCOPEBindings,or the setAttribute methodof ScriptContext. The identifier used in scripts may be a decorated form of thespecified one.
Parameters:
  m - The name of the method to invoke.
Parameters:
  args - names of the arguments in the method call. The String used to invoke the method in the syntax of the scripting language.




getMimeTypes
public List<String> getMimeTypes()(Code)
Returns an immutable list of mimetypes, associated with scripts that can be executed by the engine. The list is used by the ScriptEngineManager class to implement its getEngineByMimetype method. The list of mime types.



getNames
public List<String> getNames()(Code)
Returns an immutable list of short names for the ScriptEngine, which may be used to identify the ScriptEngine by the ScriptEngineManager. For instance, an implementation based on the Mozilla Rhino Javascript engine might return list containing {"javascript", "rhino"}.



getOutputStatement
public String getOutputStatement(String toDisplay)(Code)
Returns a String that can be used as a statement to display the specified String using the syntax of the supported scripting language. For instance, the implementaton for a Perl engine might be;


 public String getOutputStatement(String toDisplay) {
 return "print(" + toDisplay + ")";
 }
 

Parameters:
  toDisplay - The String to be displayed by the returned statement. The string used to display the String in the syntax of the scripting language.



getParameter
public Object getParameter(String key)(Code)
Returns the value of an attribute whose meaning may be implementation-specific. Keys for which the value is defined in all implementations are:
  • ScriptEngine.ENGINE
  • ScriptEngine.ENGINE_VERSION
  • ScriptEngine.NAME
  • ScriptEngine.LANGUAGE
  • ScriptEngine.LANGUAGE_VERSION

The values for these keys are the Strings returned by getEngineName, getEngineVersion, getName, getLanguageName and getLanguageVersion respectively.

A reserved key, THREADING, whose value describes the behavior of the engine with respect to concurrent execution of scripts and maintenance of state is also defined. These values for the THREADING key are:

    null - The engine implementation is not thread safe, and cannot be used to execute scripts concurrently on multiple threads.

    "MULTITHREADED" - The engine implementation is internally thread-safe and scripts may execute concurrently although effects of script execution on one thread may be visible to scripts on other threads.

    "THREAD-ISOLATED" - The implementation satisfies the requirements of "MULTITHREADED", and also, the engine maintains independent values for symbols in scripts executing on different threads.

    "STATELESS" - The implementation satisfies the requirements of "THREAD-ISOLATED". In addition, script executions do not alter the mappings in the Bindings which is the engine scope of the ScriptEngine. In particular, the keys in the Bindings and their associated values are the same before and after the execution of the script.



Implementations may define implementation-specific keys.
Parameters:
  key - The name of the parameter The value for the given parameter. Returns null if novalue is assigned to the key.



getProgram
public String getProgram(String... statements)(Code)
Returns A valid scripting language executable progam with given statements. For instance an implementation for a PHP engine might be:


 public String getProgram(String... statements) {
 $retval = "<?\n";
 int len = statements.length;
 for (int i = 0; i < len; i++) {
 $retval += statements[i] + ";\n";
 }
 $retval += "?>";
 }
 

Parameters:
  statements - The statements to be executed. May be return values ofcalls to the getMethodCallSyntax and getOutputStatement methods. The Program



getScriptEngine
public ScriptEngine getScriptEngine()(Code)
Returns an instance of the ScriptEngine associated with this ScriptEngineFactory. A new ScriptEngine is generally returned, but implementations may pool, share or reuse engines. A new ScriptEngine instance.



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.