Package org.yaml.snakeyaml.parser

Examples of org.yaml.snakeyaml.parser.ParserImpl$ParseFlowSequenceEntryMappingEnd


        if (target.respondsTo("read")) {
            reader = new StreamReader(new InputStreamReader(new IOInputStream(target)));
        } else {
            reader = new StreamReader(new StringReader(target.convertToString().asJavaString()));
        }
        Parser parser = new ParserImpl(reader);
        IRubyObject handler = getInstanceVariable("@handler");
        Event event;

        while (true) {
            try {
                event = parser.getEvent();

                // FIXME: Event should expose a getID, so it can be switched
                if (event.is(ID.StreamStart)) {
                    invoke(
                            context,
View Full Code Here


    public IRubyObject parse(ThreadContext context, IRubyObject yaml, IRubyObject path) {
        Ruby runtime = context.runtime;
        boolean tainted = yaml.isTaint() || yaml instanceof RubyIO;

        try {
            parser = new ParserImpl(readerFor(context, yaml));

            if (path.isNil() && yaml.respondsTo("path")) {
                path = yaml.callMethod(context, "path");
            }
View Full Code Here

        return construct(new Constructor(), data);
    }

    private Object construct(Constructor constructor, String data) {
        StreamReader reader = new StreamReader(data);
        Parser parser = new ParserImpl(reader);
        Resolver resolver = new Resolver();
        Composer composer = new Composer(parser, resolver);
        constructor.setComposer(composer);
        return constructor.getSingleData(Object.class);
    }
View Full Code Here

    }

    @SuppressWarnings("unchecked")
    private List<Object> construct(Constructor constructor, String data) {
        StreamReader reader = new StreamReader(data);
        Parser parser = new ParserImpl(reader);
        Resolver resolver = new Resolver();
        Composer composer = new Composer(parser, resolver);
        constructor.setComposer(composer);
        List<Object> result = (List<Object>) constructor.getSingleData(Object.class);
        return result;
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

                }
                //
                String data = stream.toString();
                List<Event> newEvents = new ArrayList<Event>();
                StreamReader reader = new StreamReader(data);
                Parser parser = new ParserImpl(reader);
                while (parser.peekEvent() != null) {
                    Event event = parser.getEvent();
                    newEvents.add(event);
                }
                // check
                assertEquals(events.size(), newEvents.size());
                Iterator<Event> iter1 = events.iterator();
View Full Code Here

        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);
                }
                input.close();
                //
                for (Boolean flowStyle : new Boolean[] { Boolean.FALSE, Boolean.TRUE }) {
View Full Code Here

        }
        return writer.toString();
    }

    private List<Event> parse(String data) {
        ParserImpl parser = new ParserImpl(new StreamReader(data));
        List<Event> newEvents = new ArrayList<Event>();
        while (parser.peekEvent() != null) {
            newEvents.add(parser.getEvent());
        }
        return newEvents;
    }
View Full Code Here

                }
                //
                String data = stream.toString();
                List<Event> newEvents = new ArrayList<Event>();
                StreamReader reader = new StreamReader(data);
                Parser parser = new ParserImpl(reader);
                while (parser.peekEvent() != null) {
                    Event event = parser.getEvent();
                    newEvents.add(event);
                }
                // check
                assertEquals(events.size(), newEvents.size());
                Iterator<Event> iter1 = events.iterator();
View Full Code Here

        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());
        }
        input.close();
        return result;
    }
View Full Code Here

TOP

Related Classes of org.yaml.snakeyaml.parser.ParserImpl$ParseFlowSequenceEntryMappingEnd

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.