org.apache.cayenne.gen
Class MapClassGenerator

java.lang.Object
  extended by org.apache.cayenne.gen.MapClassGenerator
Direct Known Subclasses:
DefaultClassGenerator

Deprecated. since 3.0 use ClassGenerationAction and subclasses.

public abstract class MapClassGenerator
extends Object

Generates Java source code for ObjEntities in the DataMap. This class is abstract and does not deal with filesystem issues directly. Concrete subclasses should provide ways to store generated files by implementing openWriter(ObjEntity, String, String) and closeWriter(Writer) methods.


Field Summary
protected  boolean client
          Deprecated.  
static String CLIENT_SUBCLASS_TEMPLATE_1_2
          Deprecated.  
static String CLIENT_SUPERCLASS_TEMPLATE_1_2
          Deprecated.  
protected  DataMap dataMap
          Deprecated.  
static String DEFAULT_VERSION
          Deprecated.  
protected  String mode
          Deprecated.  
static String MODE_DATAMAP
          Deprecated.  
static String MODE_ENTITY
          Deprecated.  
protected  List<ObjEntity> objEntities
          Deprecated.  
static String SINGLE_CLASS_TEMPLATE
          Deprecated.  
static String SINGLE_CLASS_TEMPLATE_1_1
          Deprecated.  
static String SINGLE_CLASS_TEMPLATE_1_2
          Deprecated.  
static String SUBCLASS_TEMPLATE
          Deprecated.  
static String SUBCLASS_TEMPLATE_1_1
          Deprecated.  
static String SUBCLASS_TEMPLATE_1_2
          Deprecated.  
static String SUPERCLASS_PREFIX
          Deprecated.  
static String SUPERCLASS_TEMPLATE
          Deprecated.  
static String SUPERCLASS_TEMPLATE_1_1
          Deprecated.  
static String SUPERCLASS_TEMPLATE_1_2
          Deprecated.  
protected  String superPkg
          Deprecated.  
protected static String VERSION_1_1
          Deprecated.  
protected static String VERSION_1_2
          Deprecated.  
protected  String versionString
          Deprecated.  
protected  foundrylogic.vpp.VPPConfig vppConfig
          Deprecated.  
 
Constructor Summary
MapClassGenerator()
          Deprecated.  
MapClassGenerator(DataMap dataMap)
          Deprecated. since 3.0 - unused.
MapClassGenerator(DataMap dataMap, List<ObjEntity> objEntities)
          Deprecated. Creates a new MapClassGenerator.
 
Method Summary
abstract  void closeWriter(Writer out)
          Deprecated. Closes writer after class code has been successfully written by ClassGenerationInfo.
protected  String defaultSingleClassTemplate()
          Deprecated.  
protected  String defaultSubclassTemplate()
          Deprecated.  
protected  String defaultSuperclassTemplate()
          Deprecated.  
 void generateClassPairs()
          Deprecated. since 3.0 - unused
 void generateClassPairs(String classTemplate, String superTemplate, String superPrefix)
          Deprecated. Runs class generation.
 void generateSingleClasses()
          Deprecated. since 3.0 - unused.
 void generateSingleClasses(String classTemplate, String superPrefix)
          Deprecated. Runs class generation.
 DataMap getDataMap()
          Deprecated.  
 List<ObjEntity> getObjEntities()
          Deprecated.  
 String getSuperPkg()
          Deprecated. Returns "superPkg" property value - a name of a superclass package that should be used for all generated superclasses.
 String getVersionString()
          Deprecated.  
 foundrylogic.vpp.VPPConfig getVppConfig()
          Deprecated.  
protected  void initClassGenerator_1_1(ClassGenerationInfo gen, ObjEntity entity, boolean superclass)
          Deprecated. Initializes ClassGenerationInfo with class name and package of a generated class.
 boolean isClient()
          Deprecated. Returns whether a default client object template will be used.
abstract  Writer openWriter(ObjEntity entity, String pkgName, String className)
          Deprecated. Creates a Writer to output source code for a given ObjEntity and Java class.
 void setClient(boolean client)
          Deprecated. Sets whether a default client object template should be used.
 void setDataMap(DataMap dataMap)
          Deprecated.  
 void setMode(String mode)
          Deprecated.  
 void setObjEntities(List<ObjEntity> objEntities)
          Deprecated. Initializes internal ObjEntities list.
 void setSuperPkg(String superPkg)
          Deprecated. Sets "superPkg" property value.
 void setVersionString(String versionString)
          Deprecated.  
 void setVppConfig(foundrylogic.vpp.VPPConfig vppConfig)
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SINGLE_CLASS_TEMPLATE_1_1

public static final String SINGLE_CLASS_TEMPLATE_1_1
Deprecated. 
See Also:
Constant Field Values

SUBCLASS_TEMPLATE_1_1

public static final String SUBCLASS_TEMPLATE_1_1
Deprecated. 
See Also:
Constant Field Values

SUPERCLASS_TEMPLATE_1_1

public static final String SUPERCLASS_TEMPLATE_1_1
Deprecated. 
See Also:
Constant Field Values

SINGLE_CLASS_TEMPLATE_1_2

public static final String SINGLE_CLASS_TEMPLATE_1_2
Deprecated. 
See Also:
Constant Field Values

SUBCLASS_TEMPLATE_1_2

public static final String SUBCLASS_TEMPLATE_1_2
Deprecated. 
See Also:
Constant Field Values

SUPERCLASS_TEMPLATE_1_2

public static final String SUPERCLASS_TEMPLATE_1_2
Deprecated. 
See Also:
Constant Field Values

CLIENT_SUBCLASS_TEMPLATE_1_2

public static final String CLIENT_SUBCLASS_TEMPLATE_1_2
Deprecated. 
Since:
1.2
See Also:
Constant Field Values

CLIENT_SUPERCLASS_TEMPLATE_1_2

public static final String CLIENT_SUPERCLASS_TEMPLATE_1_2
Deprecated. 
Since:
1.2
See Also:
Constant Field Values

SINGLE_CLASS_TEMPLATE

public static final String SINGLE_CLASS_TEMPLATE
Deprecated. 
See Also:
Constant Field Values

SUBCLASS_TEMPLATE

public static final String SUBCLASS_TEMPLATE
Deprecated. 
See Also:
Constant Field Values

SUPERCLASS_TEMPLATE

public static final String SUPERCLASS_TEMPLATE
Deprecated. 
See Also:
Constant Field Values

SUPERCLASS_PREFIX

public static final String SUPERCLASS_PREFIX
Deprecated. 
See Also:
Constant Field Values

VERSION_1_1

protected static final String VERSION_1_1
Deprecated. 
See Also:
Constant Field Values

VERSION_1_2

protected static final String VERSION_1_2
Deprecated. 
See Also:
Constant Field Values

DEFAULT_VERSION

public static final String DEFAULT_VERSION
Deprecated. 
See Also:
Constant Field Values

MODE_DATAMAP

public static final String MODE_DATAMAP
Deprecated. 
See Also:
Constant Field Values

MODE_ENTITY

public static final String MODE_ENTITY
Deprecated. 
See Also:
Constant Field Values

versionString

protected String versionString
Deprecated. 

objEntities

protected List<ObjEntity> objEntities
Deprecated. 

superPkg

protected String superPkg
Deprecated. 

dataMap

protected DataMap dataMap
Deprecated. 

vppConfig

protected foundrylogic.vpp.VPPConfig vppConfig
Deprecated. 

mode

protected String mode
Deprecated. 

client

protected boolean client
Deprecated. 
Constructor Detail

MapClassGenerator

public MapClassGenerator()
Deprecated. 

MapClassGenerator

public MapClassGenerator(DataMap dataMap)
Deprecated. since 3.0 - unused.


MapClassGenerator

public MapClassGenerator(DataMap dataMap,
                         List<ObjEntity> objEntities)
Deprecated. 
Creates a new MapClassGenerator.

Since:
1.2
Method Detail

defaultSingleClassTemplate

protected String defaultSingleClassTemplate()
Deprecated. 

defaultSubclassTemplate

protected String defaultSubclassTemplate()
Deprecated. 

defaultSuperclassTemplate

protected String defaultSuperclassTemplate()
Deprecated. 

openWriter

public abstract Writer openWriter(ObjEntity entity,
                                  String pkgName,
                                  String className)
                           throws Exception
Deprecated. 
Creates a Writer to output source code for a given ObjEntity and Java class.

Returns:
Writer to store generated class source code or null if this class generation should be skipped.
Throws:
Exception

closeWriter

public abstract void closeWriter(Writer out)
                          throws Exception
Deprecated. 
Closes writer after class code has been successfully written by ClassGenerationInfo.

Throws:
Exception

generateClassPairs

public void generateClassPairs()
                        throws Exception
Deprecated. since 3.0 - unused

Runs class generation. Produces a pair of Java classes for each ObjEntity in the map. Uses default Cayenne templates for classes.

Throws:
Exception

generateClassPairs

public void generateClassPairs(String classTemplate,
                               String superTemplate,
                               String superPrefix)
                        throws Exception
Deprecated. 
Runs class generation. Produces a pair of Java classes for each ObjEntity in the map. This allows developers to use generated subclass for their custom code, while generated superclass will contain Cayenne code. Superclass will be generated in the same package, its class name will be derived from the class name by adding a superPrefix.

Throws:
Exception

generateSingleClasses

public void generateSingleClasses()
                           throws Exception
Deprecated. since 3.0 - unused.

Runs class generation. Produces a single Java class for each ObjEntity in the map. Uses default Cayenne templates for classes.

Throws:
Exception

generateSingleClasses

public void generateSingleClasses(String classTemplate,
                                  String superPrefix)
                           throws Exception
Deprecated. 
Runs class generation. Produces a single Java class for each ObjEntity in the map.

Throws:
Exception

initClassGenerator_1_1

protected void initClassGenerator_1_1(ClassGenerationInfo gen,
                                      ObjEntity entity,
                                      boolean superclass)
Deprecated. 
Initializes ClassGenerationInfo with class name and package of a generated class.


getSuperPkg

public String getSuperPkg()
Deprecated. 
Returns "superPkg" property value - a name of a superclass package that should be used for all generated superclasses.


setSuperPkg

public void setSuperPkg(String superPkg)
Deprecated. 
Sets "superPkg" property value.


isClient

public boolean isClient()
Deprecated. 
Returns whether a default client object template will be used.

Since:
1.2

setClient

public void setClient(boolean client)
Deprecated. 
Sets whether a default client object template should be used.

Since:
1.2

getDataMap

public DataMap getDataMap()
Deprecated. 
Returns:
Returns the dataMap.

setDataMap

public void setDataMap(DataMap dataMap)
Deprecated. 
Parameters:
dataMap - The dataMap to set.

getObjEntities

public List<ObjEntity> getObjEntities()
Deprecated. 

setObjEntities

public void setObjEntities(List<ObjEntity> objEntities)
Deprecated. 
Initializes internal ObjEntities list. This method creates a copy of the provided list to allow its independent modification and also filters out entities that do not require class generation.


getVersionString

public String getVersionString()
Deprecated. 
Returns:
Returns the versionString.

setVersionString

public void setVersionString(String versionString)
Deprecated. 
Parameters:
versionString - The versionString to set.

getVppConfig

public foundrylogic.vpp.VPPConfig getVppConfig()
Deprecated. 
Returns:
Returns the vppConfig.

setVppConfig

public void setVppConfig(foundrylogic.vpp.VPPConfig vppConfig)
Deprecated. 
Parameters:
vppConfig - The vppConfig to set.

setMode

public void setMode(String mode)
Deprecated. 
Parameters:
mode - use "entity" for per-entity generation and "datamap" for per-datamap generation.


Copyright © 2001-2008 Apache Cayenne. All Rights Reserved.