Skip to content

Commit

Permalink
Some more renaming wrt #1051 (decorateWith() -> addDecorator())
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Jun 20, 2023
1 parent 36050bf commit dc024d9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
20 changes: 11 additions & 9 deletions src/main/java/com/fasterxml/jackson/core/TSFBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ public B configure(JsonWriteFeature f, boolean state) {
return _failNonJSON(f);
}

// // // Other configuration
// // // Other configuration, decorators

public B inputDecorator(InputDecorator dec) {
_inputDecorator = dec;
Expand All @@ -291,6 +291,16 @@ public B outputDecorator(OutputDecorator dec) {
return _this();
}

public B addDecorator(JsonGeneratorDecorator decorator) {
if (_generatorDecorators == null) {
_generatorDecorators = new ArrayList<>();
}
_generatorDecorators.add(decorator);
return _this();
}

// // // Other configuration, constraints

/**
* Sets the constraints for streaming reads.
*
Expand All @@ -305,14 +315,6 @@ public B streamReadConstraints(StreamReadConstraints streamReadConstraints) {

// // // Other methods

public B decorateWith(JsonGeneratorDecorator decorator) {
if (_generatorDecorators == null) {
_generatorDecorators = new ArrayList<>();
}
_generatorDecorators.add(decorator);
return _this();
}

/**
* Method for constructing actual {@link TokenStreamFactory} instance, given
* configuration.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public void testDeprecatedMethods() throws IOException
public void testGeneratorDecoration() throws Exception
{
JsonFactory f = JsonFactory.builder()
.decorateWith(new SimpleGeneratorDecorator())
.addDecorator(new SimpleGeneratorDecorator())
.build();
final String EXP = a2q("{'password':'***'}");

Expand Down

0 comments on commit dc024d9

Please sign in to comment.