public class StaticScriptSource extends Object implements ScriptSource
ScriptSource interface,
encapsulating a given String that contains the script source text.
Supports programmatic updates of the script String.| 构造器和说明 |
|---|
StaticScriptSource(String script)
Create a new StaticScriptSource for the given script.
|
StaticScriptSource(String script,
String className)
Create a new StaticScriptSource for the given script.
|
| 限定符和类型 | 方法和说明 |
|---|---|
String |
getScriptAsString()
Retrieve the current script source text as String.
|
boolean |
isModified()
Indicate whether the underlying script data has been modified since
the last time
ScriptSource.getScriptAsString() was called. |
void |
setScript(String script)
Set a fresh script String, overriding the previous script.
|
String |
suggestedClassName()
Determine a class name for the underlying script.
|
String |
toString() |
public StaticScriptSource(String script)
script - the script Stringpublic void setScript(String script)
script - the script Stringpublic String getScriptAsString()
ScriptSourcegetScriptAsString 在接口中 ScriptSourcepublic boolean isModified()
ScriptSourceScriptSource.getScriptAsString() was called.
Returns true if the script has not been read yet.isModified 在接口中 ScriptSource@Nullable public String suggestedClassName()
ScriptSourcesuggestedClassName 在接口中 ScriptSourcenull if none available