Tea Java Runtime API
Version 3.2.4

com.pdmfc.tea.modules.tos
Class STosUtil

java.lang.Object
  extended by com.pdmfc.tea.modules.tos.STosUtil

public class STosUtil
extends java.lang.Object

This class implements some utility methods to be used by derived classes.


Field Summary
static SObjSymbol CALLBACK_NAME
          The name of variable with the missing function callback action.
 
Constructor Summary
STosUtil()
           
 
Method Summary
static STosClass getClass(SContext context, java.lang.Object[] args, int index)
          Retrieves an STosClass object.
static STosClass getClass(SContext context, SObjSymbol className)
          Fetches a class object.
static STosObj getTosObj(java.lang.Object[] args, int index)
          Tries to cast one of the elements in the args array into an STosObj.
static STosObj newInstance(SObjSymbol className, SContext context)
           
static STosObj newInstance(SObjSymbol className, SContext context, java.lang.Object[] constructorArgs)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CALLBACK_NAME

public static final SObjSymbol CALLBACK_NAME
The name of variable with the missing function callback action.

Constructor Detail

STosUtil

public STosUtil()
Method Detail

getTosObj

public static STosObj getTosObj(java.lang.Object[] args,
                                int index)
                         throws STypeException
Tries to cast one of the elements in the args array into an STosObj.

Parameters:
args - Array of STObj that is tipically the array of arguments passed to a Tea function.
index - Index into the args array of the element to fetch.
Returns:
The element at the index position of the args array.
Throws:
com.pdmfc.tea.runtime.STTypeException - Throw if the element at the index position of the args array is not an STosObj.
STypeException

getClass

public static STosClass getClass(SContext context,
                                 java.lang.Object[] args,
                                 int index)
                          throws STeaException
Retrieves an STosClass object. This is referenced by args[index], which is either the STosClass object we are looking for or a symbol. In this later case there should be a variable referenced by that symbol containing the STosClass.

Parameters:
context - The context where we will look for a variable, if necessary.
args - Array of to a function or method call.
index - An index into the args array.
Throws:
com.pdmfc.tea.modules.tos.STosNoSuchClassException - Thrown if the STosClass object could not be retrieved.
STeaException

getClass

public static STosClass getClass(SContext context,
                                 SObjSymbol className)
                          throws STeaException
Fetches a class object.

Parameters:
context - Context where the class will be searched and its constructor invoked.
className - Symbol identifying the class.
Throws:
STeaException

newInstance

public static STosObj newInstance(SObjSymbol className,
                                  SContext context,
                                  java.lang.Object[] constructorArgs)
                           throws STeaException
Throws:
STeaException

newInstance

public static STosObj newInstance(SObjSymbol className,
                                  SContext context)
                           throws STeaException
Throws:
STeaException

Tea Java Runtime API
Version 3.2.4

© 2009 PDM&FC, All Rights Reserved.