Package org.yaml.snakeyaml.events

Examples of org.yaml.snakeyaml.events.MappingStartEvent


        IRubyObject anchor = args[0];
        IRubyObject tag = args[1];
        IRubyObject implicit = args[2];
        IRubyObject style = args[3];

        MappingStartEvent event = new MappingStartEvent(
                anchor.isNil() ? null : anchor.asJavaString(),
                tag.isNil() ? null : tag.asJavaString(),
                implicit.isTrue(),
                NULL_MARK,
                NULL_MARK,
View Full Code Here


                    invoke(
                            context,
                            handler,
                            "end_sequence");
                } else if (event.is(ID.MappingStart)) {
                    MappingStartEvent mse = (MappingStartEvent)event;
                    IRubyObject anchor = mse.getAnchor() == null ?
                        runtime.getNil() :
                        RubyString.newString(runtime, mse.getAnchor());
                    IRubyObject tag = mse.getTag() == null ?
                        runtime.getNil() :
                        RubyString.newString(runtime, mse.getTag());
                    IRubyObject implicit = runtime.newBoolean(mse.getImplicit());
                    IRubyObject style = runtime.newFixnum(mse.getFlowStyle() ? 1 : 0);

                    invoke(
                            context,
                            handler,
                            "start_mapping",
View Full Code Here

        IRubyObject implicit = args[2];
        IRubyObject style = args[3];

        final int MAPPING_BLOCK = 1; // see psych/nodes/mapping.rb

        MappingStartEvent event = new MappingStartEvent(
                anchor.isNil() ? null : anchor.asJavaString(),
                tag.isNil() ? null : tag.asJavaString(),
                implicit.isTrue(),
                NULL_MARK,
                NULL_MARK,
View Full Code Here

                        .getValue(), null, null, null));
            } else if (scanner.checkToken(Token.ID.FlowSequenceStart)) {
                events.add(new SequenceStartEvent(anchor, tag, false, null, null, null));
                parseSequence();
            } else if (scanner.checkToken(Token.ID.FlowMappingStart)) {
                events.add(new MappingStartEvent(anchor, tag, false, null, null, null));
                parseMapping();
            } else {
                throw new CanonicalException("SCALAR, '[', or '{' is expected, got "
                        + scanner.tokens.get(0));
            }
View Full Code Here

                String tag = (String) mapping.get("tag");
                Boolean implicit = (Boolean) mapping.get("implicit");
                if (implicit == null) {
                    implicit = true;
                }
                value = new MappingStartEvent((String) mapping.get("anchor"), tag, implicit, null,
                        null, false);
            } else if (className.equals("DocumentEndEvent")) {
                value = new DocumentEndEvent(null, null, false);
            } else if (className.equals("DocumentStartEvent")) {
                Map<String, String> tags = (Map<String, String>) mapping.get("tags");
View Full Code Here

        Parser parser = new ParserImpl(reader);
        Mark dummyMark = new Mark("dummy", 0, 0, 0, "", 0);
        LinkedList<Event> etalonEvents = new LinkedList<Event>();
        etalonEvents.add(new StreamStartEvent(dummyMark, dummyMark));
        etalonEvents.add(new DocumentStartEvent(dummyMark, dummyMark, false, null, null));
        etalonEvents.add(new MappingStartEvent(null, null, true, dummyMark, dummyMark,
                Boolean.FALSE));
        etalonEvents.add(new ScalarEvent(null, null, new ImplicitTuple(true, false), "string",
                dummyMark, dummyMark, (char) 0));
        etalonEvents.add(new ScalarEvent(null, null, new ImplicitTuple(true, false), "abcd",
                dummyMark, dummyMark, (char) 0));
View Full Code Here

        Mark dummyMark = new Mark("dummy", 0, 0, 0, "", 0);
        LinkedList<Event> etalonEvents = new LinkedList<Event>();
        etalonEvents.add(new StreamStartEvent(dummyMark, dummyMark));
        etalonEvents.add(new DocumentStartEvent(dummyMark, dummyMark, false, null, null));
        etalonEvents
                .add(new MappingStartEvent(null, null, true, dummyMark, dummyMark, Boolean.TRUE));
        etalonEvents.add(new ScalarEvent(null, null, new ImplicitTuple(true, false), "american",
                dummyMark, dummyMark, (char) 0));
        etalonEvents.add(new SequenceStartEvent(null, null, true, dummyMark, dummyMark,
                Boolean.FALSE));
        etalonEvents.add(new ScalarEvent(null, null, new ImplicitTuple(true, false),
View Full Code Here

                                SequenceStartEvent seqStart = (SequenceStartEvent) event;
                                event = new SequenceStartEvent(seqStart.getAnchor(),
                                        seqStart.getTag(), seqStart.getImplicit(),
                                        seqStart.getStartMark(), seqStart.getEndMark(), flowStyle);
                            } else if (event instanceof MappingStartEvent) {
                                MappingStartEvent mapStart = (MappingStartEvent) event;
                                event = new MappingStartEvent(mapStart.getAnchor(),
                                        mapStart.getTag(), mapStart.getImplicit(),
                                        mapStart.getStartMark(), mapStart.getEndMark(), flowStyle);
                            }
                            styledEvents.add(event);
                        }
                        // emit
                        String data = emit(styledEvents);
View Full Code Here

        IRubyObject implicit = args[2];
        IRubyObject style = args[3];

        final int MAPPING_BLOCK = 1; // see psych/nodes/mapping.rb

        MappingStartEvent event = new MappingStartEvent(
                anchor.isNil() ? null : anchor.asJavaString(),
                tag.isNil() ? null : tag.asJavaString(),
                implicit.isTrue(),
                NULL_MARK,
                NULL_MARK,
View Full Code Here

                                token.getStartMark());
                    }
                }
                if (scanner.checkToken(Token.ID.Key)) {
                    Token token = scanner.peekToken();
                    Event event = new MappingStartEvent(null, null, true, token.getStartMark(),
                            token.getEndMark(), Boolean.TRUE);
                    state = new ParseFlowSequenceEntryMappingKey();
                    return event;
                } else if (!scanner.checkToken(Token.ID.FlowSequenceEnd)) {
                    states.push(new ParseFlowSequenceEntry(false));
View Full Code Here

TOP

Related Classes of org.yaml.snakeyaml.events.MappingStartEvent

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.