Java 类org.yaml.snakeyaml.events.CollectionStartEvent 实例源码

项目:AndroidApktool    文件:Emitter.java   
private boolean needEvents(int count) {
    int level = 0;
    Iterator<Event> iter = events.iterator();
    iter.next();
    while (iter.hasNext()) {
        Event event = iter.next();
        if (event instanceof DocumentStartEvent || event instanceof CollectionStartEvent) {
            level++;
        } else if (event instanceof DocumentEndEvent || event instanceof CollectionEndEvent) {
            level--;
        } else if (event instanceof StreamEndEvent) {
            level = -1;
        }
        if (level < 0) {
            return false;
        }
    }
    return events.size() < count + 1;
}
项目:5zig-TIMV-Plugin    文件:Emitter.java   
private boolean needEvents(int count) {
    int level = 0;
    Iterator<Event> iter = events.iterator();
    iter.next();
    while (iter.hasNext()) {
        Event event = iter.next();
        if (event instanceof DocumentStartEvent || event instanceof CollectionStartEvent) {
            level++;
        } else if (event instanceof DocumentEndEvent || event instanceof CollectionEndEvent) {
            level--;
        } else if (event instanceof StreamEndEvent) {
            level = -1;
        }
        if (level < 0) {
            return false;
        }
    }
    return events.size() < count + 1;
}
项目:snake-yaml    文件:Emitter.java   
private boolean needEvents(int count) {
    int level = 0;
    Iterator<Event> iter = events.iterator();
    iter.next();
    while (iter.hasNext()) {
        Event event = iter.next();
        if (event instanceof DocumentStartEvent || event instanceof CollectionStartEvent) {
            level++;
        } else if (event instanceof DocumentEndEvent || event instanceof CollectionEndEvent) {
            level--;
        } else if (event instanceof StreamEndEvent) {
            level = -1;
        }
        if (level < 0) {
            return false;
        }
    }
    return events.size() < count + 1;
}
项目:SubServers-2    文件:Emitter.java   
private boolean needEvents(int count) {
    int level = 0;
    Iterator<Event> iter = events.iterator();
    iter.next();
    while (iter.hasNext()) {
        Event event = iter.next();
        if (event instanceof DocumentStartEvent || event instanceof CollectionStartEvent) {
            level++;
        } else if (event instanceof DocumentEndEvent || event instanceof CollectionEndEvent) {
            level--;
        } else if (event instanceof StreamEndEvent) {
            level = -1;
        }
        if (level < 0) {
            return false;
        }
    }
    return events.size() < count + 1;
}
项目:snakeyaml    文件:Emitter.java   
private boolean needEvents(int count) {
    int level = 0;
    Iterator<Event> iter = events.iterator();
    iter.next();
    while (iter.hasNext()) {
        Event event = iter.next();
        if (event instanceof DocumentStartEvent || event instanceof CollectionStartEvent) {
            level++;
        } else if (event instanceof DocumentEndEvent || event instanceof CollectionEndEvent) {
            level--;
        } else if (event instanceof StreamEndEvent) {
            level = -1;
        }
        if (level < 0) {
            return false;
        }
    }
    return events.size() < count + 1;
}
项目:TestTheTeacher    文件:Emitter.java   
private boolean needEvents(int count) {
    int level = 0;
    Iterator<Event> iter = events.iterator();
    iter.next();
    while (iter.hasNext()) {
        Event event = iter.next();
        if (event instanceof DocumentStartEvent || event instanceof CollectionStartEvent) {
            level++;
        } else if (event instanceof DocumentEndEvent || event instanceof CollectionEndEvent) {
            level--;
        } else if (event instanceof StreamEndEvent) {
            level = -1;
        }
        if (level < 0) {
            return false;
        }
    }
    return events.size() < count + 1;
}
项目:org.openntf.domino    文件:Emitter.java   
private boolean needEvents(int count) {
    int level = 0;
    Iterator<Event> iter = events.iterator();
    iter.next();
    while (iter.hasNext()) {
        Event event = iter.next();
        if (event instanceof DocumentStartEvent || event instanceof CollectionStartEvent) {
            level++;
        } else if (event instanceof DocumentEndEvent || event instanceof CollectionEndEvent) {
            level--;
        } else if (event instanceof StreamEndEvent) {
            level = -1;
        }
        if (level < 0) {
            return false;
        }
    }
    return events.size() < count + 1;
}
项目:AndroidApktool    文件:Emitter.java   
private void expectNode(boolean root, boolean mapping, boolean simpleKey) throws IOException {
    rootContext = root;
    mappingContext = mapping;
    simpleKeyContext = simpleKey;
    if (event instanceof AliasEvent) {
        expectAlias();
    } else if (event instanceof ScalarEvent || event instanceof CollectionStartEvent) {
        processAnchor("&");
        processTag();
        if (event instanceof ScalarEvent) {
            expectScalar();
        } else if (event instanceof SequenceStartEvent) {
            if (flowLevel != 0 || canonical || ((SequenceStartEvent) event).getFlowStyle()
                    || checkEmptySequence()) {
                expectFlowSequence();
            } else {
                expectBlockSequence();
            }
        } else {// MappingStartEvent
            if (flowLevel != 0 || canonical || ((MappingStartEvent) event).getFlowStyle()
                    || checkEmptyMapping()) {
                expectFlowMapping();
            } else {
                expectBlockMapping();
            }
        }
    } else {
        throw new EmitterException("需要 NodeEvent 事件, 但却得到了 " + event);
    }
}
项目:AndroidApktool    文件:Emitter.java   
private boolean checkSimpleKey() {
    int length = 0;
    if (event instanceof NodeEvent && ((NodeEvent) event).getAnchor() != null) {
        if (preparedAnchor == null) {
            preparedAnchor = prepareAnchor(((NodeEvent) event).getAnchor());
        }
        length += preparedAnchor.length();
    }
    String tag = null;
    if (event instanceof ScalarEvent) {
        tag = ((ScalarEvent) event).getTag();
    } else if (event instanceof CollectionStartEvent) {
        tag = ((CollectionStartEvent) event).getTag();
    }
    if (tag != null) {
        if (preparedTag == null) {
            preparedTag = prepareTag(tag);
        }
        length += preparedTag.length();
    }
    if (event instanceof ScalarEvent) {
        if (analysis == null) {
            analysis = analyzeScalar(((ScalarEvent) event).getValue());
        }
        length += analysis.scalar.length();
    }
    return length < 128 && (event instanceof AliasEvent
            || (event instanceof ScalarEvent && !analysis.empty && !analysis.multiline)
            || checkEmptySequence() || checkEmptyMapping());
}
项目:5zig-TIMV-Plugin    文件:Emitter.java   
private void expectNode(boolean root, boolean mapping, boolean simpleKey) throws IOException {
    rootContext = root;
    mappingContext = mapping;
    simpleKeyContext = simpleKey;
    if (event instanceof AliasEvent) {
        expectAlias();
    } else if (event instanceof ScalarEvent || event instanceof CollectionStartEvent) {
        processAnchor("&");
        processTag();
        if (event instanceof ScalarEvent) {
            expectScalar();
        } else if (event instanceof SequenceStartEvent) {
            if (flowLevel != 0 || canonical || ((SequenceStartEvent) event).getFlowStyle()
                    || checkEmptySequence()) {
                expectFlowSequence();
            } else {
                expectBlockSequence();
            }
        } else {// MappingStartEvent
            if (flowLevel != 0 || canonical || ((MappingStartEvent) event).getFlowStyle()
                    || checkEmptyMapping()) {
                expectFlowMapping();
            } else {
                expectBlockMapping();
            }
        }
    } else {
        throw new EmitterException("expected NodeEvent, but got " + event);
    }
}
项目:5zig-TIMV-Plugin    文件:Emitter.java   
private boolean checkSimpleKey() {
    int length = 0;
    if (event instanceof NodeEvent && ((NodeEvent) event).getAnchor() != null) {
        if (preparedAnchor == null) {
            preparedAnchor = prepareAnchor(((NodeEvent) event).getAnchor());
        }
        length += preparedAnchor.length();
    }
    String tag = null;
    if (event instanceof ScalarEvent) {
        tag = ((ScalarEvent) event).getTag();
    } else if (event instanceof CollectionStartEvent) {
        tag = ((CollectionStartEvent) event).getTag();
    }
    if (tag != null) {
        if (preparedTag == null) {
            preparedTag = prepareTag(tag);
        }
        length += preparedTag.length();
    }
    if (event instanceof ScalarEvent) {
        if (analysis == null) {
            analysis = analyzeScalar(((ScalarEvent) event).getValue());
        }
        length += analysis.scalar.length();
    }
    return length < 128 && (event instanceof AliasEvent
            || (event instanceof ScalarEvent && !analysis.empty && !analysis.multiline)
            || checkEmptySequence() || checkEmptyMapping());
}
项目:diorite-configs-java8    文件:Emitter.java   
private boolean needEvents(int count)
{
    int level = 0;
    Iterator<Event> iter = this.events.iterator();
    iter.next();
    while (iter.hasNext())
    {
        Event event = iter.next();
        if ((event instanceof DocumentStartEvent) || (event instanceof CollectionStartEvent))
        {
            level++;
        }
        else if ((event instanceof DocumentEndEvent) || (event instanceof CollectionEndEvent))
        {
            level--;
        }
        else if (event instanceof StreamEndEvent)
        {
            level = - 1;
        }
        if (level < 0)
        {
            return false;
        }
    }
    return this.events.size() < (count + 1);
}
项目:diorite-configs-java8    文件:Emitter.java   
boolean checkSimpleKey()
{
    int length = 0;
    if ((this.event instanceof NodeEvent) && (((NodeEvent) this.event).getAnchor() != null))
    {
        if (this.preparedAnchor == null)
        {
            this.preparedAnchor = prepareAnchor(((NodeEvent) this.event).getAnchor());
        }
        length += this.preparedAnchor.length();
    }
    String tag = null;
    if (this.event instanceof ScalarEvent)
    {
        tag = ((ScalarEvent) this.event).getTag();
    }
    else if (this.event instanceof CollectionStartEvent)
    {
        tag = ((CollectionStartEvent) this.event).getTag();
    }
    if (tag != null)
    {
        if (this.preparedTag == null)
        {
            this.preparedTag = this.prepareTag(tag);
        }
        length += this.preparedTag.length();
    }
    if (this.event instanceof ScalarEvent)
    {
        if (this.analysis == null)
        {
            this.analysis = this.analyzeScalar(((ScalarEvent) this.event).getValue());
        }
        length += this.analysis.scalar.length();
    }
    return (length < SMALL_LENGTH) && ((this.event instanceof AliasEvent) ||
                                       ((this.event instanceof ScalarEvent) && ! ((this.analysis == null) || this.analysis.empty) &&
                                        ! this.analysis.multiline) || this.checkEmptySequence() || this.checkEmptyMapping());
}
项目:snake-yaml    文件:Emitter.java   
private void expectNode(boolean root, boolean mapping, boolean simpleKey) throws IOException {
    rootContext = root;
    mappingContext = mapping;
    simpleKeyContext = simpleKey;
    if (event instanceof AliasEvent) {
        expectAlias();
    } else if (event instanceof ScalarEvent || event instanceof CollectionStartEvent) {
        processAnchor("&");
        processTag();
        if (event instanceof ScalarEvent) {
            expectScalar();
        } else if (event instanceof SequenceStartEvent) {
            if (flowLevel != 0 || canonical || ((SequenceStartEvent) event).getFlowStyle()
                    || checkEmptySequence()) {
                expectFlowSequence();
            } else {
                expectBlockSequence();
            }
        } else {// MappingStartEvent
            if (flowLevel != 0 || canonical || ((MappingStartEvent) event).getFlowStyle()
                    || checkEmptyMapping()) {
                expectFlowMapping();
            } else {
                expectBlockMapping();
            }
        }
    } else {
        throw new EmitterException("expected NodeEvent, but got " + event);
    }
}
项目:snake-yaml    文件:Emitter.java   
private boolean checkSimpleKey() {
    int length = 0;
    if (event instanceof NodeEvent && ((NodeEvent) event).getAnchor() != null) {
        if (preparedAnchor == null) {
            preparedAnchor = prepareAnchor(((NodeEvent) event).getAnchor());
        }
        length += preparedAnchor.length();
    }
    String tag = null;
    if (event instanceof ScalarEvent) {
        tag = ((ScalarEvent) event).getTag();
    } else if (event instanceof CollectionStartEvent) {
        tag = ((CollectionStartEvent) event).getTag();
    }
    if (tag != null) {
        if (preparedTag == null) {
            preparedTag = prepareTag(tag);
        }
        length += preparedTag.length();
    }
    if (event instanceof ScalarEvent) {
        if (analysis == null) {
            analysis = analyzeScalar(((ScalarEvent) event).getValue());
        }
        length += analysis.scalar.length();
    }
    return length < 128 && (event instanceof AliasEvent
            || (event instanceof ScalarEvent && !analysis.empty && !analysis.multiline)
            || checkEmptySequence() || checkEmptyMapping());
}
项目:snake-yaml    文件:PyStructureTest.java   
private void compareEvents(List<Event> events1, List<Event> events2, boolean full) {
    assertEquals(events1.size(), events2.size());
    Iterator<Event> iter1 = events1.iterator();
    Iterator<Event> iter2 = events2.iterator();
    while (iter1.hasNext()) {
        Event event1 = iter1.next();
        Event event2 = iter2.next();
        assertEquals(event1.getClass(), event2.getClass());
        if (event1 instanceof AliasEvent && full) {
            assertEquals(((AliasEvent) event1).getAnchor(), ((AliasEvent) event2).getAnchor());
        }
        if (event1 instanceof CollectionStartEvent) {
            String tag1 = ((CollectionStartEvent) event1).getTag();
            String tag2 = ((CollectionStartEvent) event1).getTag();
            if (tag1 != null && !"!".equals(tag1) && tag2 != null && !"!".equals(tag1)) {
                assertEquals(tag1, tag2);
            }
        }
        if (event1 instanceof ScalarEvent) {
            ScalarEvent scalar1 = (ScalarEvent) event1;
            ScalarEvent scalar2 = (ScalarEvent) event2;
            if (scalar1.getImplicit().bothFalse() && scalar2.getImplicit().bothFalse()) {
                assertEquals(scalar1.getTag(), scalar2.getTag());
            }
            assertEquals(scalar1.getValue(), scalar2.getValue());
        }
    }
}
项目:SubServers-2    文件:Emitter.java   
private void expectNode(boolean root, boolean mapping, boolean simpleKey) throws IOException {
    rootContext = root;
    mappingContext = mapping;
    simpleKeyContext = simpleKey;
    if (event instanceof AliasEvent) {
        expectAlias();
    } else if (event instanceof ScalarEvent || event instanceof CollectionStartEvent) {
        processAnchor("&");
        processTag();
        if (event instanceof ScalarEvent) {
            expectScalar();
        } else if (event instanceof SequenceStartEvent) {
            if (flowLevel != 0 || canonical || ((SequenceStartEvent) event).getFlowStyle()
                    || checkEmptySequence()) {
                expectFlowSequence();
            } else {
                expectBlockSequence();
            }
        } else {// MappingStartEvent
            if (flowLevel != 0 || canonical || ((MappingStartEvent) event).getFlowStyle()
                    || checkEmptyMapping()) {
                expectFlowMapping();
            } else {
                expectBlockMapping();
            }
        }
    } else {
        throw new EmitterException("expected NodeEvent, but got " + event);
    }
}
项目:SubServers-2    文件:Emitter.java   
private boolean checkSimpleKey() {
    int length = 0;
    if (event instanceof NodeEvent && ((NodeEvent) event).getAnchor() != null) {
        if (preparedAnchor == null) {
            preparedAnchor = prepareAnchor(((NodeEvent) event).getAnchor());
        }
        length += preparedAnchor.length();
    }
    String tag = null;
    if (event instanceof ScalarEvent) {
        tag = ((ScalarEvent) event).getTag();
    } else if (event instanceof CollectionStartEvent) {
        tag = ((CollectionStartEvent) event).getTag();
    }
    if (tag != null) {
        if (preparedTag == null) {
            preparedTag = prepareTag(tag);
        }
        length += preparedTag.length();
    }
    if (event instanceof ScalarEvent) {
        if (analysis == null) {
            analysis = analyzeScalar(((ScalarEvent) event).getValue());
        }
        length += analysis.scalar.length();
    }
    return length < 128 && (event instanceof AliasEvent
            || (event instanceof ScalarEvent && !analysis.empty && !analysis.multiline)
            || checkEmptySequence() || checkEmptyMapping());
}
项目:Diorite    文件:Emitter.java   
private boolean needEvents(int count)
{
    int level = 0;
    Iterator<Event> iter = this.events.iterator();
    iter.next();
    while (iter.hasNext())
    {
        Event event = iter.next();
        if ((event instanceof DocumentStartEvent) || (event instanceof CollectionStartEvent))
        {
            level++;
        }
        else if ((event instanceof DocumentEndEvent) || (event instanceof CollectionEndEvent))
        {
            level--;
        }
        else if (event instanceof StreamEndEvent)
        {
            level = - 1;
        }
        if (level < 0)
        {
            return false;
        }
    }
    return this.events.size() < (count + 1);
}
项目:Diorite    文件:Emitter.java   
boolean checkSimpleKey()
{
    int length = 0;
    if ((this.event instanceof NodeEvent) && (((NodeEvent) this.event).getAnchor() != null))
    {
        if (this.preparedAnchor == null)
        {
            this.preparedAnchor = prepareAnchor(((NodeEvent) this.event).getAnchor());
        }
        length += this.preparedAnchor.length();
    }
    String tag = null;
    if (this.event instanceof ScalarEvent)
    {
        tag = ((ScalarEvent) this.event).getTag();
    }
    else if (this.event instanceof CollectionStartEvent)
    {
        tag = ((CollectionStartEvent) this.event).getTag();
    }
    if (tag != null)
    {
        if (this.preparedTag == null)
        {
            this.preparedTag = this.prepareTag(tag);
        }
        length += this.preparedTag.length();
    }
    if (this.event instanceof ScalarEvent)
    {
        if (this.analysis == null)
        {
            this.analysis = this.analyzeScalar(((ScalarEvent) this.event).getValue());
        }
        length += this.analysis.scalar.length();
    }
    return (length < SMALL_LENGTH) && ((this.event instanceof AliasEvent) ||
                                       ((this.event instanceof ScalarEvent) && ! ((this.analysis == null) || this.analysis.empty) &&
                                        ! this.analysis.multiline) || this.checkEmptySequence() || this.checkEmptyMapping());
}
项目:snakeyaml    文件:Emitter.java   
private void expectNode(boolean root, boolean mapping, boolean simpleKey) throws IOException {
    rootContext = root;
    mappingContext = mapping;
    simpleKeyContext = simpleKey;
    if (event instanceof AliasEvent) {
        expectAlias();
    } else if (event instanceof ScalarEvent || event instanceof CollectionStartEvent) {
        processAnchor("&");
        processTag();
        if (event instanceof ScalarEvent) {
            expectScalar();
        } else if (event instanceof SequenceStartEvent) {
            if (flowLevel != 0 || canonical || ((SequenceStartEvent) event).getFlowStyle()
                    || checkEmptySequence()) {
                expectFlowSequence();
            } else {
                expectBlockSequence();
            }
        } else {// MappingStartEvent
            if (flowLevel != 0 || canonical || ((MappingStartEvent) event).getFlowStyle()
                    || checkEmptyMapping()) {
                expectFlowMapping();
            } else {
                expectBlockMapping();
            }
        }
    } else {
        throw new EmitterException("expected NodeEvent, but got " + event);
    }
}
项目:snakeyaml    文件:Emitter.java   
private boolean checkSimpleKey() {
    int length = 0;
    if (event instanceof NodeEvent && ((NodeEvent) event).getAnchor() != null) {
        if (preparedAnchor == null) {
            preparedAnchor = prepareAnchor(((NodeEvent) event).getAnchor());
        }
        length += preparedAnchor.length();
    }
    String tag = null;
    if (event instanceof ScalarEvent) {
        tag = ((ScalarEvent) event).getTag();
    } else if (event instanceof CollectionStartEvent) {
        tag = ((CollectionStartEvent) event).getTag();
    }
    if (tag != null) {
        if (preparedTag == null) {
            preparedTag = prepareTag(tag);
        }
        length += preparedTag.length();
    }
    if (event instanceof ScalarEvent) {
        if (analysis == null) {
            analysis = analyzeScalar(((ScalarEvent) event).getValue());
        }
        length += analysis.scalar.length();
    }
    return length < 128 && (event instanceof AliasEvent
            || (event instanceof ScalarEvent && !analysis.empty && !analysis.multiline)
            || checkEmptySequence() || checkEmptyMapping());
}
项目:snakeyaml    文件:PyStructureTest.java   
private void compareEvents(List<Event> events1, List<Event> events2, boolean full) {
    assertEquals(events1.size(), events2.size());
    Iterator<Event> iter1 = events1.iterator();
    Iterator<Event> iter2 = events2.iterator();
    while (iter1.hasNext()) {
        Event event1 = iter1.next();
        Event event2 = iter2.next();
        assertEquals(event1.getClass(), event2.getClass());
        if (event1 instanceof AliasEvent && full) {
            assertEquals(((AliasEvent) event1).getAnchor(), ((AliasEvent) event2).getAnchor());
        }
        if (event1 instanceof CollectionStartEvent) {
            String tag1 = ((CollectionStartEvent) event1).getTag();
            String tag2 = ((CollectionStartEvent) event1).getTag();
            if (tag1 != null && !"!".equals(tag1) && tag2 != null && !"!".equals(tag1)) {
                assertEquals(tag1, tag2);
            }
        }
        if (event1 instanceof ScalarEvent) {
            ScalarEvent scalar1 = (ScalarEvent) event1;
            ScalarEvent scalar2 = (ScalarEvent) event2;
            if (scalar1.getImplicit().bothFalse() && scalar2.getImplicit().bothFalse()) {
                assertEquals(scalar1.getTag(), scalar2.getTag());
            }
            assertEquals(scalar1.getValue(), scalar2.getValue());
        }
    }
}
项目:TestTheTeacher    文件:Emitter.java   
private void expectNode(boolean root, boolean mapping, boolean simpleKey) throws IOException {
    rootContext = root;
    mappingContext = mapping;
    simpleKeyContext = simpleKey;
    if (event instanceof AliasEvent) {
        expectAlias();
    } else if (event instanceof ScalarEvent || event instanceof CollectionStartEvent) {
        processAnchor("&");
        processTag();
        if (event instanceof ScalarEvent) {
            expectScalar();
        } else if (event instanceof SequenceStartEvent) {
            if (flowLevel != 0 || canonical || ((SequenceStartEvent) event).getFlowStyle()
                    || checkEmptySequence()) {
                expectFlowSequence();
            } else {
                expectBlockSequence();
            }
        } else {// MappingStartEvent
            if (flowLevel != 0 || canonical || ((MappingStartEvent) event).getFlowStyle()
                    || checkEmptyMapping()) {
                expectFlowMapping();
            } else {
                expectBlockMapping();
            }
        }
    } else {
        throw new EmitterException("expected NodeEvent, but got " + event);
    }
}
项目:TestTheTeacher    文件:Emitter.java   
private boolean checkSimpleKey() {
    int length = 0;
    if (event instanceof NodeEvent && ((NodeEvent) event).getAnchor() != null) {
        if (preparedAnchor == null) {
            preparedAnchor = prepareAnchor(((NodeEvent) event).getAnchor());
        }
        length += preparedAnchor.length();
    }
    String tag = null;
    if (event instanceof ScalarEvent) {
        tag = ((ScalarEvent) event).getTag();
    } else if (event instanceof CollectionStartEvent) {
        tag = ((CollectionStartEvent) event).getTag();
    }
    if (tag != null) {
        if (preparedTag == null) {
            preparedTag = prepareTag(tag);
        }
        length += preparedTag.length();
    }
    if (event instanceof ScalarEvent) {
        if (analysis == null) {
            analysis = analyzeScalar(((ScalarEvent) event).getValue());
        }
        length += analysis.scalar.length();
    }
    return (length < 128 && (event instanceof AliasEvent
            || (event instanceof ScalarEvent && !analysis.empty && !analysis.multiline)
            || checkEmptySequence() || checkEmptyMapping()));
}
项目:org.openntf.domino    文件:Emitter.java   
private void expectNode(boolean root, boolean mapping, boolean simpleKey) throws IOException {
    rootContext = root;
    mappingContext = mapping;
    simpleKeyContext = simpleKey;
    if (event instanceof AliasEvent) {
        expectAlias();
    } else if (event instanceof ScalarEvent || event instanceof CollectionStartEvent) {
        processAnchor("&");
        processTag();
        if (event instanceof ScalarEvent) {
            expectScalar();
        } else if (event instanceof SequenceStartEvent) {
            if (flowLevel != 0 || canonical || ((SequenceStartEvent) event).getFlowStyle()
                    || checkEmptySequence()) {
                expectFlowSequence();
            } else {
                expectBlockSequence();
            }
        } else {// MappingStartEvent
            if (flowLevel != 0 || canonical || ((MappingStartEvent) event).getFlowStyle()
                    || checkEmptyMapping()) {
                expectFlowMapping();
            } else {
                expectBlockMapping();
            }
        }
    } else {
        throw new EmitterException("expected NodeEvent, but got " + event);
    }
}
项目:org.openntf.domino    文件:Emitter.java   
private boolean checkSimpleKey() {
    int length = 0;
    if (event instanceof NodeEvent && ((NodeEvent) event).getAnchor() != null) {
        if (preparedAnchor == null) {
            preparedAnchor = prepareAnchor(((NodeEvent) event).getAnchor());
        }
        length += preparedAnchor.length();
    }
    String tag = null;
    if (event instanceof ScalarEvent) {
        tag = ((ScalarEvent) event).getTag();
    } else if (event instanceof CollectionStartEvent) {
        tag = ((CollectionStartEvent) event).getTag();
    }
    if (tag != null) {
        if (preparedTag == null) {
            preparedTag = prepareTag(tag);
        }
        length += preparedTag.length();
    }
    if (event instanceof ScalarEvent) {
        if (analysis == null) {
            analysis = analyzeScalar(((ScalarEvent) event).getValue());
        }
        length += analysis.scalar.length();
    }
    return (length < 128 && (event instanceof AliasEvent
            || (event instanceof ScalarEvent && !analysis.empty && !analysis.multiline)
            || checkEmptySequence() || checkEmptyMapping()));
}
项目:diorite-configs-java8    文件:Emitter.java   
void expectNode(boolean root, boolean mapping, boolean simpleKey, @Nullable Integer lastIndent) throws IOException
{
    this.rootContext = root;
    this.mappingContext = mapping;
    this.simpleKeyContext = simpleKey;
    if (this.event instanceof AliasEvent)
    {
        this.expectAlias();
    }
    else if ((this.event instanceof ScalarEvent) || (this.event instanceof CollectionStartEvent))
    {
        this.processAnchor("&");
        this.processTag();
        if (this.event instanceof ScalarEvent)
        {
            this.expectScalar(lastIndent);
        }
        else if (this.event instanceof SequenceStartEvent)
        {
            if ((this.flowLevel != 0) || this.canonical || ((SequenceStartEvent) this.event).getFlowStyle()
                || this.checkEmptySequence())
            {
                this.expectFlowSequence();
            }
            else
            {
                this.expectBlockSequence();
            }
        }
        else
        {// MappingStartEvent
            if ((this.flowLevel != 0) || this.canonical || ((MappingStartEvent) this.event).getFlowStyle() || this.checkEmptyMapping())
            {
                this.expectFlowMapping();
            }
            else
            {
                this.expectBlockMapping();
            }
        }
    }
    else
    {
        throw new EmitterException("expected NodeEvent, but got " + this.event);
    }
}
项目:Diorite    文件:Emitter.java   
void expectNode(boolean root, boolean mapping, boolean simpleKey, @Nullable Integer lastIndent) throws IOException
{
    this.rootContext = root;
    this.mappingContext = mapping;
    this.simpleKeyContext = simpleKey;
    if (this.event instanceof AliasEvent)
    {
        this.expectAlias();
    }
    else if ((this.event instanceof ScalarEvent) || (this.event instanceof CollectionStartEvent))
    {
        this.processAnchor("&");
        this.processTag();
        if (this.event instanceof ScalarEvent)
        {
            this.expectScalar(lastIndent);
        }
        else if (this.event instanceof SequenceStartEvent)
        {
            if ((this.flowLevel != 0) || this.canonical || ((SequenceStartEvent) this.event).getFlowStyle()
                || this.checkEmptySequence())
            {
                this.expectFlowSequence();
            }
            else
            {
                this.expectBlockSequence();
            }
        }
        else
        {// MappingStartEvent
            if ((this.flowLevel != 0) || this.canonical || ((MappingStartEvent) this.event).getFlowStyle() || this.checkEmptyMapping())
            {
                this.expectFlowMapping();
            }
            else
            {
                this.expectBlockMapping();
            }
        }
    }
    else
    {
        throw new EmitterException("expected NodeEvent, but got " + this.event);
    }
}