java - 一個多層嵌套的類,json的輔助類需要初始化,要怎麼寫比較簡單?
阿神
阿神 2017-05-17 10:07:49
0
1
487
public class PieOption {
 private SeriesBean series;
    public static class SeriesBean {
        private LabelBean label;
        public static class LabelBean {      
            private EmphasisBean emphasis;
            public static class EmphasisBean {
                private boolean show;
                private TextStyleBean textStyle;
                public static class TextStyleBean {
                    private String fontSize;
                    private String fontWeight;
                }
            }
        }
    }
}

new個物件再來呼叫set方法實在是太費事了
SeriesBean.LabelBean.EmphasisBean.TextStyleBean textStyleBean = new SeriesBean.LabelBean.EmphasisBean.TextStyleBean();就這樣寫太可怕了

############################################################# ##
阿神
阿神

闭关修行中......

全部回覆(1)
滿天的星座

不要寫成內部類別...

熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!