pnuts.ext
Class SecurePnutsImpl

java.lang.Object
  |
  +--pnuts.lang.PnutsImpl
        |
        +--pnuts.ext.SecurePnutsImpl

public class SecurePnutsImpl
extends PnutsImpl

A PnutsImpl subclass that execute scripts in an access control context in Java2 Security.

e.g.
  context.setPnutsImpl(new SecurePnutsImpl(new CompilerPnutsImpl()));
 


Constructor Summary
SecurePnutsImpl(PnutsImpl impl)
          A Constructor
SecurePnutsImpl(PnutsImpl impl, java.security.CodeSource codeSource)
          A Constructor
 
Method Summary
 java.lang.Object accept(SimpleNode node, Context context)
          Evaluate a parsed script
 java.lang.Object eval(java.lang.String expr, Context context)
          Evaluate an expreesion
 java.lang.Object load(java.net.URL scriptURL, Context context)
          Load a script file from a URL
 java.lang.String toString()
           
 
Methods inherited from class pnuts.lang.PnutsImpl
checkException, load, load, loadFile, popFile, pushFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SecurePnutsImpl

public SecurePnutsImpl(PnutsImpl impl)
A Constructor
Parameters:
impl - a PnutsImpl object

SecurePnutsImpl

public SecurePnutsImpl(PnutsImpl impl,
                       java.security.CodeSource codeSource)
A Constructor
Parameters:
impl -  
codeSource - a CodeSource object which indicates the source of the expression execute by eval(String, Context).
Method Detail

eval

public java.lang.Object eval(java.lang.String expr,
                             Context context)
Evaluate an expreesion
Overrides:
eval in class PnutsImpl
Parameters:
expr - the expression to be evaluated
context - the context in which the expression is evaluated
Returns:
the result of the evaluation

accept

public java.lang.Object accept(SimpleNode node,
                               Context context)
Evaluate a parsed script
Overrides:
accept in class PnutsImpl
Parameters:
node - the parsed script
context - the context in which the script is evaluated
Returns:
the result of the evaluation

load

public java.lang.Object load(java.net.URL scriptURL,
                             Context context)
Load a script file from a URL
Overrides:
load in class PnutsImpl
Parameters:
scriptURL - the URL of the script
context - the context in which the script is executed

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object