`
文章列表
We usually use List<Item> it is complete support. and We also usually use Map<item.id,Item>, this hasn't original support. package ycl.learn.xml.jaxb.map; import java.util.HashMap; import java.util.Map; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotati ...
Xsd to java Object. right, use xsd to definition the xml 's struction, then generator the Java construction. right, when you generator the Java construction, then fill the Object some data, then can generator the xml what the xsd defnied. <?xml version="1.0" encoding="UTF-8&quo ...
sometimes i also doubt what XmlAdapter do. 1. format the String to anyType you want.[data] 2. split the String, and set every part to Object.[interesting] 3. retrieve the ref's datas to owner Object properties. ... package ycl.learn.xml.jaxb.list; import java.util.List; import javax.xml.bind ...
package ycl.learn.xml.jaxb; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.InputStream; import java.io.OutputStream; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; impor ...
Singleton pattern's best practice,see below: [url]http://a123159521.iteye.com/blog/689087 [/url] Singleton with public final field public class Elvis{ public satic final Elvis instance = null; private Elvis(){} public static Elvis getInstance(){ if (instance == null) { ...

Builder Design

package ycl.learn.effective.java.builder; public interface BuilderAPI<T> { public T build(); /** * this is the builder Implement to build Object * 1. we can use diferent thing to builder diference Object. * 2. we can use something to builder any Type of Object. * * ...

ServiceLoader

package ycl.learn.effective.java; public interface ServiceAPI { /** * translate context to appropriate language. * * @param content * @return */ public String translate(String content); } package ycl.learn.effective.java; public class ChineseServiceSPI imple ...
package ycl.learn.effective.java; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; /** * java.long.Boolean * ...
If there is a big data need to be export, don't use POI, or other tools. because it is slowly, Excel should be generator the font, background, border, merge cells, freezed cellls etc.  you should be know one thing, "the function more power, the system more complex, the speed more slowly.". ...
package ycl.learn.excel; import org.apache.poi.hssf.util.HSSFColor; import org.apache.poi.ss.usermodel.CellStyle; import org.apache.poi.ss.usermodel.DataFormat; import org.apache.poi.ss.usermodel.Font; import org.apache.poi.ss.usermodel.Workbook; public class ExcelStyle { /** * dat ...
package ycl.learn.excel; import java.io.OutputStream; import java.util.List; import java.util.Map; import ycl.learn.excel.ExcelHeader.ColumnHeader; public class ExcelParameter { private OutputStream outputStream; private String sheetName; private ColumnHeader[] chs; ...
package ycl.learn.excel; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; public class ExcelResult { public static final String HEADER_KEY = "header"; private static final String DEFUAL_KEY = "defalut"; private ArrayList<ExcelErro ...

Sql Format

SQLLinForm.jar SQLForm form = new SQLForm(); form.setCase(false, false); form.setLowerCase(false); form.setGraphLevel(false); form.setSuppressSpace(true); form.setQuoteCharacter("'"); form.setSuppressEmptyLine(true); form.setFormatLanguage("SQL"); form.se ...
由于JDK一般是向下兼容的,所以有时候本地的JDK版本比类库的版本低,往往会抛出java.lang.UnsupportedClassVersionError: Bad version number in .class file。有时候需要确认到底是哪个类的版本低。所以需要确认类的编译JDK的版本。 可用二进制编辑工具(例如EmEditor)打开类文件,会有以下的显示: CA FE BA BE 00 00 00 32..... 而上面的32是编译这个类的JDK版。 32表示50,是JDK1.6; 31表示49,是JDK1.5; 30表示48,是JDK1.4......依次类推。 如编译上面的类 ...

骆驼峰结构

把对象或者属性改为骆驼峰结构,这是多年前的代码 /** * 骆驼峰结构: 比如gmt_modify ==> gmtModify * * @param columName * @return */ public static String camelName(String columName) { StringBuilder result = new StringBuilder(); String[] column_s = columName.split("_"); int i = 0; for (String ...
Global site tag (gtag.js) - Google Analytics