Skip to content

Commit 525dc30

Browse files
committed
Add Javadocs, default settings constants, for AvroSchemaGenerator
1 parent 2ed9c3f commit 525dc30

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

avro/src/main/java/com/fasterxml/jackson/dataformat/avro/schema/AvroSchemaGenerator.java

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
* An instance is typically given to
99
* {@link com.fasterxml.jackson.databind.ObjectMapper#acceptJsonFormatVisitor}
1010
* which will invoke necessary callbacks.
11+
*<p>
12+
* For default configuration of things like "Logical Types support", see Javadocs
13+
* of {@link VisitorFormatWrapperImpl}.
1114
*/
1215
public class AvroSchemaGenerator extends VisitorFormatWrapperImpl
1316
{

avro/src/main/java/com/fasterxml/jackson/dataformat/avro/schema/VisitorFormatWrapperImpl.java

+19-2
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,31 @@
1717
public class VisitorFormatWrapperImpl
1818
implements JsonFormatVisitorWrapper
1919
{
20+
/**
21+
* Default value for {@link #_logicalTypesEnabled}: for Jackson 2.x
22+
* {@code false} for backwards-compatibility; will be changed to
23+
* {@code true} in 3.0.
24+
*
25+
* @since 2.19
26+
*/
27+
public static final boolean DEFAULT_LOGICAL_TYPES_ENABLED = false;
28+
29+
/**
30+
* Default value for {@link #_writeEnumAsString}: {@code false} as of
31+
* Jackson 2.19 and later.
32+
*
33+
* @since 2.19
34+
*/
35+
public static final boolean DEFAULT_ENUM_AS_STRING = false;
36+
2037
protected SerializerProvider _provider;
2138

2239
protected final DefinedSchemas _schemas;
2340

2441
/**
2542
* @since 2.13
2643
*/
27-
protected boolean _logicalTypesEnabled = false;
44+
protected boolean _logicalTypesEnabled = DEFAULT_LOGICAL_TYPES_ENABLED;
2845

2946
/**
3047
* @since 2.18
@@ -53,11 +70,11 @@ public VisitorFormatWrapperImpl(DefinedSchemas schemas, SerializerProvider p) {
5370
_provider = p;
5471
}
5572

56-
5773
protected VisitorFormatWrapperImpl(VisitorFormatWrapperImpl src) {
5874
this._schemas = src._schemas;
5975
this._provider = src._provider;
6076
this._logicalTypesEnabled = src._logicalTypesEnabled;
77+
this._writeEnumAsString = src._writeEnumAsString;
6178
}
6279

6380
/**

0 commit comments

Comments
 (0)