Package org.yaml.snakeyaml.reader

Examples of org.yaml.snakeyaml.reader.UnicodeReader


        allFiles.addAll(Arrays.asList(dataFiles));
        for (File file : allFiles) {
            try {
                List<Event> events = new ArrayList<Event>();
                InputStream input = new FileInputStream(file);
                StreamReader reader = new StreamReader(new UnicodeReader(input));
                Parser parser = new ParserImpl(reader);
                while (parser.peekEvent() != null) {
                    Event event = parser.getEvent();
                    events.add(event);
                }
View Full Code Here


        assertTrue(file.isFile());
        return file;
    }

    protected List<Event> canonicalParse(InputStream input2) throws IOException {
        StreamReader reader = new StreamReader(new UnicodeReader(input2));
        StringBuilder buffer = new StringBuilder();
        while (reader.peek() != '\0') {
            buffer.append(reader.peek());
            reader.forward();
        }
View Full Code Here

        input2.close();
        return result;
    }

    protected List<Event> parse(InputStream input) throws IOException {
        StreamReader reader = new StreamReader(new UnicodeReader(input));
        Parser parser = new ParserImpl(reader);
        List<Event> result = new ArrayList<Event>();
        while (parser.peekEvent() != null) {
            result.add(parser.getEvent());
        }
View Full Code Here

    public void load() {
        FileInputStream stream = null;

        try {
            stream = new FileInputStream(file);
            read(yaml.load(new UnicodeReader(stream)));
        } catch (IOException e) {
            root = new HashMap<String, Object>();
        } catch (ConfigurationException e) {
            root = new HashMap<String, Object>();
        } finally {
View Full Code Here

    JavaBeanLoader<XmlSuite> loader = new JavaBeanLoader<XmlSuite>(XmlSuite.class);
    if (is == null)
    {
      is = new FileInputStream(new File(filePath));
    }
    XmlSuite result = loader.load(new UnicodeReader(is))// UnicodeReader
                                // used to
                                // respect BOM
    result.setFileName(filePath);
    // DEBUG
    // System.out.println("[Yaml] " + result.toXml());
View Full Code Here

    InputStream stream = null;

    try {
      stream = getInputStream();
      if (stream == null) throw new IOException("Stream is null!");
      read(yaml.load(new UnicodeReader(stream)));
    } catch (YAMLProcessorException e) {
      root = new LinkedHashMap<String, Object>();
    } finally {
      try {
        if (stream != null) {
View Full Code Here

      public void load() {
         FileInputStream stream = null;
     
         try {
            stream = new FileInputStream(file);
            read(yaml.load(new UnicodeReader(stream)));
         }
            catch (IOException e) {
               root = new HashMap<String, Object>();
            }
            catch (ConfigurationException e) {
View Full Code Here

     * @param io
     *            data to load from (BOM is respected and removed)
     * @return parsed object
     */
    public Object load(InputStream io) {
        return loadFromReader(new StreamReader(new UnicodeReader(io)), Object.class);
    }
View Full Code Here

     *            Class of the object to be created
     * @return parsed object
     */
    @SuppressWarnings("unchecked")
    public <T> T loadAs(InputStream input, Class<T> type) {
        return (T) loadFromReader(new StreamReader(new UnicodeReader(input)), type);
    }
View Full Code Here

     *            YAML data to load from (BOM is respected and ignored)
     * @return an iterator over the parsed Java objects in this stream in proper
     *         sequence
     */
    public Iterable<Object> loadAll(InputStream yaml) {
        return loadAll(new UnicodeReader(yaml));
    }
View Full Code Here

TOP

Related Classes of org.yaml.snakeyaml.reader.UnicodeReader

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.