pnuts.ext
Class ScriptPackage.Function
java.lang.Object
|
+--pnuts.lang.PnutsFunction
|
+--pnuts.ext.ScriptPackage.Function
- All Implemented Interfaces:
- AbstractData, Property, java.io.Serializable
- Enclosing class:
- ScriptPackage
- public static class ScriptPackage.Function
- extends PnutsFunction
- implements AbstractData
Defines a special function to create script packages.
- See Also:
- Serialized Form
Fields inherited from class pnuts.lang.PnutsFunction |
CATCH, CLASS, DEFINED, EVAL, GET_CONTEXT, IMPORT, LOAD, LOAD_FILE, PACKAGE, pkg, primitives, QUIT, REQUIRE, THROW, USE |
Method Summary |
protected java.lang.Object |
exec(java.lang.Object[] args,
Context context)
Creates a script package. |
java.lang.Object |
get(java.lang.String name,
Context context)
This method defines the behavior of the following expression. |
java.lang.String |
getName()
|
java.lang.Object |
invoke(java.lang.String name,
java.lang.Object[] args,
Context context)
Provides these methods:
|
void |
set(java.lang.String name,
java.lang.Object value,
Context context)
Do nothing. |
Methods inherited from class pnuts.lang.PnutsFunction |
accept, added, call, call, call, call, call, defined, elements, exec, get, getImportEnv, getPackage, isBuiltin, put, toString, unparse |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ScriptPackage.Function
public ScriptPackage.Function()
ScriptPackage.Function
public ScriptPackage.Function(java.lang.String name)
ScriptPackage.Function
public ScriptPackage.Function(java.lang.String name,
Package prototype)
getName
public java.lang.String getName()
- Overrides:
getName
in class PnutsFunction
- Following copied from class:
pnuts.lang.PnutsFunction
- Returns:
- the name of functions
get
public java.lang.Object get(java.lang.String name,
Context context)
- Description copied from interface:
Property
- This method defines the behavior of the following expression.
aProperty . name
- Specified by:
get
in interface Property
- Returns:
- null
set
public void set(java.lang.String name,
java.lang.Object value,
Context context)
- Do nothing.
- Specified by:
set
in interface Property
- Following copied from interface:
pnuts.lang.Property
- Parameters:
name
- the name.value
- the value.context
- the context in which the expression is evaluated.
invoke
public java.lang.Object invoke(java.lang.String name,
java.lang.Object[] args,
Context context)
- Provides these methods:
$.set(pkg, "name", value)
$.get(pkg, "name")
$.defined(pkg, "name")
$.clear(pkg, "name")
$.keys(pkg)
- Specified by:
invoke
in interface AbstractData
exec
protected java.lang.Object exec(java.lang.Object[] args,
Context context)
- Creates a script package.
- Overrides:
exec
in class PnutsFunction
- Following copied from class:
pnuts.lang.PnutsFunction
- Returns:
- the result of the call