ijgen.generator.model
Class ClassDefinition

java.lang.Object
  extended by ijgen.generator.model.ClassDefinition

public class ClassDefinition
extends java.lang.Object

Class holding the meta-data for an domain object. Meta-data is loaded via java reflection API from annotated java files. This is the main class used by the generator to obtain information about the generated artifacts.

Author:
Detelin Zlatev

Constructor Summary
ClassDefinition()
          Default constructor
 
Method Summary
 void addFieldDefinition(FieldDefinition fieldDefinition)
          Sets a list of all definitions for all the fields in this class.
 java.lang.String getClassName()
          Gets the name of the class
 java.lang.String getDbTable()
          Gets the name of the database table which will be used for persisting this class.
 java.util.List<FieldDefinition> getFieldDefinitions()
          Gets a list of all definitions for all the fields in this class.
 java.lang.String getGeneratedClassName(java.lang.String templateName)
          Gets the name of the class that should be used in the generated artifacts.
 java.util.Map<java.lang.String,java.lang.String> getGeneratedLayersFileNamesSuffixes()
          Gets the map that holds a information about suffixes that has to be appended to the generated artifacts for the specified templates.
 java.lang.String getPackageName()
          Gets the name of the package for generated artifacts for this class
 java.util.List<java.lang.String> getSkipLayers()
          Gets a list of template names that has to be skipped by the generator for this class.
 void setClassName(java.lang.String className)
          Sets the name of the class.
 void setDbTable(java.lang.String dbTable)
          Sets the name of the database table which will be used for persisting this class.
 void setGeneratedLayersFileNamesSuffixes(java.util.Map<java.lang.String,java.lang.String> generatedLayersFileNamesSuffixes)
          Gets the map that holds a information about suffixes that has to be appended to the generated artifacts for the specified templates.
 void setPackageName(java.lang.String packageName)
          Sets the name of the package for generated artifacts for this class
 void setSkipLayers(java.util.List<java.lang.String> skipLayers)
          Sets a list of template names that has to be skipped by the generator for this class.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClassDefinition

public ClassDefinition()
Default constructor

Method Detail

getClassName

public java.lang.String getClassName()
Gets the name of the class

Returns:
name of the class

getGeneratedClassName

public final java.lang.String getGeneratedClassName(java.lang.String templateName)
Gets the name of the class that should be used in the generated artifacts. The rule is as follows:
If a specific suffix is defined in the "generatedLayersFileNamesSuffixes" setting then the name will be ClassName + suffix. Note that the first symbol of the templateName will be capitalized.
Is there is no such suffix defined - then the name will be: ClassName + templateName. Note that the first symbol of the templateName will be capitalized.

Parameters:
templateName -
Returns:

setClassName

public void setClassName(java.lang.String className)
Sets the name of the class.

Parameters:
className - name of the class

getPackageName

public java.lang.String getPackageName()
Gets the name of the package for generated artifacts for this class

Returns:
package name

setPackageName

public void setPackageName(java.lang.String packageName)
Sets the name of the package for generated artifacts for this class

Parameters:
packageName - package name

getDbTable

public java.lang.String getDbTable()
Gets the name of the database table which will be used for persisting this class.

Returns:
name of the table

setDbTable

public void setDbTable(java.lang.String dbTable)
Sets the name of the database table which will be used for persisting this class.

Parameters:
dbTable - name of the table

getSkipLayers

public java.util.List<java.lang.String> getSkipLayers()
Gets a list of template names that has to be skipped by the generator for this class.

Returns:
list of the templates to be skipped

setSkipLayers

public void setSkipLayers(java.util.List<java.lang.String> skipLayers)
Sets a list of template names that has to be skipped by the generator for this class.

Parameters:
skipLayers - list of the templates to be skipped

getGeneratedLayersFileNamesSuffixes

public java.util.Map<java.lang.String,java.lang.String> getGeneratedLayersFileNamesSuffixes()
Gets the map that holds a information about suffixes that has to be appended to the generated artifacts for the specified templates.

Returns:
template suffixes

setGeneratedLayersFileNamesSuffixes

public void setGeneratedLayersFileNamesSuffixes(java.util.Map<java.lang.String,java.lang.String> generatedLayersFileNamesSuffixes)
Gets the map that holds a information about suffixes that has to be appended to the generated artifacts for the specified templates.

Parameters:
generatedLayersFileNamesSuffixes - template suffixes

getFieldDefinitions

public java.util.List<FieldDefinition> getFieldDefinitions()
Gets a list of all definitions for all the fields in this class.

Returns:
list of field definitions

addFieldDefinition

public void addFieldDefinition(FieldDefinition fieldDefinition)
Sets a list of all definitions for all the fields in this class.

Parameters:
fieldDefinition - list of field definitions

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object


Copyright © 2010 Detelin Zlatev. All Rights Reserved.