Class 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 Detail

      • ModelInterfaceGenerator

        public ModelInterfaceGenerator​(int AD_Table_ID,
                                       String directory,
                                       String packageName,
                                       String entityTypeFilter)
        Parameters:
        AD_Table_ID -
        directory -
        packageName -
        entityTypeFilter - entity type filter for column
    • Method Detail

      • 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
      • getDataTypeName

        public static String getDataTypeName​(Class<?> cl,
                                             int displayType)
      • 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:
      • getFieldName

        public static String getFieldName​(String columnName)
      • getReferenceClassName

        public static String getReferenceClassName​(int AD_Table_ID,
                                                   String columnName,
                                                   int displayType,
                                                   int AD_Reference_ID)
      • toString

        public String toString()
        String representation
        Overrides:
        toString in class Object
        Returns:
        string representation
      • generateSource

        public static void generateSource​(String sourceFolder,
                                          String packageName,
                                          String entityType,
                                          String tableName,
                                          String columnEntityType)
        Parameters:
        sourceFolder -
        packageName -
        entityType -
        tableName - table Like
        columnEntityType -