看別人代碼,Java物體類轉xml的時候,有個欄位加這個自定義注解 @CustomAttributesAnnotation
而且傳引數key="class",value="https://bbs.csdn.net/topics/sql-date" 作用是什么?這個是什么原理呢?網上找了很多講自定義注解都沒有這個樣的
@CustomAttributesAnnotation(key="class",value="https://bbs.csdn.net/topics/sql-date")
@XStreamAlias("endDate")
private String endDate ;
--------------------------------------------------------
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
public @interface CustomAttributesAnnotation {
public String value() default "";
public String key() default "";
}
uj5u.com熱心網友回復:
或許你看下轉換程序就會明白這個是什么意思了uj5u.com熱心網友回復:
甭管它是干嘛用的,Java物體類轉xml就一行代碼,不需要這么復雜;
物件,Map,List,json字串都可以轉xml
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/56654.html
標籤:Web 開發
