类 CodeWriter

java.lang.Object
gu.sql2java.generator.CodeWriter

public class CodeWriter extends Object
  • 字段详细资料

    • NEW_LINE

      public static final String NEW_LINE
    • DEFAULT_BINARY_TYPE

      protected static final String DEFAULT_BINARY_TYPE
      另请参阅:
    • DEFAULT_BITSTAE_TYPE

      protected static final String DEFAULT_BITSTAE_TYPE
      另请参阅:
    • props

      protected static Properties props
    • MGR_CLASS

      public static String MGR_CLASS
    • dateClassName

      protected static String dateClassName
    • timeClassName

      protected static String timeClassName
    • timestampClassName

      protected static String timestampClassName
    • binaryClassName

      public static String binaryClassName
      type for byte array,default 'byte[]',defined in properties
    • db

      protected static Database db
    • includeHash

      protected static Hashtable<String,String> includeHash
    • excludeHash

      protected static Hashtable<String,String> excludeHash
    • basePackage

      protected static String basePackage
    • destDir

      protected static String destDir
    • optimisticLockType

      protected static String optimisticLockType
    • optimisticLockColumn

      protected static String optimisticLockColumn
    • geometrySerialType

      protected static String geometrySerialType
    • classPrefix

      public static String classPrefix
    • vc

      protected org.apache.velocity.VelocityContext vc
    • table

      public Table table
    • current_vc

      protected org.apache.velocity.VelocityContext current_vc
  • 构造器详细资料

  • 方法详细资料

    • setDestinationFolder

      public void setDestinationFolder(String destDir) throws Exception
      抛出:
      Exception
    • checkTable

      public boolean checkTable(Table newTable) throws Exception
      抛出:
      Exception
    • checkDatabase

      public void checkDatabase() throws Exception
      抛出:
      Exception
    • process

      public void process() throws Exception
      抛出:
      Exception
    • writeComponent

      public void writeComponent(String templateName) throws Exception
      抛出:
      Exception
    • setCurrentFilename

      public void setCurrentFilename(String relpath_or_package, String fn) throws Exception
      抛出:
      Exception
    • setCurrentJavaFilename

      public void setCurrentJavaFilename(String relpath_or_package, String fn) throws Exception
      抛出:
      Exception
    • log

      public void log(String logStr)
    • getClassPrefix

      public static String getClassPrefix()
    • getDb

      public Database getDb()
    • getTables

      public List<Table> getTables()
    • getTable

      public Table getTable(String tableName)
    • getRelationTables

      public List<Table> getRelationTables()
    • tableName

      public String tableName()
    • getTable

      public Table getTable()
    • getProperty

      public static String getProperty(String key)
    • getProperty

      public static String getProperty(String key, String defaultVal)
    • getPropertyRequired

      public static String getPropertyRequired(String property)
    • getPropertyExploded

      public static String[] getPropertyExploded(String key)
    • getPropertyExplodedAsSet

      public static Set<String> getPropertyExplodedAsSet(String key)
    • getPropertyExplodedAsList

      public static List<String> getPropertyExplodedAsList(String key)
    • getPropertyExplodedAsList

      public static List<String> getPropertyExplodedAsList(String mkey, String defaultValue)
    • getPropertyExploded

      public static String[] getPropertyExploded(String mkey, String defaultValue)
    • getExplodedStringAsList

      public static List<String> getExplodedStringAsList(String value)
    • getExplodedString

      public static String[] getExplodedString(String value)
    • getPropertyBoolean

      public static boolean getPropertyBoolean(String value)
    • getPropertyInteger

      public static Integer getPropertyInteger(String value)
    • getClassLoadingPath

      public List<String> getClassLoadingPath()
    • getLoadingPathExt

      public List<String> getLoadingPathExt()
    • getSchemaTemplates

      public String[] getSchemaTemplates(String property)
    • getTableTemplates

      public String[] getTableTemplates(String property)
    • getTemplates

      public String[] getTemplates(String property, boolean perShema)
    • recurseTemplate

      public Vector<String> recurseTemplate(Vector<String> files, String folder, boolean perSchema)
    • authorizeProcess

      public static boolean authorizeProcess(String autorizePattern, String includeProperty, String excludeProperty)
    • folderContainsPattern

      public static boolean folderContainsPattern(String folder, String[] patterns)
    • authorizeFile

      public static boolean authorizeFile(String folder, String schemaOrTable)
    • getBinaryClassName

      public static String getBinaryClassName()
    • isByteBufferAsString

      public static boolean isByteBufferAsString()
    • getBitStateClassName

      public static String getBitStateClassName()
    • getBitStateClassWrapName

      public static String getBitStateClassWrapName()
    • getBitStateClass

      public Class<?> getBitStateClass()
    • getBitStateClassSize

      public static int getBitStateClassSize()
    • getBitStateConstSuffix

      public static String getBitStateConstSuffix()
    • getBitStateMask

      public static int getBitStateMask()
    • getBitStateMaskHex

      public static String getBitStateMaskHex()
    • getBitStateClassShift

      public static int getBitStateClassShift()
    • binaryIsByteBuffer

      public static boolean binaryIsByteBuffer()
    • getExtensionPkg

      public static String getExtensionPkg()
    • setSaveCurrentFile

      public void setSaveCurrentFile(boolean save_current_fullfile)
    • loadExtensionClass

      public static Class<?> loadExtensionClass(String classname) throws ClassNotFoundException
      加载指定的类
      读取 'extension.tools.libdirs','extension.tools.classpath'分别对应libdirs,classpath参数
      如果上述property都没有定义则抛出异常
      参数:
      classname -
      返回:
      加载的类
      抛出:
      ClassNotFoundException
    • loadTool

      使用当前类的class loader加载工具对象
      参数:
      classname -
      返回:
      创建的对象
      抛出:
      ClassNotFoundException
      InstantiationException
      IllegalAccessException
    • getSourceFile

      public static String getSourceFile(String baseDir, Class<?> clazz)
      返回类的源文件位置
      参数:
      baseDir - 源文件夹
      clazz -
    • getFillNull

      public static Boolean getFillNull()
    • setFillNull

      public static void setFillNull(Boolean fill)
    • isJsonJacksonRawValue

      public static boolean isJsonJacksonRawValue()
    • isJacksonClassDeserializer

      public static boolean isJacksonClassDeserializer()
      从以下版本开始:
      3.21.3
    • isFastjsonClassDeserializer

      public static boolean isFastjsonClassDeserializer()
      从以下版本开始:
      3.21.3
    • getGeometrySerialType

      public static String getGeometrySerialType()
    • getSuperClassPackage

      public static String getSuperClassPackage()
      从以下版本开始:
      3.31.0
    • getSuperClassTablenames

      public static Set<String> getSuperClassTablenames()
      从以下版本开始:
      3.31.0
    • getSuperClassTables

      public static Table[] getSuperClassTables()
      从以下版本开始:
      3.31.0
    • getSamePrefixOfSuperClassTables

      public static String getSamePrefixOfSuperClassTables()
      从以下版本开始:
      3.31.0