Examples of JsonElement


Examples of com.google.gson.JsonElement

        builder.add(name, prop.getAsByte());
    }

    @Override
    public void shortProperty(PropertyName name, JsonObject context) throws IOException {
        JsonElement prop = property(context, name);
        if (prop == null) {
            return;
        }
        builder.add(name, prop.getAsShort());
    }
View Full Code Here

Examples of com.google.gson.JsonElement

        builder.add(name, prop.getAsShort());
    }

    @Override
    public void intProperty(PropertyName name, JsonObject context) throws IOException {
        JsonElement prop = property(context, name);
        if (prop == null) {
            return;
        }
        builder.add(name, prop.getAsInt());
    }
View Full Code Here

Examples of com.google.gson.JsonElement

        builder.add(name, prop.getAsInt());
    }

    @Override
    public void longProperty(PropertyName name, JsonObject context) throws IOException {
        JsonElement prop = property(context, name);
        if (prop == null) {
            return;
        }
        builder.add(name, prop.getAsLong());
    }
View Full Code Here

Examples of com.google.gson.JsonElement

        builder.add(name, prop.getAsLong());
    }

    @Override
    public void integerProperty(PropertyName name, JsonObject context) throws IOException {
        JsonElement prop = property(context, name);
        if (prop == null) {
            return;
        }
        builder.add(name, prop.getAsBigInteger());
    }
View Full Code Here

Examples of com.google.gson.JsonElement

        builder.add(name, prop.getAsBigInteger());
    }

    @Override
    public void floatProperty(PropertyName name, JsonObject context) throws IOException {
        JsonElement prop = property(context, name);
        if (prop == null) {
            return;
        }
        builder.add(name, prop.getAsFloat());
    }
View Full Code Here

Examples of com.google.gson.JsonElement

        builder.add(name, prop.getAsFloat());
    }

    @Override
    public void doubleProperty(PropertyName name, JsonObject context) throws IOException {
        JsonElement prop = property(context, name);
        if (prop == null) {
            return;
        }
        builder.add(name, prop.getAsDouble());
    }
View Full Code Here

Examples of com.google.gson.JsonElement

        builder.add(name, prop.getAsDouble());
    }

    @Override
    public void decimalProperty(PropertyName name, JsonObject context) throws IOException {
        JsonElement prop = property(context, name);
        if (prop == null) {
            return;
        }
        builder.add(name, prop.getAsBigDecimal());
    }
View Full Code Here

Examples of com.google.gson.JsonElement

        builder.add(name, prop.getAsBigDecimal());
    }

    @Override
    public void stringProperty(PropertyName name, JsonObject context) throws IOException {
        JsonElement prop = property(context, name);
        if (prop == null) {
            return;
        }
        builder.add(name, prop.getAsString());
    }
View Full Code Here

Examples of com.google.gson.JsonElement

    }

    private static final Pattern DATE = Pattern.compile("(\\d{3,})-(\\d{1,2})-(\\d{1,2})");
    @Override
    public void dateProperty(PropertyName name, JsonObject context) throws IOException {
        JsonElement prop = property(context, name);
        if (prop == null) {
            return;
        }
        String string = prop.getAsString();
        Matcher matcher = DATE.matcher(string);
        if (matcher.matches() == false) {
            throw new IOException(MessageFormat.format(
                    "invalid date property \"{0}\", must be \"{2}\" form, but was \"{1}\"",
                    name,
View Full Code Here

Examples of com.google.gson.JsonElement

    }

    private static final Pattern TIME = Pattern.compile("(\\d{1,2}):(\\d{1,2}):(\\d{1,2})");
    @Override
    public void timeProperty(PropertyName name, JsonObject context) throws IOException {
        JsonElement prop = property(context, name);
        if (prop == null) {
            return;
        }
        String string = prop.getAsString();
        Matcher matcher = TIME.matcher(string);
        if (matcher.matches() == false) {
            throw new IOException(MessageFormat.format(
                    "invalid time property \"{0}\", must be \"{2}\" form, but was \"{1}\"",
                    name,
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.