Package argo.jdom

Examples of argo.jdom.JdomParser


     */
    public static String prettyPrintJsonString(String uglyJson)
    {
        try
        {
            JsonRootNode jsonRootNode = new JdomParser().parse(uglyJson);
            JsonFormatter jsonFormatter = new PrettyJsonFormatter();
            String prettyJson = jsonFormatter.format(jsonRootNode);
            return prettyJson;
        }
        catch(Exception e)
View Full Code Here


public final class SimpleJdomExamples {

    @Test
    public void ParseSimpleExample() throws Exception {
        final String jsonText = FileUtils.readFileToString(new File(this.getClass().getResource("SimpleExample.json").getFile()));
        String secondSingle = new JdomParser().parse(jsonText).getStringValue("singles", 1);
        assertThat(secondSingle, equalTo("Agadoo"));
    }
View Full Code Here

        }
    }

    @Test
    public void testArgoJdom() throws Exception {
        final JdomParser jdomParser = new JdomParser();
        for (final Reader reader : jsonReaders) {
            jdomParser.parse(reader);
        }
    }
View Full Code Here

    @Test
    public void testRoundTrip() throws Exception {
        final File longJsonExample = new File(this.getClass().getResource("Sample.json").getFile());
        final String json = readFileToString(longJsonExample);
        final JdomParser jdomParser = new JdomParser();
        final JsonRootNode node = jdomParser.parse(json);
        final JsonFormatter jsonFormatter = fieldOrderPreservingPrettyJsonFormatter();
        final String expected = jsonFormatter.format(node);
        assertThat(jdomParser.parse(expected), Matchers.equalTo(node));
    }
View Full Code Here

    try {

      URL url = new URL(versionFileURL);
      BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()));
      double version = Double.valueOf(new JdomParser().parse(reader).getStringValue("version"));
     
      if(version > DevCapesUtil.version)
        result = OLD;
      else if(version == DevCapesUtil.version)
        result = CURRENT;
View Full Code Here

TOP

Related Classes of argo.jdom.JdomParser

Copyright © 2018 www.massapicom. 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.