SandMark version 3.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, by splitting the graph in DWM_CT_Encode_Components number of components converting the components to intermediate code converting the intermediate code to Java bytecode.
 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.
 Graph getGraph()
          Return the watermark graph.
 java.lang.String getSource()
          Return a string which is the source code of a Watermark.java class.
 Graph[] getSubGraphs()
          Return the watermark subgraphs.
 
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, by
  1. splitting the graph in DWM_CT_Encode_Components number of components
  2. converting the components to intermediate code
  3. converting the intermediate code to Java bytecode.


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.


getGraph

public Graph getGraph()
Return the watermark graph.


getSubGraphs

public Graph[] getSubGraphs()
Return the watermark subgraphs.


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 3.0

Wed Jan 29 10:30:05 MST 2003