iitb.con.net.codegenerator
Class CodeGenerator

java.lang.Object
  extended by iitb.con.net.codegenerator.CodeGenerator

public class CodeGenerator
extends java.lang.Object

CodeGenerator generates java code for the given Type, it may be Entity or Relation. The generated java class will be used for instantiating the type. User can import these generated classes into their development environment to instantiate the types.


Method Summary
 boolean generateCode(java.lang.String path, Entity entity)
          Generates the code for Entity type
 boolean generateCode(java.lang.String path, Relation relation, java.lang.String leftEntityName, java.lang.String rightEntityName)
          Generates the code for Relation type
static CodeGenerator getInstance()
          Method to facilitate the singelton
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

generateCode

public boolean generateCode(java.lang.String path,
                            Entity entity)
Generates the code for Entity type

Parameters:
path - path location where the java file to be created
entity - Entity
Returns:
true on success

generateCode

public boolean generateCode(java.lang.String path,
                            Relation relation,
                            java.lang.String leftEntityName,
                            java.lang.String rightEntityName)
Generates the code for Relation type

Parameters:
path - path location where the java file to be created
relation - Relation
leftEntityName - name of relation's left entity
rightEntityName - name of relation's right entity
Returns:
true on success

getInstance

public static CodeGenerator getInstance()
Method to facilitate the singelton

Returns:
the CodeGenerator instance