Package org.yaml.snakeyaml.events

Examples of org.yaml.snakeyaml.events.SequenceStartEvent


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

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


                            tag,
                            plain_implicit,
                            quoted_implicit,
                            style);
                } else if (event.is(ID.SequenceStart)) {
                    SequenceStartEvent sse = (SequenceStartEvent)event;
                    IRubyObject anchor = sse.getAnchor() == null ?
                        runtime.getNil() :
                        RubyString.newString(runtime, sse.getAnchor());
                    IRubyObject tag = sse.getTag() == null ?
                        runtime.getNil() :
                        RubyString.newString(runtime, sse.getTag());
                    IRubyObject implicit = runtime.newBoolean(sse.getImplicit());
                    IRubyObject style = runtime.newFixnum(sse.getFlowStyle() ? 1 : 0);

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

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

        final int SEQUENCE_BLOCK = 1; // see psych/nodes/sequence.rb

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

            if (scanner.checkToken(Token.ID.Scalar)) {
                ScalarToken token = (ScalarToken) scanner.getToken();
                events.add(new ScalarEvent(anchor, tag, new ImplicitTuple(false, false), token
                        .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 {
View Full Code Here

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

                                ScalarEvent scalar = (ScalarEvent) event;
                                event = new ScalarEvent(scalar.getAnchor(), scalar.getTag(),
                                        scalar.getImplicit(), scalar.getValue(),
                                        scalar.getStartMark(), scalar.getEndMark(), style.getChar());
                            } else if (event instanceof SequenceStartEvent) {
                                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);
View Full Code Here

        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),
                "Boston Red Sox", dummyMark, dummyMark, (char) 0));
        etalonEvents.add(new SequenceEndEvent(dummyMark, dummyMark));
        etalonEvents.add(new MappingEndEvent(dummyMark, dummyMark));
View Full Code Here

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

        final int SEQUENCE_BLOCK = 1; // see psych/nodes/sequence.rb

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

                break;
            case sequence:
                SequenceNode seqNode = (SequenceNode) node;
                boolean implicitS = (node.getTag().equals(this.resolver.resolve(NodeId.sequence,
                        null, true)));
                this.emitter.emit(new SequenceStartEvent(tAlias, node.getTag().getValue(),
                        implicitS, null, null, seqNode.getFlowStyle()));
                int indexCounter = 0;
                List<Node> list = seqNode.getValue();
                for (Node item : list) {
                    serializeNode(item, node);
View Full Code Here

        }
        return node;
    }

    private Node composeSequenceNode(String anchor) {
        SequenceStartEvent startEvent = (SequenceStartEvent) parser.getEvent();
        String tag = startEvent.getTag();
        Tag nodeTag;
        boolean resolved = false;
        if (tag == null || tag.equals("!")) {
            nodeTag = resolver.resolve(NodeId.sequence, null, startEvent.getImplicit());
            resolved = true;
        } else {
            nodeTag = new Tag(tag);
        }
        final ArrayList<Node> children = new ArrayList<Node>();
        SequenceNode node = new SequenceNode(nodeTag, resolved, children,
                startEvent.getStartMark(), null, startEvent.getFlowStyle());
        if (anchor != null) {
            anchors.put(anchor, node);
        }
        int index = 0;
        while (!parser.checkEvent(Event.ID.SequenceEnd)) {
View Full Code Here

TOP

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

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.