📄 schemagenerator.java
字号:
// Copyright 2000-2001, Hansky Inc. All Rights Reserved.// Confidential and Propritary Information of Hansky, Inc.// @(#)SchemaGenerator.java, 1.0, 03/28/2001package com.hansky.tools.codewizard;import java.io.*;import java.util.*;import com.hansky.intf.chtml.*;import com.hansky.util.*;/** * A class generator which creates database schema. * * @author Kaiyang Liu * @version 1.0, 03/28/2001 */public class SchemaGenerator extends CodeWizard { public SchemaGenerator() { super(); } protected void doit() { for (Enumeration e = props.keys(); e.hasMoreElements();) { String s = (String)e.nextElement(); if ("fields".equals(s)) { printFields(); } else { printValue(s); } } } /** * The data format for fields is like: * name,String,col_name,SQLType,SchemaType */ void printFields() { StringBuffer sb = new StringBuffer(4096); // read fieldName|javaType String pairs[] = StringUtil.split(props.getProperty("fields"), ", \t"); // print field declaration part for (int i = 0; i < pairs.length; i+=5) { String column = pairs[i+2]; String type = pairs[i+4]; sb.append("\t" + column + "\t\t" + type); if (i < (pairs.length - 5)) { sb.append(",\n"); } } values.put("main", sb.toString()); } public static void main(String argv[]) throws IOException { new SchemaGenerator().start(argv); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -