Tea Java Runtime API
Version 3.2.5

com.pdmfc.tea.tos
Class STosJavaClass

java.lang.Object
  extended by com.pdmfc.tea.tos.STosJavaClass
All Implemented Interfaces:
STosClass

public class STosJavaClass
extends java.lang.Object
implements STosClass

A TOS class implemented as a Java class.

If the Java class has a static method named "getTosClassName()" returning a string then that method will be invoked and its return value will be used as the name of the TOS class.


Field Summary
 
Fields inherited from interface com.pdmfc.tea.tos.STosClass
CONSTRUCTOR_NAME
 
Constructor Summary
STosJavaClass(java.lang.Class javaClass)
           
STosJavaClass(java.lang.String javaClassName)
           
 
Method Summary
 void addMethod(SObjSymbol methodName, STosMethod method)
          Associates a new TOS method with this TOS class.
 STosMethod getConstructor()
          Fetches the constructor method for this TOS class.
 SObjSymbol[] getMemberNames()
          Fetches the member names for this TOS class.
 STosMethod getMethod(SObjSymbol methodName)
          Fecthes the named method.
 java.util.Iterator getMethods()
          Fetches all the methods this TOS class implements.
 java.lang.String getName()
          Fetches the name associated with this TOS class.
 STosClass getSuperClass()
          Retrieves the TOS base class of this TOS class.
 STosObj newInstance(SContext context, java.lang.Object[] args)
          Creates a new instance of an object of this TOS class.
 void setConstructor(STosMethod method)
          Specifies the constructor for this TOS class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

STosJavaClass

public STosJavaClass(java.lang.String javaClassName)
              throws SRuntimeException
Throws:
SRuntimeException

STosJavaClass

public STosJavaClass(java.lang.Class javaClass)
              throws SRuntimeException
Throws:
SRuntimeException
Method Detail

getSuperClass

public STosClass getSuperClass()
Description copied from interface: STosClass
Retrieves the TOS base class of this TOS class.

Specified by:
getSuperClass in interface STosClass
Returns:
The null value, meaning this TOS class has no base class.

getMemberNames

public SObjSymbol[] getMemberNames()
Fetches the member names for this TOS class. It has no members, so it just returns an empty array of member names.

Specified by:
getMemberNames in interface STosClass
Returns:
An empty array, meaning this TOS class does not define any members.

setConstructor

public void setConstructor(STosMethod method)
Specifies the constructor for this TOS class.

Specified by:
setConstructor in interface STosClass
Parameters:
method - A reference to the SObjFunction object that implements the TOS method.

getConstructor

public STosMethod getConstructor()
Description copied from interface: STosClass
Fetches the constructor method for this TOS class.

Specified by:
getConstructor in interface STosClass
Returns:
The STosMethod object corresponding to the constructor method for this TOS class. The null object is returned if this TOS class has no constructor.

addMethod

public void addMethod(SObjSymbol methodName,
                      STosMethod method)
Associates a new TOS method with this TOS class. If a method with the same name already existed then it is superceded by this new method.

Specified by:
addMethod in interface STosClass
Parameters:
methodName - A symbol standing for the name of the method being defined.
method - A reference to the SObjFunction object that implements the TOS method.

getMethod

public STosMethod getMethod(SObjSymbol methodName)
                     throws SNoSuchMethodException
Fecthes the named method.

Specified by:
getMethod in interface STosClass
Returns:
The STosMethod of this TOS class named methodName.
Throws:
SNoSuchMethodException - Thrown if there is no name in this tos class named methodName.

getMethods

public java.util.Iterator getMethods()
Description copied from interface: STosClass
Fetches all the methods this TOS class implements. These methods will include all the methods of the base classes.

Specified by:
getMethods in interface STosClass
Returns:
A java.util.Iterator containing the all the STosMethods associated with this TOS class.

newInstance

public STosObj newInstance(SContext context,
                           java.lang.Object[] args)
                    throws STeaException
Description copied from interface: STosClass
Creates a new instance of an object of this TOS class.

Specified by:
newInstance in interface STosClass
Returns:
A new STosObj object, representing a new instance of this TOS class.
Throws:
STeaException - Throw if there were any problems instantiating the new object.

getName

public java.lang.String getName()
Description copied from interface: STosClass
Fetches the name associated with this TOS class.

Specified by:
getName in interface STosClass
Returns:
The name associated with the class.

Tea Java Runtime API
Version 3.2.5

© 2009 PDM&FC, All Rights Reserved.