List of usage examples for com.fasterxml.jackson.core.format DataFormatMatcher getMatchedFormatName
public String getMatchedFormatName()
From source file:org.waarp.common.json.AdaptativeJsonHandler.java
public AdaptativeJsonHandler(byte[] source) throws IOException { DataFormatMatcher match = detector.findFormat(source); if (match == null) { this.codec = JsonCodec.JSON; mapper = JsonCodec.JSON.mapper; // default } else {//from www . ja va2s. co m JsonCodec codec = factoryForName.get(match.getMatchedFormatName()); if (codec != null) { this.codec = codec; mapper = codec.mapper; } else { this.codec = JsonCodec.JSON; mapper = JsonCodec.JSON.mapper; // default } } }
From source file:org.waarp.common.json.AdaptativeJsonHandler.java
public AdaptativeJsonHandler(InputStream source) throws IOException { DataFormatMatcher match = detector.findFormat(source); if (match == null) { this.codec = JsonCodec.JSON; mapper = JsonCodec.JSON.mapper; // default } else {//from w w w.j ava 2s .co m JsonCodec codec = factoryForName.get(match.getMatchedFormatName()); if (codec != null) { this.codec = codec; mapper = codec.mapper; } else { this.codec = JsonCodec.JSON; mapper = JsonCodec.JSON.mapper; // default } } }