Package com.fasterxml.jackson.core

Examples of com.fasterxml.jackson.core.ObjectCodec.readTree()


    public Localized deserialize(final JsonParser parser,
                                         final DeserializationContext context)
            throws IOException {
        final LocalizedBuilder<Object> builder = new LocalizedBuilder<>();
        final ObjectCodec codec = parser.getCodec();
        final JsonNode node = codec.readTree(parser);
        final Iterator<Map.Entry<String, JsonNode>> iterator = node.fields();
        while (iterator.hasNext()) {
            final Map.Entry<String, JsonNode> entry = iterator.next();
            builder.setValue(
                    Locale.forLanguageTag(entry.getKey()),
View Full Code Here


    @Override
    public LocalDateTime deserialize(final JsonParser parser,
                                     final DeserializationContext context)
            throws IOException {
        final ObjectCodec codec = parser.getCodec();
        final JsonNode node = codec.readTree(parser);
        return LocalDateTime.parse(node.asText(), DATE_TIME_FORMATTER);
    }
}
View Full Code Here

    public static class Deserializer extends JsonDeserializer<IntOrString> {

        @Override
        public IntOrString deserialize(JsonParser jsonParser, DeserializationContext ctxt) throws IOException, JsonProcessingException {
            ObjectCodec oc = jsonParser.getCodec();
            JsonNode node = oc.readTree(jsonParser);
            IntOrString intOrString = new IntOrString();
            int asInt = node.asInt();
            if (asInt != 0) {
                intOrString.setIntValue(asInt);
            } else {
View Full Code Here

    @Override
    public RestLoaderRequest<IEntity> deserialize(final JsonParser jp, final DeserializationContext ctxt) throws IOException, JsonProcessingException {
        try {
            final ObjectCodec objectCodec = jp.getCodec();
            final JsonNode node = objectCodec.readTree(jp);
            final String className = node.get("className").textValue();
            final String fieldName = node.get("fieldName").textValue();

            final Class<?> clazz = Class.forName(className);
View Full Code Here

    public Localized<Object> deserialize(final JsonParser parser,
                                         final DeserializationContext context)
            throws IOException {
        final LocalizedBuilder<Object> builder = new LocalizedBuilder<Object>();
        final ObjectCodec codec = parser.getCodec();
        final JsonNode node = codec.readTree(parser);
        final Iterator<Map.Entry<String, JsonNode>> iterator = node.fields();
        while (iterator.hasNext()) {
            final Map.Entry<String, JsonNode> entry = iterator.next();
            builder.setValue(
                    Locale.forLanguageTag(entry.getKey()),
View Full Code Here

        @Override
        public Ports deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {

            Ports out = new Ports();
            ObjectCodec oc = jsonParser.getCodec();
            JsonNode node = oc.readTree(jsonParser);
            for (Iterator<Map.Entry<String, JsonNode>> it = node.fields(); it.hasNext();) {

                Map.Entry<String, JsonNode> field = it.next();
                if (!field.getValue().equals(NullNode.getInstance())) {
                    String hostIp = field.getValue().get(0).get("HostIp").textValue();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.