TeaEngine 0.7.0 Java Script API

com.pdmfc.tea.engine
Class TeaBindings

java.lang.Object
  extended by com.pdmfc.tea.engine.TeaBindings
All Implemented Interfaces:
java.util.Map<java.lang.String,java.lang.Object>, javax.script.Bindings

public class TeaBindings
extends java.lang.Object
implements javax.script.Bindings

The javax.script.Bindings interface allows Java code to access (get, set, remove, list, etc...) variable bindings for Tea code. In Tea, this is implemented in the base class com.pdmfc.tea.runtime.SContext, com.pdmfc.tea.runtime.STeaRuntime.

Up to Tea 3.2.1, SContext is optimized for speed of execution, and does not support unsetting (undefining) variables or listing variables. As such, methods related to these features throw the java.lang.UnsupportedOperationException.


Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Field Summary
protected  java.util.List _importDirList
          List of directories (or resource URLs) to be used as import directories.
protected  com.pdmfc.tea.runtime.STeaRuntime _runtime
          The top level runtime SContext.
 
Constructor Summary
TeaBindings()
          _runtime will be initialized on 1st execution attempt, as we are not allowed to throw a ScriptException here.
 
Method Summary
 void clear()
          Unsupported.
 boolean containsKey(java.lang.Object key)
           
 boolean containsValue(java.lang.Object value)
          Unsupported.
 java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>> entrySet()
          Unsupported.
 boolean equals(java.lang.Object o)
          Unsupported.
 java.lang.Object get(java.lang.Object key)
          Unsupported.
 java.util.List getImportDirList()
           
 com.pdmfc.tea.runtime.STeaRuntime getMyRuntime()
          Gets the STeaRuntime context.
 int hashCode()
          Unsupported.
 boolean isEmpty()
          Unsupported.
 java.util.Set<java.lang.String> keySet()
          Unsupported.
 java.lang.Object put(java.lang.String key, java.lang.Object value)
           
 void putAll(java.util.Map<? extends java.lang.String,? extends java.lang.Object> toMerge)
           
 java.lang.Object remove(java.lang.Object key)
          Unsupported.
 int size()
          Unsupported.
 java.util.Collection<java.lang.Object> values()
          Unsupported.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_runtime

protected com.pdmfc.tea.runtime.STeaRuntime _runtime
The top level runtime SContext. (Please see Tea javadoc for actual details.)


_importDirList

protected java.util.List _importDirList
List of directories (or resource URLs) to be used as import directories. It will be initialized by default from the Tea core configuration, but it can be manipulated using the getImportDirList() method.

Constructor Detail

TeaBindings

public TeaBindings()
_runtime will be initialized on 1st execution attempt, as we are not allowed to throw a ScriptException here. _importDirList is initialized from Tea core configuration.

See Also:
getImportDirList()
Method Detail

clear

public void clear()
Unsupported.

Specified by:
clear in interface java.util.Map<java.lang.String,java.lang.Object>
Throws:
java.lang.UnsupportedOperationException

containsKey

public boolean containsKey(java.lang.Object key)
Specified by:
containsKey in interface java.util.Map<java.lang.String,java.lang.Object>
Specified by:
containsKey in interface javax.script.Bindings

containsValue

public boolean containsValue(java.lang.Object value)
Unsupported.

Specified by:
containsValue in interface java.util.Map<java.lang.String,java.lang.Object>
Throws:
java.lang.UnsupportedOperationException

entrySet

public java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>> entrySet()
Unsupported.

Specified by:
entrySet in interface java.util.Map<java.lang.String,java.lang.Object>
Throws:
java.lang.UnsupportedOperationException

equals

public boolean equals(java.lang.Object o)
Unsupported.

Specified by:
equals in interface java.util.Map<java.lang.String,java.lang.Object>
Overrides:
equals in class java.lang.Object
Throws:
java.lang.UnsupportedOperationException

get

public java.lang.Object get(java.lang.Object key)
Unsupported.

Specified by:
get in interface java.util.Map<java.lang.String,java.lang.Object>
Specified by:
get in interface javax.script.Bindings
Throws:
java.lang.UnsupportedOperationException

hashCode

public int hashCode()
Unsupported.

Specified by:
hashCode in interface java.util.Map<java.lang.String,java.lang.Object>
Overrides:
hashCode in class java.lang.Object
Throws:
java.lang.UnsupportedOperationException

isEmpty

public boolean isEmpty()
Unsupported.

Specified by:
isEmpty in interface java.util.Map<java.lang.String,java.lang.Object>
Throws:
java.lang.UnsupportedOperationException

keySet

public java.util.Set<java.lang.String> keySet()
Unsupported.

Specified by:
keySet in interface java.util.Map<java.lang.String,java.lang.Object>
Throws:
java.lang.UnsupportedOperationException

put

public java.lang.Object put(java.lang.String key,
                            java.lang.Object value)
Specified by:
put in interface java.util.Map<java.lang.String,java.lang.Object>
Specified by:
put in interface javax.script.Bindings

putAll

public void putAll(java.util.Map<? extends java.lang.String,? extends java.lang.Object> toMerge)
Specified by:
putAll in interface java.util.Map<java.lang.String,java.lang.Object>
Specified by:
putAll in interface javax.script.Bindings

remove

public java.lang.Object remove(java.lang.Object key)
Unsupported.

Specified by:
remove in interface java.util.Map<java.lang.String,java.lang.Object>
Specified by:
remove in interface javax.script.Bindings
Throws:
java.lang.UnsupportedOperationException

size

public int size()
Unsupported.

Specified by:
size in interface java.util.Map<java.lang.String,java.lang.Object>
Throws:
java.lang.UnsupportedOperationException

values

public java.util.Collection<java.lang.Object> values()
Unsupported.

Specified by:
values in interface java.util.Map<java.lang.String,java.lang.Object>
Throws:
java.lang.UnsupportedOperationException

getMyRuntime

public com.pdmfc.tea.runtime.STeaRuntime getMyRuntime()
                                               throws javax.script.ScriptException
Gets the STeaRuntime context. Initializes it for the 1st time, if needed.

Throws:
javax.script.ScriptException

getImportDirList

public java.util.List getImportDirList()
Returns:
_importDirList. This is the string list of directories/resource URLs that Tea will search to import a file. At the present, _importDirList is initialized in the constructor with the Tea core dir. When the 1st script is run, the Tea interpreter will search for an init.tea file in every directory, and execute it.

TeaEngine 0.7.0 Java Script API

© 2007 PDM&FC, All Rights Reserved.