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


Java Parser类代码示例

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


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

示例1: parse

import org.yaml.snakeyaml.parser.Parser; //导入依赖的package包/类
/**
 * Parse a YAML stream and produce parsing events.
 * 
 * @see <a href="http://yaml.org/spec/1.1/#id859333">Processing Overview</a>
 * @param yaml
 *            YAML document(s)
 * @return parsed events
 */
public Iterable<Event> parse(Reader yaml) {
    final Parser parser = new ParserImpl(new StreamReader(yaml));
    Iterator<Event> result = new Iterator<Event>() {
        public boolean hasNext() {
            return parser.peekEvent() != null;
        }

        public Event next() {
            return parser.getEvent();
        }

        public void remove() {
            throw new UnsupportedOperationException();
        }
    };
    return new EventIterable(result);
}
 
开发者ID:imkiva,项目名称:AndroidApktool,代码行数:26,代码来源:Yaml.java

示例2: parse

import org.yaml.snakeyaml.parser.Parser; //导入依赖的package包/类
/**
 * Parse a YAML stream and produce parsing events.
 *
 * @see <a href="http://yaml.org/spec/1.1/#id859333">Processing Overview</a>
 * @param yaml
 *            YAML document(s)
 * @return parsed events
 */
public Iterable<Event> parse(Reader yaml) {
    final Parser parser = new ParserImpl(new StreamReader(yaml));
    Iterator<Event> result = new Iterator<Event>() {
        public boolean hasNext() {
            return parser.peekEvent() != null;
        }

        public Event next() {
            return parser.getEvent();
        }

        public void remove() {
            throw new UnsupportedOperationException();
        }
    };
    return new EventIterable(result);
}
 
开发者ID:RoccoDev,项目名称:5zig-TIMV-Plugin,代码行数:26,代码来源:Yaml.java

示例3: parse

import org.yaml.snakeyaml.parser.Parser; //导入依赖的package包/类
protected List<Event> parse(InputStream input) throws IOException {
    StreamReader reader = new StreamReader(new UnicodeReader(input));
    Parser parser = new ParserImpl(reader);
    List<Event> result = new ArrayList<Event>();
    while (parser.peekEvent() != null) {
        result.add(parser.getEvent());
    }
    input.close();
    return result;
}
 
开发者ID:cuizhennan,项目名称:snakeyaml,代码行数:11,代码来源:PyImportTest.java

示例4: parse

import org.yaml.snakeyaml.parser.Parser; //导入依赖的package包/类
/**
 * Parse a YAML stream and produce parsing events.
 * 
 * @see <a href="http://yaml.org/spec/1.1/#id859333">Processing Overview</a>
 * @param yaml
 *            YAML document(s)
 * @return parsed events
 */
public Iterable<Event> parse(final Reader yaml) {
	final Parser parser = new ParserImpl(new StreamReader(yaml));
	Iterator<Event> result = new Iterator<Event>() {
		@Override
		public boolean hasNext() {
			return parser.peekEvent() != null;
		}

		@Override
		public Event next() {
			return parser.getEvent();
		}

		@Override
		public void remove() {
			throw new UnsupportedOperationException();
		}
	};
	return new EventIterable(result);
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:29,代码来源:Yaml.java

示例5: construct

import org.yaml.snakeyaml.parser.Parser; //导入依赖的package包/类
private Object construct(Constructor constructor, String data) {
    StreamReader reader = new StreamReader(data);
    Parser parser = new ParserImpl(reader);
    Resolver resolver = new Resolver();
    Composer composer = new Composer(parser, resolver);
    constructor.setComposer(composer);
    return constructor.getSingleData(Object.class);
}
 
开发者ID:bmoliveira,项目名称:snake-yaml,代码行数:9,代码来源:ConstructorMappingTest.java

示例6: construct

import org.yaml.snakeyaml.parser.Parser; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private List<Object> construct(Constructor constructor, String data) {
    StreamReader reader = new StreamReader(data);
    Parser parser = new ParserImpl(reader);
    Resolver resolver = new Resolver();
    Composer composer = new Composer(parser, resolver);
    constructor.setComposer(composer);
    List<Object> result = (List<Object>) constructor.getSingleData(Object.class);
    return result;
}
 
开发者ID:bmoliveira,项目名称:snake-yaml,代码行数:11,代码来源:ConstructorSequenceTest.java

示例7: Composer

import org.yaml.snakeyaml.parser.Parser; //导入依赖的package包/类
public Composer(Parser parser, Resolver resolver) {
    this.parser = parser;
    this.resolver = resolver;
    this.anchors = new HashMap<String, Node>();
    this.recursiveNodes = new HashSet<Node>();
}
 
开发者ID:imkiva,项目名称:AndroidApktool,代码行数:7,代码来源:Composer.java

示例8: YamlParserEventIterator

import org.yaml.snakeyaml.parser.Parser; //导入依赖的package包/类
YamlParserEventIterator(Parser parser)
{
    this.parser = parser;
}
 
开发者ID:GotoFinal,项目名称:diorite-configs-java8,代码行数:5,代码来源:YamlParserEventIterator.java

示例9: FragmentComposer

import org.yaml.snakeyaml.parser.Parser; //导入依赖的package包/类
public FragmentComposer(Parser parser, Resolver resolver, String nodeName) {
    super(parser, resolver);
    this.nodeName = nodeName;
}
 
开发者ID:bmoliveira,项目名称:snake-yaml,代码行数:5,代码来源:FragmentComposer.java

示例10: Composer

import org.yaml.snakeyaml.parser.Parser; //导入依赖的package包/类
public Composer(final Parser parser, final Resolver resolver) {
	this.parser = parser;
	this.resolver = resolver;
	this.anchors = new HashMap<String, Node>();
	this.recursiveNodes = new HashSet<Node>();
}
 
开发者ID:OpenNTF,项目名称:org.openntf.domino,代码行数:7,代码来源:Composer.java

示例11: parse

import org.yaml.snakeyaml.parser.Parser; //导入依赖的package包/类
/**
 * Parse a YAML stream and produce parsing events.
 *
 * @param yaml
 *         YAML document(s)
 *
 * @return parsed events
 *
 * @see <a href="http://yaml.org/spec/1.1/#id859333">Processing Overview</a>
 */
public Iterable<Event> parse(Reader yaml)
{
    Parser parser = new ParserImpl(new StreamReader(yaml));
    Iterator<Event> result = new YamlParserEventIterator(parser);
    return new YamlEventIterable(result);
}
 
开发者ID:GotoFinal,项目名称:diorite-configs-java8,代码行数:17,代码来源:Yaml.java


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