Package org.compiere.model
Class Scriptlet
- java.lang.Object
-
- org.compiere.model.Scriptlet
-
public class Scriptlet extends Object
Script Model- Version:
- $Id: Scriptlet.java,v 1.2 2006/07/30 00:51:03 jjanke Exp $
- Author:
- Jorg Janke
-
-
Field Summary
Fields Modifier and Type Field Description static String
DESCRIPTION_VARIABLE
Default Description Variable Namestatic String
VARIABLE
Default Result Variable Name
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Exception
execute()
Execute Script Loads environment and saves resultObject
getDescription()
Get DescriptionHashMap<String,Object>
getEnvironment()
Get EnvironmentObject
getResult(boolean runIt)
Get ResultString
getScript()
Get ScriptString
getVariable()
Get Variablevoid
setEnvironment(String key, Object value)
Set Environment key to valuevoid
setEnvironment(String key, String stringValue)
Set Environment key to valuevoid
setEnvironment(HashMap<String,Object> ctx)
Set Environmentvoid
setEnvironment(Properties prop, int WindowNo)
Set Environmentvoid
setScript(String script)
Set Scriptvoid
setVariable(String variable)
Set VariableString
toString()
String Representation incl.void
validate()
-
-
-
Field Detail
-
VARIABLE
public static final String VARIABLE
Default Result Variable Name- See Also:
- Constant Field Values
-
DESCRIPTION_VARIABLE
public static final String DESCRIPTION_VARIABLE
Default Description Variable Name- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Scriptlet
public Scriptlet()
Constructor
-
Scriptlet
public Scriptlet(String variable, String script, Properties prop, int WindowNo)
Full Constructor- Parameters:
variable
- Variable Namescript
- The Scriptprop
- EnvironmentWindowNo
- Included Window variables
-
-
Method Detail
-
execute
public Exception execute()
Execute Script Loads environment and saves result- Returns:
- null or Exception
-
validate
public void validate() throws bsh.ParseException
- Throws:
bsh.ParseException
-
getVariable
public String getVariable()
Get Variable- Returns:
- variable
-
setVariable
public void setVariable(String variable)
Set Variable- Parameters:
variable
- - if null set to VARIABLE
-
setScript
public void setScript(String script)
Set Script- Parameters:
script
-
-
getScript
public String getScript()
Get Script- Returns:
- script
-
setEnvironment
public void setEnvironment(Properties prop, int WindowNo)
Set Environment- Parameters:
prop
-WindowNo
- included Window variables
-
setEnvironment
public void setEnvironment(String key, String stringValue)
Set Environment key to value- Parameters:
key
- variable name ('#' will be converted to '_')stringValue
- try to convert to Object
-
setEnvironment
public void setEnvironment(String key, Object value)
Set Environment key to value- Parameters:
key
- variable name ('#' will be vonverted to '_')value
-
-
setEnvironment
public void setEnvironment(HashMap<String,Object> ctx)
Set Environment- Parameters:
ctx
-
-
getResult
public Object getResult(boolean runIt)
Get Result- Parameters:
runIt
- if true, execute script- Returns:
- result or null
-
getDescription
public Object getDescription()
Get Description- Returns:
- description or null
-
-