|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.scripting.support.ResourceScriptSource
public class ResourceScriptSource
ScriptSource implementation
based on Spring's Resource
abstraction. Loads the script text from the underlying Resource's
File or
InputStream,
and tracks the last-modified timestamp of the file (if possible).
InputStreamSource.getInputStream(),
Resource.getFile(),
ResourceLoader| Field Summary | |
|---|---|
protected Log |
logger
Logger available to subclasses |
| Constructor Summary | |
|---|---|
ResourceScriptSource(Resource resource)
Create a new ResourceScriptSource for the given resource. |
|
| Method Summary | |
|---|---|
Resource |
getResource()
Return the Resource to load the
script from. |
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. |
protected long |
retrieveLastModifiedTime()
Retrieve the current last-modified timestamp of the underlying resource. |
String |
suggestedClassName()
Determine a class name for the underlying script. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final Log logger
| Constructor Detail |
|---|
public ResourceScriptSource(Resource resource)
resource - the Resource to load the script from| Method Detail |
|---|
public final Resource getResource()
Resource to load the
script from.
public String getScriptAsString()
throws IOException
ScriptSource
getScriptAsString in interface ScriptSourceIOException - if script retrieval failedpublic boolean isModified()
ScriptSourceScriptSource.getScriptAsString() was called.
Returns true if the script has not been read yet.
isModified in interface ScriptSourceprotected long retrieveLastModifiedTime()
public String suggestedClassName()
ScriptSource
suggestedClassName in interface ScriptSourcenull if none availablepublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||