org.jopendocument.dom.template.engine
Class ScriptEngineDataModel

java.lang.Object
  extended by org.jopendocument.dom.template.engine.DataModel
      extended by org.jopendocument.dom.template.engine.ScriptEngineDataModel

public class ScriptEngineDataModel
extends DataModel

A data model using a ScriptEngine.

Author:
Sylvain

Constructor Summary
ScriptEngineDataModel(ScriptEngine e)
           
 
Method Summary
 Object _eval(String script)
           
 DataModel copy()
          Copy this engine and especially its bindings.
 ScriptEngine getEngine()
           
 void put(String key, Object value)
           
 void putAll(Map<? extends String,?> toMerge)
          Copies all of the mappings from the specified map to this.
 
Methods inherited from class org.jopendocument.dom.template.engine.DataModel
eval
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScriptEngineDataModel

public ScriptEngineDataModel(ScriptEngine e)
Method Detail

getEngine

public final ScriptEngine getEngine()

_eval

public Object _eval(String script)
             throws ScriptException
Specified by:
_eval in class DataModel
Throws:
ScriptException

put

public void put(String key,
                Object value)
Specified by:
put in class DataModel

putAll

public void putAll(Map<? extends String,?> toMerge)
Description copied from class: DataModel
Copies all of the mappings from the specified map to this. This implementation simply calls put(k, v) once for each entry in the specified map.

Overrides:
putAll in class DataModel
Parameters:
toMerge - mappings to be stored.

copy

public DataModel copy()
Description copied from class: DataModel
Copy this engine and especially its bindings.

Specified by:
copy in class DataModel
Returns:
an independant copy of this.


Copyright © 2010 jOpenDocument All Rights Reserved.