org.yaml.snakeyaml.error.MarkedYAMLException Java Examples

The following examples show how to use org.yaml.snakeyaml.error.MarkedYAMLException. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ManifestParser.java    From orion.server with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public ManifestParseTree parse(InputStream inputStream) throws ParserException {
	Node snakeRootNode;
	try {
		snakeRootNode = new Yaml().compose(new InputStreamReader(inputStream));
	} catch (MarkedYAMLException e) {
		throw new ParserException(e.getMessage(), e.getProblemMark().getLine() + 1);
	}
	ManifestParseTree root = new ManifestParseTree();
	addChild(snakeRootNode, root);
	return root;
}
 
Example #2
Source File: SwaggerError.java    From KaiZen-OpenAPI-Editor with Eclipse Public License 1.0 4 votes vote down vote up
public static SwaggerError newYamlError(YAMLException exception) {
    int line = (exception instanceof MarkedYAMLException)
            ? ((MarkedYAMLException) exception).getProblemMark().getLine() + 1
            : 1;
    return new SwaggerError(line, IMarker.SEVERITY_ERROR, 0, processor.rewriteMessage(exception));
}