Package org.yaml.snakeyaml

Examples of org.yaml.snakeyaml.Yaml.loadAll()


    public void testLoadManyDocuments() throws IOException {
        InputStream input = new FileInputStream(new File(
                "src/test/resources/specification/example2_28.yaml"));
        Yaml yaml = new Yaml();
        int counter = 0;
        for (Object data : yaml.loadAll(input)) {
            assertNotNull(data);
            assertTrue(data.toString().length() > 1);
            counter++;
        }
        assertEquals(3, counter);
View Full Code Here


        return yaml.load(data);
    }

    protected Iterable<Object> loadAll(InputStream data) {
        Yaml yaml = new Yaml();
        return yaml.loadAll(data);
    }

    protected Iterable<Object> loadAll(String data) {
        Yaml yaml = new Yaml();
        return yaml.loadAll(data);
View Full Code Here

        return yaml.loadAll(data);
    }

    protected Iterable<Object> loadAll(String data) {
        Yaml yaml = new Yaml();
        return yaml.loadAll(data);
    }

    protected Iterable<Object> loadAll(Constructor loader, String data) {
        Yaml yaml = new Yaml(loader);
        return yaml.loadAll(data);
View Full Code Here

        return yaml.loadAll(data);
    }

    protected Iterable<Object> loadAll(Constructor loader, String data) {
        Yaml yaml = new Yaml(loader);
        return yaml.loadAll(data);
    }

    protected String getResource(String theName) {
        String content;
        content = Util.getLocalResource(PATH + File.separator + theName);
View Full Code Here

        Constructor constr = new Constructor();
        TypeDescription description = new TypeDescription(ComponentBean.class, new Tag(
                "tag:ualberta.ca,2012:" + 29));
        constr.addTypeDescription(description);
        Yaml yaml = new Yaml(constr);
        Iterator<Object> parsed = yaml.loadAll(input).iterator();
        ComponentBean bean1 = (ComponentBean) parsed.next();
        assertEquals(0, bean1.getProperty1());
        assertEquals("aaa", bean1.getProperty2());
        ComponentBean bean2 = (ComponentBean) parsed.next();
        assertEquals(3, bean2.getProperty1());
View Full Code Here

        Constructor constr = new Constructor();
        TypeDescription description = new TypeDescription(ComponentBean.class, new Tag(
                "tag:ualberta.ca,2012:" + 29));
        constr.addTypeDescription(description);
        Yaml yaml = new Yaml(constr);
        Iterator<Object> parsed = yaml.loadAll(input).iterator();
        ComponentBean bean1 = (ComponentBean) parsed.next();
        assertEquals(0, bean1.getProperty1());
        assertEquals("aaa", bean1.getProperty2());
        ComponentBean bean2 = (ComponentBean) parsed.next();
        assertEquals(3, bean2.getProperty1());
View Full Code Here

        Constructor constr = new Constructor();
        TypeDescription description = new TypeDescription(ComponentBean.class, new Tag(
                "tag:ualberta.ca,2012:29"));
        constr.addTypeDescription(description);
        Yaml yaml = new Yaml(constr);
        Iterator<Object> parsed = yaml.loadAll(input).iterator();
        ComponentBean bean = (ComponentBean) parsed.next();
        assertEquals(0, bean.getProperty1());
        assertEquals("aaa", bean.getProperty2());
        assertFalse(parsed.hasNext());
    }
View Full Code Here

      List<PluginRef> pluginList = new ArrayList<PluginRef>();

      Yaml yaml = new Yaml();
      // TODO this needs to be cached instead of downloaded each time
      for (Object o : yaml.loadAll(httpResponse.getEntity().getContent()))
      {
         if (o == null)
         {
            continue;
         }
View Full Code Here

    {
        List<PluginRef> pluginList = new ArrayList<PluginRef>();

        Yaml yaml = new Yaml();
        Pattern pattern = Pattern.compile(GeneralUtils.pathspecToRegEx("*" + searchString + "*"));
        for (Object o : yaml.loadAll(stream))
        {
            if (o == null)
            {
                continue;
            }
View Full Code Here

   {
      List<PluginRef> pluginList = new ArrayList<PluginRef>();

      Yaml yaml = new Yaml();
      Pattern pattern = Pattern.compile(GeneralUtils.pathspecToRegEx("*" + searchString + "*"));
      for (Object o : yaml.loadAll(stream))
      {
         if (o == null)
         {
            continue;
         }
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.