Java 类org.yaml.snakeyaml.tokens.TagToken 实例源码

项目:snake-yaml    文件:CanonicalScanner.java   
private Token scanTag() {
    index++;
    int start = index;
    while (" \n\0".indexOf(data.charAt(index)) == -1) {
        index++;
    }
    String value = data.substring(start, index);
    if (value.length() == 0) {
        value = "!";
    } else if (value.charAt(0) == '!') {
        value = Tag.PREFIX + value.substring(1);
    } else if (value.charAt(0) == '<' && value.charAt(value.length() - 1) == '>') {
        value = value.substring(1, value.length() - 1);
    } else {
        value = "!" + value;
    }
    return new TagToken(new TagTuple("", value), mark, mark);
}
项目:snakeyaml    文件:CanonicalScanner.java   
private Token scanTag() {
    index++;
    int start = index;
    while (" \n\0".indexOf(data.charAt(index)) == -1) {
        index++;
    }
    String value = data.substring(start, index);
    if (value.length() == 0) {
        value = "!";
    } else if (value.charAt(0) == '!') {
        value = Tag.PREFIX + value.substring(1);
    } else if (value.charAt(0) == '<' && value.charAt(value.length() - 1) == '>') {
        value = value.substring(1, value.length() - 1);
    } else {
        value = "!" + value;
    }
    return new TagToken(new TagTuple("", value), mark, mark);
}