Package org.adempiere.util
Class ModelInterfaceGenerator
- java.lang.Object
-
- org.adempiere.util.ModelInterfaceGenerator
-
public class ModelInterfaceGenerator extends Object
- Version:
- $Id$
- Author:
- Trifon Trifonov, Teo Sarca, SC ARHIPAC SERVICE SRL
- BF [ 1781629 ] Don't use Env.NL in model class/interface generators
- FR [ 1781630 ] Generated class/interfaces have a lot of unused imports
- BF [ 1781632 ] Generated class/interfaces should be UTF-8
- better formating of generated source
- BF [ 1787833 ] ModelInterfaceGenerator: don't write timestamp
- FR [ 1803309 ] Model generator: generate get method for Search cols
- BF [ 1817768 ] Isolate hardcoded table direct columns https://sourceforge.net/p/adempiere/bugs/827/
- FR [ 2343096 ] Model Generator: Improve Reference Class Detection
- BF [ 2528434 ] ModelInterfaceGenerator: generate getters for common fields
- --
- FR [ 2848449 ] ModelClassGenerator: Implement model getters https://sourceforge.net/p/adempiere/feature-requests/812/, Teo Sarca, teo.sarca@gmail.com
- FR [ 3020635 ] Model Generator should use FQ class names https://sourceforge.net/p/adempiere/feature-requests/987/, Victor Perez, e-Evolution
- FR [ 1785001 ] Using ModelPackage of EntityType to Generate Model Class
-
-
Constructor Summary
Constructors Constructor Description ModelInterfaceGenerator(int AD_Table_ID, String directory, String packageName, String entityTypeFilter)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
generateJavaComment(String startOfComment, String propertyName, String description, StringBuilder result)
static void
generateSource(String sourceFolder, String packageName, String entityType, String tableName, String columnEntityType)
static Class<?>
getClass(String columnName, int displayType, int AD_Reference_ID)
Get class for given display type and referencestatic String
getDataTypeName(Class<?> cl, int displayType)
static String
getFieldName(String columnName)
static String
getModelPackage(String entityType)
Get EntityType Model Package.static String
getReferenceClassName(int AD_Table_ID, String columnName, int displayType, int AD_Reference_ID)
static boolean
isGenerateModelGetter(String columnName)
static boolean
isGenerateModelGetterForEntity(int AD_Table_ID, String toEntityType)
static boolean
isGenerateSetter(String columnName)
String
toString()
String representation
-
-
-
Field Detail
-
NL
public static final String NL
- See Also:
- Constant Field Values
-
COPY
public static final String COPY
File Header- See Also:
- Constant Field Values
-
-
Method Detail
-
generateJavaComment
public void generateJavaComment(String startOfComment, String propertyName, String description, StringBuilder result)
-
getClass
public static Class<?> getClass(String columnName, int displayType, int AD_Reference_ID)
Get class for given display type and reference- Parameters:
displayType
-AD_Reference_ID
-- Returns:
- class
-
isGenerateSetter
public static boolean isGenerateSetter(String columnName)
- Parameters:
columnName
-- Returns:
- true if a setter method should be generated
-
isGenerateModelGetter
public static boolean isGenerateModelGetter(String columnName)
- Parameters:
columnName
-- Returns:
- true if a model getter method (method that is returning referenced PO) should be generated
-
isGenerateModelGetterForEntity
public static boolean isGenerateModelGetterForEntity(int AD_Table_ID, String toEntityType)
- Parameters:
AD_Table_ID
-toEntityType
-- Returns:
- true if a model getter method (method that is returning referenced PO) should be generated
-
getModelPackage
public static String getModelPackage(String entityType)
Get EntityType Model Package. author Victor Perez - [ 1785001 ] Using ModelPackage of EntityType to Generate Model Class- Parameters:
entityType
-- Returns:
-
getReferenceClassName
public static String getReferenceClassName(int AD_Table_ID, String columnName, int displayType, int AD_Reference_ID)
-
toString
public String toString()
String representation
-
-