java - 一个多层嵌套的类,json的辅助类需要初始化,要怎么写比较简便?
阿神
阿神 2017-05-17 10:07:49
0
1
489
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学习者快速成长!