misakuo / JsonModelGenerator

Converting JSON string to Java Class in IDEA / Android Studio
https://plugins.jetbrains.com/plugin/8062
MIT License
58 stars 17 forks source link

JodaTime? #2

Closed fobbyal closed 7 years ago

fobbyal commented 8 years ago

老大 我想選 type. BigDecimal 或者 jodatime 之類的 有沒有這類的規劃?

misakuo commented 8 years ago

不太明白你的意思,给个示例?

fobbyal commented 8 years ago

有沒有可能通過一些選項 輸出。。 String 和 Double 之外的 type/class

import org.joda.time.DateTime;

import java.util.ArrayList;
import java.util.List;

public class UploadRequest<P> {

    private DateTime tstamp;
    private String requestId;
    private String source;

    public UploadRequest() {
        payload =new ArrayList<>();
    }

    public DateTime getTstamp() {
        return tstamp;
    }

    public void setTstamp(DateTime tstamp) {
        this.tstamp = tstamp;
    }

    public String getRequestId() {
        return requestId;
    }

    public void setRequestId(String requestId) {
        this.requestId = requestId;
    }

    public String getSource() {
        return source;
    }

    public void setSource(String source) {
        this.source = source;
    }

    List<P> payload;

    public List<P> getPayload() {
        return payload;
    }

    public void setPayload(List<P> payload) {
        this.payload = payload;
    }
}
fobbyal commented 8 years ago

我沒有碰過idea插件。。放個JTable進去難嗎? 如果有空我可能會contribute...

misakuo commented 8 years ago

目前插件想做的是把类型推断和名称生成的事情全部接管掉,你说的这个需求可以通过设置正则表达式匹配实现