|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 전의 클래스 다음의 클래스 | 프레임 있어 프레임 없음 | |||||||||
| 개요: 상자 | 필드 | 생성자 | 메소드 | 상세 : 필드 | 생성자 | 메소드 | |||||||||
public interface ScriptContext
이 인터페이스를 구현하는 클래스는, 어플리케이션으로 스크립트 엔진과 스코프 설정된 Bindings 등의 객체를 접속하기 위해서 사용됩니다. 각 스코프는,ScriptContext 메소드를 사용해 설정 및 취득 가능한 값을 가지는 이름 첨부 속성세트입니다. 또, ScriptContext 는, ScriptEngine 가 입력과 출력에 사용 가능한 Reader 와 Writer 를 공개합니다.
| 필드의 개요 | |
|---|---|
static int |
ENGINE_SCOPE
EngineScope 속성은, 단일의 ScriptEngine 의 수명에 대해 가시입니다. |
static int |
GLOBAL_SCOPE
GlobalScope 속성은, 같은 ScriptEngineFactory 에 의해 작성된 모든 엔진에 대해서 가시입니다. |
| 메소드의 개요 | |
|---|---|
Object |
getAttribute (String name)
스코프내에서, 지정된 이름을 가지는 속성의 값을 검색해, 최초로 발견된 것을 가져옵니다. |
Object |
getAttribute (String name,
int scope)
지정된 스코프내의 속성의 값을 가져옵니다. |
int |
getAttributesScope (String name)
속성이 정의되고 있는 최소의 스코프를 가져옵니다. |
Bindings |
getBindings (int scope)
이 ScriptContext 내의 지정된 스코프에 관련지을 수 있었던 Bindings 를 가져옵니다. |
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 인스턴스를, 이 ScriptContext 내의 특정의 스코프에 관련짓습니다. |
void |
setErrorWriter (Writer writer)
에러 출력을 표시할 경우에 사용하는 Writer 를 설정합니다. |
void |
setReader (Reader reader)
입력을 읽어들이기 위한 스크립트의 Reader 를 설정합니다. |
void |
setWriter (Writer writer)
출력을 표시할 경우에 사용하는 스크립트의 Writer 를 설정합니다. |
| 필드의 상세 |
|---|
static final int ENGINE_SCOPE
ScriptEngine 의 수명에 대해 가시입니다. 또, 속성세트는 엔진 마다 보관 유지됩니다.
static final int GLOBAL_SCOPE
| 메소드의 상세 |
|---|
void setBindings(Bindings bindings,
int scope)
Bindings 인스턴스를, 이 ScriptContext 내의 특정의 스코프에 관련짓습니다. getAttribute 및 setAttribute 메소드의 호출에서는, 특정의 스코프에 관한 Bindings 의 get 및 put 메소드를 매핑 할 필요가 있습니다.
bindings - 지정된 스코프에 관련지을 수 있는 Bindingsscope - 스코프
IllegalArgumentException - 이 형태의 ScriptContext 내에서 지정된 스코프치에 대해서 Bindings 가 정의되어 있지 않은 경우.
NullPointerException - 스코프의 값이 ENGINE_SCOPE 로, 지정된 Bindings 가 null 의 경우. Bindings getBindings(int scope)
ScriptContext 내의 지정된 스코프에 관련지을 수 있었던 Bindings 를 가져옵니다.
Bindings. 설정되어 있지 않은 경우는 null.
IllegalArgumentException - 이 형태의 ScriptContext 내에서 지정된 스코프치에 대해서 Bindings 가 정의되어 있지 않은 경우.
void setAttribute(String name,
Object value,
int scope)
name - 설정하는 속성의 이름value - 속성의 값scope - 속성을 설정하는 스코프
IllegalArgumentException - name 가 빈 상태(empty)의 경우, 또는 스코프가 무효의 경우.
NullPointerException - 이름이 null 의 경우.
Object getAttribute(String name,
int scope)
name - 취득하는 속성의 이름. scope - 속성을 취득하는 스코프.
null.
IllegalArgumentException - name 가 빈 상태(empty)의 경우, 또는 스코프의 값이 무효의 경우.
NullPointerException - 이름이 null 의 경우.
Object removeAttribute(String name,
int scope)
name - 삭제하는 속성의 이름scope - 속성을 삭제하는 스코프
IllegalArgumentException - name 가 빈 상태(empty)의 경우, 또는 스코프가 무효의 경우.
NullPointerException - 이름이 null 의 경우. Object getAttribute(String name)
name - 취득하는 속성의 이름.
NullPointerException - 이름이 null 의 경우.
IllegalArgumentException - 이름이 빈 상태(empty)의 경우. int getAttributesScope(String name)
name - 속성의 이름
.
NullPointerException - name 가 null 의 경우.
IllegalArgumentException - name 가 빈 상태(empty)의 경우. Writer getWriter()
Writer 를 돌려줍니다.
WriterWriter getErrorWriter()
Writer 를 돌려줍니다.
Writervoid setWriter(Writer writer)
Writer 를 설정합니다.
writer - 새로운 Writervoid setErrorWriter(Writer writer)
Writer 를 설정합니다.
writer - WriterReader getReader()
Reader 를 돌려줍니다.
Readervoid setReader(Reader reader)
Reader 를 설정합니다.
reader - 새로운 ReaderList <Integer > getScopes()
List 를 돌려줍니다.
|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 전의 클래스 다음의 클래스 | 프레임 있어 프레임 없음 | |||||||||
| 개요: 상자 | 필드 | 생성자 | 메소드 | 상세 : 필드 | 생성자 | 메소드 | |||||||||
Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy 도 참조해 주세요.