SandMark version 2.0


sandmark.watermark.ct.encode
Class Encoder

java.lang.Object
  |
  +--sandmark.watermark.ct.encode.Encoder

public class Encoder
extends java.lang.Object

Main class for the encoder. Takes a sandmark.util.graph.Graph as input and returns a Java class ('Watermark.java') that builds this graph as output.


Constructor Summary
Encoder(Graph graph, java.util.Properties props)
          Called like this: sandmark.watermark.ct.encode.Encoder encoder = new sandmark.watermark.ct.encode.Encoder(graph,props); encoder.encode(); String javaFile = encoder.getSource(); de.fub.bytecode.generic.ClassGen byteCode = encoder.getByteCode(); try { String ClassName = props.getProperty("DWM_CT_Encode_ClassName"); cg.getJavaClass().dump(ClassName + ".class"); } catch (Exception e) { } The following properties should be defined:
 
Method Summary
(package private)  void dumpIR(java.lang.String header)
           
 void encode()
          Performs the actual encoding.
 de.fub.bytecode.generic.ClassGen getByteCode()
          Return the bytecode of the Watermark.java class.
 MethodID[] getCreateMethods()
          Return the names of the Create_graphX methods, in the order of which they should be called.
 java.lang.String[][] getCreateStorageMethods()
          Return the names and types of the CreateStorage_X methods.
 java.lang.String getSource()
          Return a string which is the source code of a Watermark.java class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Encoder

public Encoder(Graph graph,
               java.util.Properties props)
Called like this:
     sandmark.watermark.ct.encode.Encoder encoder = new sandmark.watermark.ct.encode.Encoder(graph,props);
     encoder.encode();
     String javaFile = encoder.getSource();
     de.fub.bytecode.generic.ClassGen byteCode = encoder.getByteCode();
     try {
        String ClassName = props.getProperty("DWM_CT_Encode_ClassName");
        cg.getJavaClass().dump(ClassName + ".class");
     } catch (Exception e) {
     }
 

The following properties should be defined:

Method Detail

encode

public void encode()
Performs the actual encoding.


getSource

public java.lang.String getSource()
Return a string which is the source code of a Watermark.java class.


getByteCode

public de.fub.bytecode.generic.ClassGen getByteCode()
Return the bytecode of the Watermark.java class.


getCreateMethods

public MethodID[] getCreateMethods()
Return the names of the Create_graphX methods, in the order of which they should be called. We return an array of MethodID objects.


getCreateStorageMethods

public java.lang.String[][] getCreateStorageMethods()
Return the names and types of the CreateStorage_X methods. We're returning an array of String quadrupes (methodName,returnType,localName, GLOBAL/LOCAL). methodName is the name of the method to call, returnType is the name of the storage type ("java.util.Vector") it will return, localName is the name of the local variable into which the return value should be stored.


dumpIR

void dumpIR(java.lang.String header)

SandMark version 2.0

Mon Jun 17 12:30:47 MST 2002