public class DefaultTextSource extends BaseSource implements TextSource
TextSource interface.
The source ID is "/groovy/script/Script<text-hash>" resp. "/groovy/script/<text-hash>/<desired-class-name>".
The text hash is calculated as follows:
The method BaseSource.getLastModified() always returns 0.
id| Constructor and Description |
|---|
DefaultTextSource(String text)
constructor from script text.
|
DefaultTextSource(String text,
String desiredClassName)
constructor from script text and desired class name.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getText()
gets the script text.
|
String |
toString()
returns a string suitable for logging.
|
equals, getId, getLastModified, hashCodeclone, finalize, getClass, notify, notifyAll, wait, wait, waitequals, getId, getLastModified, hashCodepublic DefaultTextSource(String text)
If the script text does not explicitly declare a class, the name of the compiled script class will normally be "Script<text-hash>".
text - script textNullPointerException - if text is nullpublic DefaultTextSource(String text, String desiredClassName)
If the script text does not explicitly declare a class, the name of the compiled script class will normally be the given desired class name.
text - script textdesiredClassName - desired class nameNullPointerException - if text or desired class name is nullpublic String toString()
SourcetoString in interface SourcetoString in class BaseSourcepublic String getText()
TextSourcegetText in interface TextSource