xmltool.codegen
Class GenerateCode

java.lang.Object
  |
  +--xmltool.codegen.GenerateCode

public class GenerateCode
extends java.lang.Object

Generate the query needed in 3 sections as for any general query , Select...From...Where... Currently there is support only for a query w/o join, but provision is made to extend the same code for query on more than one DTD with a join condition. The PoetGenerateCode class calls this class to do the actual work.


Constructor Summary
GenerateCode(Node[] node, int numNodes, Link[] link, int numLinks)
          Called by PoetGenerateCode after the generate button is pressed
 
Method Summary
 void analyzeProject()
          Modifies the Project condition formed by evaluation of query node to suit Poet datatypes
 java.lang.String getFrom()
          Returns the FROM condition formed by evaluation of query node
 java.lang.String getProject()
          Returns the Projection (SELECT in SQL) formed by evaluation of query node
 java.lang.String getSelect()
          Returns the Selection (WHERE in SQL) formed by evaluation of query node
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenerateCode

public GenerateCode(Node[] node,
                    int numNodes,
                    Link[] link,
                    int numLinks)
Called by PoetGenerateCode after the generate button is pressed
Parameters:
node[] - all the nodes
numNodes - Number of nodes
link[] - all the links
Method Detail

getFrom

public java.lang.String getFrom()
Returns the FROM condition formed by evaluation of query node
Returns:
String The FROM condition formed

getProject

public java.lang.String getProject()
Returns the Projection (SELECT in SQL) formed by evaluation of query node
Returns:
String The Project condition formed

analyzeProject

public void analyzeProject()
Modifies the Project condition formed by evaluation of query node to suit Poet datatypes

getSelect

public java.lang.String getSelect()
Returns the Selection (WHERE in SQL) formed by evaluation of query node
Returns:
String The Select condition formed