Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf89e623

Browse files
guidecom-zemgegc
andauthored
Support for Serializable-Interface (#93)
* Add Serializable to all classes* Add Serializable to generated classes* Add Serializable interface to manual created classes* Add@serial annotation* Remove@serial annotation---------Co-authored-by: Markus Gettrup <markus.gettrup@guidecom.de>
1 parent9d48d7d commitf89e623

File tree

194 files changed

+956
-215
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

194 files changed

+956
-215
lines changed

‎scripts/config-to-java.py‎

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@
7171
"import":"lombok.Setter",
7272
"builtin":True,
7373
"obj":None
74+
},
75+
"Serializable": {
76+
"path":None,
77+
"import":"java.io.Serializable",
78+
"builtin":True,
79+
"obj":None
7480
}
7581
}
7682

@@ -176,11 +182,12 @@ def generate_annotation_lines(lines):
176182

177183

178184
defgenerate_class_start_line(obj,lines):
179-
iflen(obj["implements"])==0:
180-
lines.append("public class {} {{\n".format(obj["name"]))
181-
else:
182-
lines.append("public class {} implements {} {{\n".format(
183-
obj["name"],", ".join(obj["implements"])))
185+
implements=list(obj["implements"])
186+
if"Serializable"notinimplements:
187+
implements.append("Serializable")
188+
189+
lines.append("public class {} implements {} {{\n".format(obj["name"],", ".join(implements)))
190+
lines.append("\n private static final long serialVersionUID = 1L;\n")
184191

185192

186193
defgenerate_interface_start_line(obj,lines):
@@ -290,7 +297,7 @@ def generate_class(info):
290297
symbols=get_symbols_dfs(obj)
291298
fields,defaults=get_fields_dfs(obj)
292299
eliminate_fields_conflicts(fields)
293-
symbols|= {"Accessors","Data"}
300+
symbols|= {"Accessors","Data","Serializable"}
294301
lines= []
295302
generate_package_line(info,lines)
296303
generate_import_lines(info,symbols,fields,lines)

‎src/main/java/org/icepear/echarts/Bar.java‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22

33
importorg.icepear.echarts.charts.bar.BarSeries;
44

5-
publicclassBarextendsCartesianCoordChart<Bar,BarSeries> {
5+
importjava.io.Serializable;
6+
7+
publicclassBarextendsCartesianCoordChart<Bar,BarSeries>implementsSerializable {
8+
9+
privatestaticfinallongserialVersionUID =1L;
10+
611
publicBar() {
712
super(Bar.class,BarSeries.class);
813
}

‎src/main/java/org/icepear/echarts/Boxplot.java‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22

33
importorg.icepear.echarts.charts.boxplot.BoxplotSeries;
44

5-
publicclassBoxplotextendsCartesianCoordChart<Boxplot,BoxplotSeries> {
5+
importjava.io.Serializable;
6+
7+
publicclassBoxplotextendsCartesianCoordChart<Boxplot,BoxplotSeries>implementsSerializable {
8+
9+
privatestaticfinallongserialVersionUID =1L;
10+
611
publicBoxplot() {
712
super(Boxplot.class,BoxplotSeries.class);
813
}

‎src/main/java/org/icepear/echarts/Candlestick.java‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22

33
importorg.icepear.echarts.charts.candlestick.CandlestickSeries;
44

5-
publicclassCandlestickextendsCartesianCoordChart<Candlestick,CandlestickSeries> {
5+
importjava.io.Serializable;
6+
7+
publicclassCandlestickextendsCartesianCoordChart<Candlestick,CandlestickSeries>implementsSerializable {
8+
9+
privatestaticfinallongserialVersionUID =1L;
10+
611
publicCandlestick() {
712
super(Candlestick.class,CandlestickSeries.class);
813
}

‎src/main/java/org/icepear/echarts/CartesianCoordChart.java‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
packageorg.icepear.echarts;
22

3+
importjava.io.Serializable;
34
importjava.util.ArrayList;
45
importjava.util.List;
56

@@ -10,7 +11,10 @@
1011
importorg.icepear.echarts.origin.coord.cartesian.AxisOption;
1112
importorg.icepear.echarts.origin.util.SeriesOption;
1213

13-
publicabstractclassCartesianCoordChart<TextendsChart<?, ?>,EextendsSeriesOption>extendsChart<T,E> {
14+
publicabstractclassCartesianCoordChart<TextendsChart<?, ?>,EextendsSeriesOption>extendsChart<T,E>implementsSerializable {
15+
16+
privatestaticfinallongserialVersionUID =1L;
17+
1418
protectedList<AxisOption>xAxes;
1519
protectedList<AxisOption>yAxes;
1620

‎src/main/java/org/icepear/echarts/Chart.java‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
packageorg.icepear.echarts;
22

3+
importjava.io.Serializable;
34
importjava.util.ArrayList;
45
importjava.util.List;
56

@@ -11,7 +12,10 @@
1112
importorg.icepear.echarts.origin.component.visualMap.VisualMapOption;
1213
importorg.icepear.echarts.origin.util.SeriesOption;
1314

14-
publicabstractclassChart<TextendsChart<?, ?>,EextendsSeriesOption> {
15+
publicabstractclassChart<TextendsChart<?, ?>,EextendsSeriesOption>implementsSerializable {
16+
17+
privatestaticfinallongserialVersionUID =1L;
18+
1519
protectedfinalTself;
1620
protectedfinalClass<E>seriesClazz;
1721
protectedList<Dataset>datasets;

‎src/main/java/org/icepear/echarts/Funnel.java‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22

33
importorg.icepear.echarts.charts.funnel.FunnelSeries;
44

5-
publicclassFunnelextendsChart<Funnel,FunnelSeries> {
5+
importjava.io.Serializable;
6+
7+
publicclassFunnelextendsChart<Funnel,FunnelSeries>implementsSerializable {
8+
9+
privatestaticfinallongserialVersionUID =1L;
10+
611
publicFunnel() {
712
super(Funnel.class,FunnelSeries.class);
813
}

‎src/main/java/org/icepear/echarts/Gauge.java‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22

33
importorg.icepear.echarts.charts.gauge.GaugeSeries;
44

5-
publicclassGaugeextendsChart<Gauge,GaugeSeries> {
5+
importjava.io.Serializable;
6+
7+
publicclassGaugeextendsChart<Gauge,GaugeSeries>implementsSerializable {
8+
9+
privatestaticfinallongserialVersionUID =1L;
10+
611
publicGauge() {
712
super(Gauge.class,GaugeSeries.class);
813
}

‎src/main/java/org/icepear/echarts/Graph.java‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22

33
importorg.icepear.echarts.charts.graph.GraphSeries;
44

5-
publicclassGraphextendsChart<Graph,GraphSeries> {
5+
importjava.io.Serializable;
6+
7+
publicclassGraphextendsChart<Graph,GraphSeries>implementsSerializable {
8+
9+
privatestaticfinallongserialVersionUID =1L;
10+
611
publicGraph() {
712
super(Graph.class,GraphSeries.class);
813
}

‎src/main/java/org/icepear/echarts/Heatmap.java‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@
55
importorg.icepear.echarts.components.coord.cartesian.CategoryAxis;
66
importorg.icepear.echarts.components.coord.cartesian.ValueAxis;
77

8-
publicclassHeatmapextendsCartesianCoordChart<Heatmap,HeatmapSeries> {
8+
importjava.io.Serializable;
9+
10+
publicclassHeatmapextendsCartesianCoordChart<Heatmap,HeatmapSeries>implementsSerializable {
11+
12+
privatestaticfinallongserialVersionUID =1L;
13+
914
publicHeatmap() {
1015
super(Heatmap.class,HeatmapSeries.class);
1116
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp