package kr.co.swh.lecture.opensource.yaml;


import java.io.FileNotFoundException;
import java.io.FileReader;

import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.constructor.Constructor;


/**
 * <pre>
 * 패키지명 : kr.co.swh.lecture.opensource.yaml
 * 파일명 : FileRead.java
 * 설명 : FileRead
 * 
 * </pre>
 * 
 * @since : 2022. 4. 27.
 * @author : tobby48
 * @version : v1.0
 */
public class FileRead2 {
	public static void main(String[] args){
		try { 
			Yaml yaml = new Yaml(new Constructor(Sample.class));
			Sample propMap = yaml.load(new FileReader("samples.yml")); 
			System.out.println(propMap); 
			System.out.println(propMap.getCars());
			Car cars = propMap.getCars();
			System.out.println(cars.getBig()); 
		}catch(FileNotFoundException e) {
			e.printStackTrace();
		}
	}
}
