Class StaticScriptSource
java.lang.Object
org.springframework.scripting.support.StaticScriptSource
- All Implemented Interfaces:
- ScriptSource
Static implementation of the
 
ScriptSource interface,
 encapsulating a given String that contains the script source text.
 Supports programmatic updates of the script String.- Since:
- 2.0
- Author:
- Rob Harrop, Juergen Hoeller
- 
Constructor SummaryConstructorsConstructorDescriptionStaticScriptSource(String script) Create a new StaticScriptSource for the given script.StaticScriptSource(String script, String className) Create a new StaticScriptSource for the given script.
- 
Method SummaryModifier and TypeMethodDescriptionRetrieve the current script source text as String.booleanIndicate whether the underlying script data has been modified since the last timeScriptSource.getScriptAsString()was called.voidSet a fresh script String, overriding the previous script.Determine a class name for the underlying script.toString()
- 
Constructor Details- 
StaticScriptSourceCreate a new StaticScriptSource for the given script.- Parameters:
- script- the script String
 
- 
StaticScriptSourceCreate a new StaticScriptSource for the given script.- Parameters:
- script- the script String
- className- the suggested class name for the script (may be- null)
 
 
- 
- 
Method Details- 
setScriptSet a fresh script String, overriding the previous script.- Parameters:
- script- the script String
 
- 
getScriptAsStringDescription copied from interface:ScriptSourceRetrieve the current script source text as String.- Specified by:
- getScriptAsStringin interface- ScriptSource
- Returns:
- the script text
 
- 
isModifiedpublic boolean isModified()Description copied from interface:ScriptSourceIndicate whether the underlying script data has been modified since the last timeScriptSource.getScriptAsString()was called. Returnstrueif the script has not been read yet.- Specified by:
- isModifiedin interface- ScriptSource
- Returns:
- whether the script data has been modified
 
- 
suggestedClassNameDescription copied from interface:ScriptSourceDetermine a class name for the underlying script.- Specified by:
- suggestedClassNamein interface- ScriptSource
- Returns:
- the suggested class name, or nullif none available
 
- 
toString
 
-