Java Doc for ScriptContext.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.ScriptContext

All known Subclasses:   javax.script.SimpleScriptContext,
ScriptContext
public interface ScriptContext (Code)
The interface whose implementing classes are used to connect Script Engines with objects, such as scoped Bindings, in hosting applications. Each scope is a set of named attributes whose values can be set and retrieved using the ScriptContext methods. ScriptContexts also expose Readers and Writers that can be used by the ScriptEngines for input and output.
author:
   Mike Grogan
version:
   1.0
since:
   1.6


Field Summary
final public static  intENGINE_SCOPE
     EngineScope attributes are visible during the lifetime of a single ScriptEngine and a set of attributes is maintained for each engine.
final public static  intGLOBAL_SCOPE
     GlobalScope attributes are visible to all engines created by same ScriptEngineFactory.


Method Summary
public  ObjectgetAttribute(String name, int scope)
     Gets the value of an attribute in a given scope.
Parameters:
  name - The name of the attribute to retrieve.
Parameters:
  scope - The scope in which to retrieve the attribute.
public  ObjectgetAttribute(String name)
     Retrieves the value of the attribute with the given name in the scope occurring earliest in the search order.
public  intgetAttributesScope(String name)
     Get the lowest scope in which an attribute is defined.
Parameters:
  name - Name of the attribute.
public  BindingsgetBindings(int scope)
     Gets the Bindings associated with the given scope in this ScriptContext. The associated Bindings.
public  WritergetErrorWriter()
     Returns the Writer used to display error output.
public  ReadergetReader()
     Returns a Reader to be used by the script to read input.
public  List<Integer>getScopes()
     Returns immutable List of all the valid values for scope in the ScriptContext.
public  WritergetWriter()
     Returns the Writer for scripts to use when displaying output.
public  ObjectremoveAttribute(String name, int scope)
     Remove an attribute in a given scope.
Parameters:
  name - The name of the attribute to remove
Parameters:
  scope - The scope in which to remove the attribute The removed value.
public  voidsetAttribute(String name, Object value, int scope)
     Sets the value of an attribute in a given scope.
Parameters:
  name - The name of the attribute to set.
Parameters:
  scope - The scope in which to set the attribute IllegalArgumentException if the scopeis invalid.
public  voidsetBindings(Bindings bindings, int scope)
     Associates a Bindings instance with a particular scope in this ScriptContext.
public  voidsetErrorWriter(Writer writer)
     Sets the Writer used to display error output.
public  voidsetReader(Reader reader)
     Sets the Reader for scripts to read input .
public  voidsetWriter(Writer writer)
     Sets the Writer for scripts to use when displaying output.

Field Detail
ENGINE_SCOPE
final public static int ENGINE_SCOPE(Code)
EngineScope attributes are visible during the lifetime of a single ScriptEngine and a set of attributes is maintained for each engine.



GLOBAL_SCOPE
final public static int GLOBAL_SCOPE(Code)
GlobalScope attributes are visible to all engines created by same ScriptEngineFactory.





Method Detail
getAttribute
public Object getAttribute(String name, int scope)(Code)
Gets the value of an attribute in a given scope.
Parameters:
  name - The name of the attribute to retrieve.
Parameters:
  scope - The scope in which to retrieve the attribute. The value of the attribute. Returns null is the namedoes not exist in the given scope. IllegalArgumentException if the value of scope is invalid. NullPointerException if the name is null.



getAttribute
public Object getAttribute(String name)(Code)
Retrieves the value of the attribute with the given name in the scope occurring earliest in the search order. The order is determined by the numeric value of the scope parameter (lowest scope values first.)
Parameters:
  name - The name of the the attribute to retrieve. The value of the attribute in the lowest scope forwhich an attribute with the given name is defined. Returnsnull if no attribute with the name exists in any scope. NullPointerException if the name is null.



getAttributesScope
public int getAttributesScope(String name)(Code)
Get the lowest scope in which an attribute is defined.
Parameters:
  name - Name of the attribute. The lowest scope. Returns -1 if no attribute with the givenname is defined in any scope.



getBindings
public Bindings getBindings(int scope)(Code)
Gets the Bindings associated with the given scope in this ScriptContext. The associated Bindings. Returns null if it has notbeen set.
throws:
  IllegalArgumentException - If no Bindings is defined for thespecified scope value in ScriptContext of this type.



getErrorWriter
public Writer getErrorWriter()(Code)
Returns the Writer used to display error output. The Writer



getReader
public Reader getReader()(Code)
Returns a Reader to be used by the script to read input. The Reader.



getScopes
public List<Integer> getScopes()(Code)
Returns immutable List of all the valid values for scope in the ScriptContext. list of scope values



getWriter
public Writer getWriter()(Code)
Returns the Writer for scripts to use when displaying output. The Writer.



removeAttribute
public Object removeAttribute(String name, int scope)(Code)
Remove an attribute in a given scope.
Parameters:
  name - The name of the attribute to remove
Parameters:
  scope - The scope in which to remove the attribute The removed value. IllegalArgumentException if the scope is invalid. NullPointerException if the name is null.



setAttribute
public void setAttribute(String name, Object value, int scope)(Code)
Sets the value of an attribute in a given scope.
Parameters:
  name - The name of the attribute to set.
Parameters:
  scope - The scope in which to set the attribute IllegalArgumentException if the scopeis invalid. NullPointerException if the name is null. ClassCastException if the name is not a String.



setBindings
public void setBindings(Bindings bindings, int scope)(Code)
Associates a Bindings instance with a particular scope in this ScriptContext. Calls to the getAttribute and setAttribute methods must map to the put and get methods of the Bindings for the specified scope.
Parameters:
  bindings - The Bindings to associate with the given scope
Parameters:
  scope - The scope IllegalArgumentException If no Bindings is defined for thespecified scope value in ScriptContexts of this type. NullPointerException if value of scope is ENGINE_SCOPE andthe specified Bindings is null.



setErrorWriter
public void setErrorWriter(Writer writer)(Code)
Sets the Writer used to display error output.
Parameters:
  writer - The Writer.



setReader
public void setReader(Reader reader)(Code)
Sets the Reader for scripts to read input .
Parameters:
  reader - The new Reader.



setWriter
public void setWriter(Writer writer)(Code)
Sets the Writer for scripts to use when displaying output.
Parameters:
  writer - The new Writer.



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