Examples of loadAll()


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

        final InputStream userIs = PopulateDatabase.class.getClassLoader().getResourceAsStream(DATA_USERS_FILE_NAME);
        final InputStream fragsIs = PopulateDatabase.class.getClassLoader().getResourceAsStream(DATA_CODEFRAGMENTS_FILE_NAME);
        final Yaml yaml = new Yaml();

        for (Object u : yaml.loadAll(userIs)) {
            log.fine("Persisting user " + u);
            ((User)u).setId(null);
            entityManager.persist(u);
        }
View Full Code Here

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

            log.fine("Persisting user " + u);
            ((User)u).setId(null);
            entityManager.persist(u);
        }

        for (Object f : yaml.loadAll(fragsIs)) {
            log.fine("Persisting code fragments");
            ((CodeFragment)f).setId(null);
            entityManager.persist(f);
        }
View Full Code Here

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

    @SuppressWarnings({ "unchecked", "rawtypes" })
    public void testMaps() {
        Yaml yaml = new Yaml(new CustomConstructor());
        String input = Util.getLocalResource("issues/issue56-1.yaml");
        int counter = 0;
        for (Object obj : yaml.loadAll(input)) {
            // System.out.println(obj);
            Map<String, Object> map = (Map<String, Object>) obj;
            Integer oid = (Integer) map.get("oid");
            if (oid == 123058) {
                ArrayList a = (ArrayList) map.get("sequences");
View Full Code Here

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

                "!de.oddb.org,2007/ODDB::Util::Code"));
        c.addTypeDescription(descr);
        Yaml yaml = new Yaml(c);
        String input = Util.getLocalResource("issues/issue56-1.yaml");
        int counter = 0;
        for (Object obj : yaml.loadAll(input)) {
            // System.out.println(obj);
            Map<String, Object> map = (Map<String, Object>) obj;
            Integer oid = (Integer) map.get("oid");
            assertTrue(oid > 10000);
            counter++;
View Full Code Here

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

    public void testJavaBean() {
        Constructor c = new CustomBeanConstructor();
        Yaml yaml = new Yaml(c);
        String input = Util.getLocalResource("issues/issue56-1.yaml");
        int counter = 0;
        for (Object obj : yaml.loadAll(input)) {
            // System.out.println(obj);
            Map<String, Object> map = (Map<String, Object>) obj;
            Integer oid = (Integer) map.get("oid");
            assertTrue(oid > 10000);
            counter++;
View Full Code Here

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

    @SuppressWarnings("unchecked")
    public void testValue() {
        InputStream input = YamlDocument.class.getClassLoader().getResourceAsStream(
                YamlDocument.ROOT + "types/value.yaml");
        Yaml yaml = new Yaml();
        Iterator<Object> iter = (Iterator<Object>) yaml.loadAll(input).iterator();
        Map<String, List<String>> oldSchema = (Map<String, List<String>>) iter.next();
        assertEquals(1, oldSchema.size());
        List<String> list = oldSchema.get("link with");
        assertEquals(2, list.size());
        assertEquals("library1.dll", list.get(0));
View Full Code Here

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

                Iterable<Object> documents1 = myYaml.loadAll(input);
                int index = file.getAbsolutePath().lastIndexOf('.');
                String canonicalName = file.getAbsolutePath().substring(0, index) + ".canonical";
                File canonical = new File(canonicalName);
                InputStream input2 = new FileInputStream(canonical);
                Iterable<Object> documents2 = canonicalYaml.loadAll(input2);
                input2.close();
                Iterator<Object> iter2 = documents2.iterator();
                for (Object object1 : documents1) {
                    Object object2 = iter2.next();
                    if (object2 != null) {
View Full Code Here

Examples of pt.webdetails.cpf.persistence.ISimplePersistence.loadAll()

      logger.error( "Error while getting view.", e );
      return null;
    }
    Filter filter = new Filter();
    filter.where( "user" ).equalTo( user );
    List<View> views = sp.loadAll( View.class );
    JSONArray arr = new JSONArray();
    for ( View v : views ) {
      arr.put( v.toJSON() );
    }
    try {
View Full Code Here

Examples of pt.webdetails.cpf.persistence.SimplePersistence.loadAll()

  public JSONObject listAllViews( String user ) {
    JSONObject response = new JSONObject();
    SimplePersistence sp = SimplePersistence.getInstance();
    Filter filter = new Filter();
    filter.where( "user" ).equalTo( user );
    List<View> views = sp.loadAll( View.class );
    JSONArray arr = new JSONArray();
    for ( View v : views ) {
      arr.put( v.toJSON() );
    }
    try {
View Full Code Here

Examples of stallone.api.datasequence.IDataSequenceLoader.loadAll()

        inputFiles = new ArrayList();
        for (int i=0; i<ifiles.length; i++)
            inputFiles.add(ifiles[i]);
       
        IDataSequenceLoader loader = dataNew.multiSequenceLoader(inputFiles);
        data = loader.loadAll();

        nclusters = parser.getInt("ncluster");
        nsplit = parser.getInt("nsplit");
       
        outPrefix = parser.getString("o");
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.