-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3f94218
commit 89a2025
Showing
4 changed files
with
89 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 84 additions & 0 deletions
84
src/main/java/com/fasterxml/jackson/databind/json/JsonMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
package com.fasterxml.jackson.databind.json; | ||
|
||
import com.fasterxml.jackson.core.JsonFactory; | ||
import com.fasterxml.jackson.core.Version; | ||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import com.fasterxml.jackson.databind.cfg.MapperBuilder; | ||
import com.fasterxml.jackson.databind.cfg.PackageVersion; | ||
|
||
/** | ||
* | ||
* @since 2.10 | ||
*/ | ||
public class JsonMapper extends ObjectMapper | ||
{ | ||
private static final long serialVersionUID = 1L; | ||
|
||
/** | ||
* Base implementation for "Vanilla" {@link ObjectMapper}, used with | ||
* JSON dataformat backend. | ||
* | ||
* @since 2.10 | ||
*/ | ||
public static class Builder extends MapperBuilder<JsonMapper, Builder> | ||
{ | ||
public Builder(JsonMapper m) { | ||
super(m); | ||
} | ||
} | ||
|
||
/* | ||
/********************************************************** | ||
/* Life-cycle, constructors | ||
/********************************************************** | ||
*/ | ||
|
||
public JsonMapper() { | ||
this(new JsonFactory()); | ||
} | ||
|
||
public JsonMapper(JsonFactory f) { | ||
super(f); | ||
} | ||
|
||
protected JsonMapper(JsonMapper src) { | ||
super(src); | ||
} | ||
|
||
@Override | ||
public JsonMapper copy() | ||
{ | ||
_checkInvalidCopy(JsonMapper.class); | ||
return new JsonMapper(this); | ||
} | ||
|
||
/* | ||
/********************************************************** | ||
/* Life-cycle, builders | ||
/********************************************************** | ||
*/ | ||
|
||
public static JsonMapper.Builder builder() { | ||
return new Builder(new JsonMapper()); | ||
} | ||
|
||
public static Builder builder(JsonFactory streamFactory) { | ||
return new Builder(new JsonMapper(streamFactory)); | ||
} | ||
|
||
/* | ||
/********************************************************** | ||
/* Standard method overrides | ||
/********************************************************** | ||
*/ | ||
|
||
@Override | ||
public Version version() { | ||
return PackageVersion.VERSION; | ||
} | ||
|
||
@Override | ||
public JsonFactory getFactory() { | ||
return _jsonFactory; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters