|
1 | 1 | package io.avaje.jsonb.generator;
|
2 | 2 |
|
| 3 | +import io.avaje.jsonb.Json; |
| 4 | + |
| 5 | +import javax.lang.model.element.Element; |
| 6 | +import javax.lang.model.element.TypeElement; |
3 | 7 | import java.util.HashSet;
|
4 | 8 | import java.util.List;
|
5 |
| -import java.util.Map; |
6 | 9 | import java.util.Set;
|
7 | 10 | import java.util.TreeSet;
|
8 | 11 |
|
9 |
| -import javax.lang.model.element.Element; |
10 |
| -import javax.lang.model.element.TypeElement; |
11 |
| - |
12 |
| -import io.avaje.jsonb.Json; |
13 |
| - |
14 | 12 | class BeanReader {
|
15 | 13 |
|
16 | 14 | private final TypeElement beanType;
|
@@ -44,27 +42,22 @@ class BeanReader {
|
44 | 42 | this.constructor = typeReader.constructor();
|
45 | 43 | }
|
46 | 44 |
|
47 |
| - public BeanReader( |
48 |
| - TypeElement beanType, |
49 |
| - TypeElement mixInElement, |
50 |
| - ProcessingContext context) { |
51 |
| - |
52 |
| - this.beanType = beanType; |
53 |
| - this.type = beanType.getQualifiedName().toString(); |
54 |
| - this.shortName = shortName(beanType); |
55 |
| - final NamingConventionReader ncReader = new NamingConventionReader(beanType); |
56 |
| - this.namingConvention = ncReader.get(); |
57 |
| - this.typeProperty = ncReader.typeProperty(); |
58 |
| - this.typeReader = new TypeReader(beanType, mixInElement, context, namingConvention); |
59 |
| - typeReader.process(); |
60 |
| - this.nonAccessibleField = typeReader.nonAccessibleField(); |
61 |
| - this.hasSubTypes = typeReader.hasSubTypes(); |
62 |
| - this.allFields = typeReader.allFields(); |
63 |
| - this.constructor = typeReader.constructor(); |
64 |
| - |
| 45 | + public BeanReader(TypeElement beanType, TypeElement mixInElement, ProcessingContext context) { |
| 46 | + this.beanType = beanType; |
| 47 | + this.type = beanType.getQualifiedName().toString(); |
| 48 | + this.shortName = shortName(beanType); |
| 49 | + final NamingConventionReader ncReader = new NamingConventionReader(beanType); |
| 50 | + this.namingConvention = ncReader.get(); |
| 51 | + this.typeProperty = ncReader.typeProperty(); |
| 52 | + this.typeReader = new TypeReader(beanType, mixInElement, context, namingConvention); |
| 53 | + typeReader.process(); |
| 54 | + this.nonAccessibleField = typeReader.nonAccessibleField(); |
| 55 | + this.hasSubTypes = typeReader.hasSubTypes(); |
| 56 | + this.allFields = typeReader.allFields(); |
| 57 | + this.constructor = typeReader.constructor(); |
65 | 58 | }
|
66 | 59 |
|
67 |
| -@Override |
| 60 | + @Override |
68 | 61 | public String toString() {
|
69 | 62 | return beanType.toString();
|
70 | 63 | }
|
@@ -198,6 +191,7 @@ void writeViewSupport(Append writer) {
|
198 | 191 | writeViewBuild(writer);
|
199 | 192 | }
|
200 | 193 | }
|
| 194 | + |
201 | 195 | private void writeView(Append writer) {
|
202 | 196 | writer.eol();
|
203 | 197 | writer.append(" @Override").eol();
|
@@ -375,4 +369,5 @@ private void writeFromJsonSwitch(Append writer, boolean defaultConstructor, Stri
|
375 | 369 | writer.append(" }").eol();
|
376 | 370 | writer.append(" reader.endObject();").eol();
|
377 | 371 | }
|
| 372 | + |
378 | 373 | }
|
0 commit comments