Package org.yaml.snakeyaml.events

Examples of org.yaml.snakeyaml.events.AliasEvent


        return this;
    }
   
    @JRubyMethod
    public IRubyObject alias(ThreadContext context, IRubyObject anchor) {
        AliasEvent event = new AliasEvent(anchor.asJavaString(), NULL_MARK, NULL_MARK);
        emit(context, event);
        return this;
    }
View Full Code Here


                            context,
                            handler,
                            "end_document",
                            runtime.newBoolean(dee.getExplicit()));
                } else if (event.is(ID.Alias)) {
                    AliasEvent ae = (AliasEvent)event;
                    IRubyObject alias = runtime.getNil();
                    if (ae.getAnchor() != null) {
                        alias = RubyString.newString(runtime, ae.getAnchor());
                    }

                    invoke(
                            context,
                            handler,
View Full Code Here

        return this;
    }
   
    @JRubyMethod
    public IRubyObject alias(ThreadContext context, IRubyObject anchor) {
        AliasEvent event = new AliasEvent(anchor.asJavaString(), NULL_MARK, NULL_MARK);
        emit(context, event);
        return this;
    }
View Full Code Here

    // node: ALIAS | ANCHOR? TAG? (SCALAR|sequence|mapping)
    private void parseNode() {
        if (scanner.checkToken(Token.ID.Alias)) {
            AliasToken token = (AliasToken) scanner.getToken();
            events.add(new AliasEvent(token.getValue(), null, null));
        } else {
            String anchor = null;
            if (scanner.checkToken(Token.ID.Anchor)) {
                AnchorToken token = (AnchorToken) scanner.getToken();
                anchor = token.getValue();
View Full Code Here

                mapping = constructMapping((MappingNode) node);
            }
            String className = node.getTag().getValue().substring(1) + "Event";
            Event value;
            if (className.equals("AliasEvent")) {
                value = new AliasEvent((String) mapping.get("anchor"), null, null);
            } else if (className.equals("ScalarEvent")) {
                String tag = (String) mapping.get("tag");
                String v = (String) mapping.get("value");
                if (v == null) {
                    v = "";
View Full Code Here

        return this;
    }
   
    @JRubyMethod
    public IRubyObject alias(ThreadContext context, IRubyObject anchor) {
        AliasEvent event = new AliasEvent(anchor.asJavaString(), NULL_MARK, NULL_MARK);
        emit(context, event);
        return this;
    }
View Full Code Here

        if (node.getNodeId() == NodeId.anchor) {
            node = ((AnchorNode) node).getRealNode();
        }
        String tAlias = this.anchors.get(node);
        if (this.serializedNodes.contains(node)) {
            this.emitter.emit(new AliasEvent(tAlias, null, null));
        } else {
            this.serializedNodes.add(node);
            switch (node.getNodeId()) {
            case scalar:
                ScalarNode scalarNode = (ScalarNode) node;
View Full Code Here

        Mark startMark = null;
        Mark endMark = null;
        Mark tagMark = null;
        if (scanner.checkToken(Token.ID.Alias)) {
            AliasToken token = (AliasToken) scanner.getToken();
            event = new AliasEvent(token.getValue(), token.getStartMark(), token.getEndMark());
            state = states.pop();
        } else {
            String anchor = null;
            TagTuple tagTokenTag = null;
            if (scanner.checkToken(Token.ID.Anchor)) {
View Full Code Here

    }

    private Node composeNode(Node parent) {
        recursiveNodes.add(parent);
        if (parser.checkEvent(Event.ID.Alias)) {
            AliasEvent event = (AliasEvent) parser.getEvent();
            String anchor = event.getAnchor();
            if (!anchors.containsKey(anchor)) {
                throw new ComposerException(null, null, "found undefined alias " + anchor,
                        event.getStartMark());
            }
            Node result = anchors.get(anchor);
            if (recursiveNodes.remove(result)) {
                result.setTwoStepsConstruction(true);
            }
            return result;
        }
        NodeEvent event = (NodeEvent) parser.peekEvent();
        String anchor = null;
        anchor = event.getAnchor();
        if (anchor != null && anchors.containsKey(anchor)) {
            throw new ComposerException("found duplicate anchor " + anchor + "; first occurence",
                    this.anchors.get(anchor).getStartMark(), "second occurence",
                    event.getStartMark());
        }
        Node node = null;
        if (parser.checkEvent(Event.ID.Scalar)) {
            node = composeScalarNode(anchor);
        } else if (parser.checkEvent(Event.ID.SequenceStart)) {
View Full Code Here

TOP

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

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.