public class ScriptHandle
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
int |
type |
static int |
TYPE_EMBEDDED
The tag for scripts embedded in the XUL file.
|
static int |
TYPE_EXTERNAL
The tag for external scripts.
|
protected org.scripthelper.model.ScriptWrapper<?> |
wrapper
The Script wrapper.
|
Constructor and Description |
---|
ScriptHandle(org.scripthelper.model.ScriptSource source)
Constructor.
|
ScriptHandle(org.scripthelper.model.ScriptSource source,
int type)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getFileName()
Return the file name (can be the name of the script if the source is an embedded script).
|
java.lang.String |
getMIME()
Return the MIME.
|
java.lang.Object |
getScript()
Return the script.
|
org.scripthelper.model.ScriptSource |
getScriptSource()
Return the script source.
|
int |
getScriptType() |
org.scripthelper.model.ScriptWrapper<?> |
getScriptWrapper()
Return the script wrapper.
|
java.net.URL |
getURL()
Return the source URL (not null only if the script refer to a File or URL)
|
int |
hashCode() |
java.lang.Object |
installScript()
Install the script file.
|
java.lang.Object |
invoke(java.lang.String mehodName)
Invoke a method without argument of the script.
|
java.lang.Object |
invoke(java.lang.String mehodName,
java.lang.Object... args)
Invoke a method of the script.
|
void |
setScriptContent(java.lang.String content)
Set the script content as String (useuful only for embedded scripts).
|
void |
setScriptWrapper(org.scripthelper.model.ScriptWrapper<?> wrapper)
Set the script wrapper.
|
public static final int TYPE_EMBEDDED
public static final int TYPE_EXTERNAL
public int type
protected org.scripthelper.model.ScriptWrapper<?> wrapper
public ScriptHandle(org.scripthelper.model.ScriptSource source)
source
- the ScriptSourcepublic ScriptHandle(org.scripthelper.model.ScriptSource source, int type)
source
- the ScriptSourcetype
- the script typepublic int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String getFileName()
public java.lang.String getMIME()
public int getScriptType()
public java.lang.Object getScript()
public java.net.URL getURL()
public java.lang.Object installScript()
public void setScriptContent(java.lang.String content)
content
- the contentpublic void setScriptWrapper(org.scripthelper.model.ScriptWrapper<?> wrapper)
wrapper
- the script wrapperpublic org.scripthelper.model.ScriptWrapper<?> getScriptWrapper()
public org.scripthelper.model.ScriptSource getScriptSource()
public java.lang.Object invoke(java.lang.String mehodName, java.lang.Object... args)
mehodName
- the method nameargs
- the argumentspublic java.lang.Object invoke(java.lang.String mehodName)
mehodName
- the method nameCopyright © 2008-2020 Herve Girod. All Rights Reserved. Documentation and source under the LGPL licence