| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectphp.java.script.ScriptContextDecorator
public abstract class ScriptContextDecorator
Abstract class for ScriptContexts. The abstract class itself provides default methods that pass all requests to the contained ScriptContext. Subclasses of ScriptContextDecorator should override some of these methods and may also provide additional methods and fields.
| Field Summary | 
|---|
| Fields inherited from interface javax.script.ScriptContext | 
|---|
| ENGINE_SCOPE, GLOBAL_SCOPE | 
| Constructor Summary | |
|---|---|
| ScriptContextDecorator(ScriptContext ctx) | |
| Method Summary | |
|---|---|
|  java.lang.Object | getAttribute(java.lang.String name)Retrieves the value of the getAttribute(String, int) for the lowest scope in which it returns a non-null value. | 
|  java.lang.Object | getAttribute(java.lang.String name,
             int scope)Retrieves the value of an attribute in the specified scope. | 
|  int | getAttributesScope(java.lang.String name)Retrieves the lowest value of the scope for which the attribute is defined. | 
|  Bindings | getBindings(int scope)Retrieves the Namespace instance associated with the gieve scope. | 
|  java.io.Writer | getErrorWriter()Returns the Writerused to display error output. | 
|  java.io.Reader | getReader()Returns a Readerto be used by the script to read
 input. | 
|  java.util.List | getScopes()Returns immutable Listof all the valid values for
 scope in the ScriptContext. | 
|  java.io.Writer | getWriter()Returns the Writerfor scripts to use when displaying output. | 
|  java.lang.Object | removeAttribute(java.lang.String name,
                int scope)Removes the given attribute form the specified scope. | 
|  void | setAttribute(java.lang.String key,
             java.lang.Object value,
             int scope)Associates a specified value with the specifed name in the specified scope. | 
|  void | setBindings(Bindings namespace,
            int scope)Associates the specified namespace with the specified scope. | 
|  void | setErrorWriter(java.io.Writer writer)Sets the Writerused to display error output. | 
|  void | setReader(java.io.Reader reader)Sets the Readerfor scripts to read input
 . | 
|  void | setWriter(java.io.Writer writer)Sets the Writerfor scripts to use when displaying output. | 
| Methods inherited from class java.lang.Object | 
|---|
| equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public ScriptContextDecorator(ScriptContext ctx)
| Method Detail | 
|---|
public java.lang.Object getAttribute(java.lang.String name)
                              throws java.lang.IllegalArgumentException
getAttribute in interface ScriptContextname - the name of the attribute
java.lang.IllegalArgumentException - if the name is null
public java.lang.Object getAttribute(java.lang.String name,
                                     int scope)
                              throws java.lang.IllegalArgumentException
getAttribute in interface ScriptContextname - the name of the attributescope - the value of the scope
java.lang.IllegalArgumentException - if the name is null or the 
         scope is invalidpublic int getAttributesScope(java.lang.String name)
getAttributesScope in interface ScriptContextname - the name of attribute
public Bindings getBindings(int scope)
getBindings in interface ScriptContextscope - the level of the scope
public java.io.Writer getErrorWriter()
Writer used to display error output.
getErrorWriter in interface ScriptContextWriterpublic java.io.Reader getReader()
Reader to be used by the script to read
 input.
getReader in interface ScriptContextReader.public java.util.List getScopes()
List of all the valid values for
 scope in the ScriptContext.
getScopes in interface ScriptContextpublic java.io.Writer getWriter()
Writer for scripts to use when displaying output.
getWriter in interface ScriptContextWriter.
public java.lang.Object removeAttribute(java.lang.String name,
                                        int scope)
removeAttribute in interface ScriptContextname - the name of the attributescope - the level of scope which inherit the attribute
public void setAttribute(java.lang.String key,
                         java.lang.Object value,
                         int scope)
                  throws java.lang.IllegalArgumentException
setAttribute in interface ScriptContextkey - the name of the attributevalue - the value of the attributescope - the level of the scope
java.lang.IllegalArgumentException - if the name is null or the
         scope is invalid
public void setBindings(Bindings namespace,
                        int scope)
                 throws java.lang.IllegalArgumentException
setBindings in interface ScriptContextnamespace - the namespace to be associated with the
        specified level of scopescope - the specified level of scope
java.lang.IllegalArgumentException - if the scope is invalidpublic void setErrorWriter(java.io.Writer writer)
Writer used to display error output.
setErrorWriter in interface ScriptContextwriter - The Writer.public void setReader(java.io.Reader reader)
Reader for scripts to read input
 .
setReader in interface ScriptContextreader - The new Reader.public void setWriter(java.io.Writer writer)
Writer for scripts to use when displaying output.
setWriter in interface ScriptContextwriter - The new Writer.| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||