Package org.yaml.snakeyaml.reader

Examples of org.yaml.snakeyaml.reader.UnicodeReader


        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


    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

  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

  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

            }
        }
    }

    private List<Node> compose_all(InputStream file) {
        Composer composer = new Composer(new ParserImpl(new StreamReader(new UnicodeReader(file))),
                new Resolver());
        List<Node> documents = new ArrayList<Node>();
        while (composer.checkNode()) {
            documents.add(composer.getNode());
        }
View Full Code Here

        }
        return documents;
    }

    private List<Node> canonical_compose_all(InputStream file) {
        StreamReader reader = new StreamReader(new UnicodeReader(file));
        StringBuilder buffer = new StringBuilder();
        while (reader.peek() != '\0') {
            buffer.append(reader.peek());
            reader.forward();
        }
View Full Code Here

    public void testReaderUnicodeErrors() throws IOException {
        File[] inputs = getStreamsByExtension(".stream-error");
        for (int i = 0; i < inputs.length; i++) {
            InputStream input = new FileInputStream(inputs[i]);
            StreamReader stream = new StreamReader(new UnicodeReader(input));
            try {
                while (stream.peek() != '\u0000') {
                    stream.forward();
                }
                fail("Invalid stream must not be accepted: " + inputs[i].getAbsolutePath()
View Full Code Here

            for (int j = 0; j < split.length; j++) {
                tokens2.add(split[j]);
            }
            //
            List<String> tokens1 = new ArrayList<String>();
            StreamReader reader = new StreamReader(new UnicodeReader(new FileInputStream(
                    getFileByName(dataName))));
            Scanner scanner = new ScannerImpl(reader);
            try {
                while (scanner.checkToken(new Token.ID[0])) {
                    Token token = scanner.getToken();
View Full Code Here

        File[] files = getStreamsByExtension(".data", true);
        assertTrue("No test files found.", files.length > 0);
        for (File file : files) {
            List<String> tokens = new ArrayList<String>();
            InputStream input = new FileInputStream(file);
            StreamReader reader = new StreamReader(new UnicodeReader(input));
            Scanner scanner = new ScannerImpl(reader);
            try {
                while (scanner.checkToken(new Token.ID[0])) {
                    Token token = scanner.getToken();
                    tokens.add(token.getClass().getName());
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.