当前位置: 首页>>代码示例>>Java>>正文


Java DirectiveToken类代码示例

本文整理汇总了Java中org.yaml.snakeyaml.tokens.DirectiveToken的典型用法代码示例。如果您正苦于以下问题:Java DirectiveToken类的具体用法?Java DirectiveToken怎么用?Java DirectiveToken使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DirectiveToken类属于org.yaml.snakeyaml.tokens包,在下文中一共展示了DirectiveToken类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: scanDirective

import org.yaml.snakeyaml.tokens.DirectiveToken; //导入依赖的package包/类
@SuppressWarnings({ "unchecked", "rawtypes" })
private Token scanDirective() {
    // See the specification for details.
    Mark startMark = reader.getMark();
    Mark endMark;
    reader.forward();
    String name = scanDirectiveName(startMark);
    List<?> value = null;
    if ("YAML".equals(name)) {
        value = scanYamlDirectiveValue(startMark);
        endMark = reader.getMark();
    } else if ("TAG".equals(name)) {
        value = scanTagDirectiveValue(startMark);
        endMark = reader.getMark();
    } else {
        endMark = reader.getMark();
        int ff = 0;
        while (Constant.NULL_OR_LINEBR.hasNo(reader.peek(ff))) {
            ff++;
        }
        if (ff > 0) {
            reader.forward(ff);
        }
    }
    scanDirectiveIgnoredLine(startMark);
    return new DirectiveToken(name, value, startMark, endMark);
}
 
开发者ID:imkiva,项目名称:AndroidApktool,代码行数:28,代码来源:ScannerImpl.java

示例2: scanDirective

import org.yaml.snakeyaml.tokens.DirectiveToken; //导入依赖的package包/类
private Token scanDirective() {
    String chunk1 = data.substring(index, index + DIRECTIVE.length());
    char chunk2 = data.charAt(index + DIRECTIVE.length());
    if (DIRECTIVE.equals(chunk1) && "\n\0".indexOf(chunk2) != -1) {
        index += DIRECTIVE.length();
        List<Integer> implicit = new ArrayList<Integer>(2);
        implicit.add(new Integer(1));
        implicit.add(new Integer(1));
        return new DirectiveToken<Integer>("YAML", implicit, mark, mark);
    } else {
        throw new CanonicalException("invalid directive");
    }
}
 
开发者ID:bmoliveira,项目名称:snake-yaml,代码行数:14,代码来源:CanonicalScanner.java

示例3: scanDirective

import org.yaml.snakeyaml.tokens.DirectiveToken; //导入依赖的package包/类
@SuppressWarnings({ "unchecked", "rawtypes" })
private Token scanDirective() {
	// See the specification for details.
	Mark startMark = reader.getMark();
	Mark endMark;
	reader.forward();
	String name = scanDirectiveName(startMark);
	List<?> value = null;
	if ("YAML".equals(name)) {
		value = scanYamlDirectiveValue(startMark);
		endMark = reader.getMark();
	} else if ("TAG".equals(name)) {
		value = scanTagDirectiveValue(startMark);
		endMark = reader.getMark();
	} else {
		endMark = reader.getMark();
		int ff = 0;
		while (Constant.NULL_OR_LINEBR.hasNo(reader.peek(ff))) {
			ff++;
		}
		if (ff > 0) {
			reader.forward(ff);
		}
	}
	scanDirectiveIgnoredLine(startMark);
	return new DirectiveToken(name, value, startMark, endMark);
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:28,代码来源:ScannerImpl.java


注:本文中的org.yaml.snakeyaml.tokens.DirectiveToken类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。