|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
java.lang.Objectjavax.script.SimpleScriptContext
public class SimpleScriptContext
ScriptContext の単純な実装です。
| フィールドの概要 | |
|---|---|
protected Bindings |
engineScope
これは、エンジンスコープバインディングです。 |
protected Writer |
errorWriter
これは、スクリプトからの出力エラーに使用されるライターです。 |
protected Bindings |
globalScope
これは、グローバルスコープのバインディングです。 |
protected Reader |
reader
これは、スクリプトからの入力に使用されるリーダーです。 |
protected Writer |
writer
これは、スクリプトからの出力に使用されるライターです。 |
| インタフェース javax.script.ScriptContext から継承されたフィールド |
|---|
ENGINE_SCOPE, GLOBAL_SCOPE |
| コンストラクタの概要 | |
|---|---|
SimpleScriptContext()
|
|
| メソッドの概要 | |
|---|---|
Object |
getAttribute(String name)
スコープ内で、指定された名前を持つ属性の値を検索し、最初に見つかったものを取得します。 |
Object |
getAttribute(String name,
int scope)
指定されたスコープ内の属性の値を取得します。 |
int |
getAttributesScope(String name)
属性が定義されている最小のスコープを取得します。 |
Bindings |
getBindings(int scope)
指定されたスコープが ENGINE_SCOPE の場合、engineScope フィールドの値を返します。 |
Writer |
getErrorWriter()
エラー出力を表示するときに使用する Writer を返します。 |
Reader |
getReader()
入力を読み込むためにスクリプトが使用する Reader を返します。 |
List<Integer> |
getScopes()
ScriptContext 内のスコープに対する、すべての有効値の不変の List を返します。 |
Writer |
getWriter()
出力を表示するときに使用するスクリプトの Writer を返します。 |
Object |
removeAttribute(String name,
int scope)
指定されたスコープ内の属性を削除します。 |
void |
setAttribute(String name,
Object value,
int scope)
指定されたスコープ内の属性の値を設定します。 |
void |
setBindings(Bindings bindings,
int scope)
指定されたスコープの属性の Bindings を設定します。 |
void |
setErrorWriter(Writer writer)
エラー出力を表示するときに使用する Writer を設定します。 |
void |
setReader(Reader reader)
入力を読み込むためのスクリプトの Reader を設定します。 |
void |
setWriter(Writer writer)
出力を表示するときに使用するスクリプトの Writer を設定します。 |
| クラス java.lang.Object から継承されたメソッド |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| フィールドの詳細 |
|---|
protected Writer writer
System.out に基づいた PrintWriter が使用されます。このフィールドの管理には、アクセス用メソッド getWriter および setWriter が使用されます。
System.out,
PrintWriterprotected Writer errorWriter
System.err に基づいた PrintWriter が使用されます。このフィールドの管理には、アクセス用メソッド getErrorWriter および setErrorWriter が使用されます。
System.err,
PrintWriterprotected Reader reader
System.in に基づいた InputStreamReader が使用されます。このリーダーは、デフォルトの文字セットを使用します。このフィールドの管理には、アクセス用メソッド getReader および setReader が使用されます。
System.in,
InputStreamReaderprotected Bindings engineScope
SimpleBindings が使用されます。このフィールドの管理には、アクセス用メソッド setBindings および getBindings が使用されます。
SimpleBindingsprotected Bindings globalScope
| コンストラクタの詳細 |
|---|
public SimpleScriptContext()
| メソッドの詳細 |
|---|
public void setBindings(Bindings bindings,
int scope)
Bindings を設定します。スコープの値が ENGINE_SCOPE である場合、指定された Bindings が engineScope フィールドを置換します。スコープの値が GLOBAL_SCOPE である場合、指定された Bindings が globalScope フィールドを置換します。
ScriptContext 内の setBindingsbindings - 設定する属性の Bindings。scope - 属性が設定されるスコープの値。
IllegalArgumentException - スコープが無効な場合。
NullPointerException - スコープの値が ENGINE_SCOPE で、指定された Bindings が null の場合。public Object getAttribute(String name)
ScriptContext 内の getAttributename - 取得する属性の名前。
NullPointerException - 名前が null の場合。
IllegalArgumentException - 名前が空の場合。
public Object getAttribute(String name,
int scope)
ScriptContext 内の getAttributename - 取得する属性の名前。scope - 属性を取得するスコープ。
null。
IllegalArgumentException - name が空の場合、またはスコープの値が無効の場合。
NullPointerException - 名前が null の場合。
public Object removeAttribute(String name,
int scope)
ScriptContext 内の removeAttributename - 削除する属性の名前scope - 属性を削除するスコープ
IllegalArgumentException - name が空の場合、またはスコープが無効の場合。
NullPointerException - 名前が null の場合。
public void setAttribute(String name,
Object value,
int scope)
ScriptContext 内の setAttributename - 設定する属性の名前value - 属性の値scope - 属性を設定するスコープ
IllegalArgumentException - name が空の場合、またはスコープが無効の場合。
NullPointerException - 名前が null の場合。public Writer getWriter()
Writer を返します。
ScriptContext 内の getWriterWriterpublic Reader getReader()
Reader を返します。
ScriptContext 内の getReaderReaderpublic void setReader(Reader reader)
Reader を設定します。
ScriptContext 内の setReaderreader - 新しい Readerpublic void setWriter(Writer writer)
Writer を設定します。
ScriptContext 内の setWriterwriter - 新しい Writerpublic Writer getErrorWriter()
Writer を返します。
ScriptContext 内の getErrorWriterWriterpublic void setErrorWriter(Writer writer)
Writer を設定します。
ScriptContext 内の setErrorWriterwriter - Writerpublic int getAttributesScope(String name)
ScriptContext 内の getAttributesScopename - 属性の名前
.
NullPointerException - name が null の場合。
IllegalArgumentException - name が空の場合。public Bindings getBindings(int scope)
ENGINE_SCOPE の場合、engineScope フィールドの値を返します。指定されたスコープが GLOBAL_SCOPE の場合、globalScope フィールドの値を返します。
ScriptContext 内の getBindingsscope - 指定されたスコープ
engineScope または globalScope フィールドの値。
IllegalArgumentException - スコープの値が無効な場合。public List<Integer> getScopes()
List を返します。
ScriptContext 内の getScopes
|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Documentation Redistribution Policy も参照してください。