SnakeYAML is a YAML parser and emitter for the Java programming language.
Questions tagged [snakeyaml]
312 questions
0
votes
1 answer
SnakeYAML class not found error?
I'm writing a small java program that needs to use SnakeYAML, and it works fine when running it from within Eclipse, but when I export it, it can't seem to locate the SnakeYAML class to handle the Yaml object, like in the Yaml yaml = new Yaml();…
![](../../users/profiles/1570073.webp)
user1570073
- 11
- 3
0
votes
1 answer
SnakeYAML : doesn't seem to work
I am following tutorial mentioned - http://code.google.com/p/snakeyaml/wiki/Documentation#Tutorial
My code looks like
public class Utilities {
private static final String YAML_PATH = "/problems/src/main/resources/input.yaml";
public…
![](../../users/profiles/379235.webp)
daydreamer
- 73,989
- 165
- 410
- 667
0
votes
1 answer
How do I use snakeyaml as a function that returns something?
I am trying to make a function with snakeyaml that dumps an int, a string, and a string[]. The thing is I don't know how to write the function so that the info can be inserted.
For example:
public void testDump() {
Map data = new…
![](../../users/profiles/1058229.webp)
VinylScratch
- 113
- 9
-1
votes
1 answer
Parse a yaml with placeholder in Java
I have a yaml file which consist of placeholders to be taken from environment variable. I want to parse it to a custom class. Currently I am using snakeyaml library to parse it and its populating the bean correctly, how can I resolve environment…
![](../../users/profiles/1717405.webp)
AlphaBetaGamma
- 1,640
- 15
- 19
-1
votes
1 answer
while parsing YML to POJO getting exception Invalid UTF-8 start byte 0x80 (at char #158, byte #-1)
I am trying to parse yml file into java object while parsing yml file with object mapper getting below exception.
Exception in thread "main"
com.fasterxml.jackson.dataformat.yaml.JacksonYAMLParseException:
java.io.CharConversionException: Invalid…
![](../../users/profiles/6559285.webp)
prabjot singh
- 3
- 3
-1
votes
1 answer
yaml generation in Java
I am new to Java and I am having issue to generate a yaml. I want to generate a yaml file through java like below and I have used snake yaml for this purpose.
mart:
details:
name: Koushik
purpose: yaml generation for testing
owner:
…
![](../../users/profiles/3090114.webp)
Koushik Chandra
- 1,313
- 8
- 33
- 62
-1
votes
1 answer
Can you help me to read this YAML file?
I am new to YAML. I have tried to follow a tutorial (https://www.java-success.com/yaml-java-using-snakeyaml-library-tutorial/), but it is incomplete. So far, my YAML file looks like this:
tests:
- class: tests.layers.DeleteCustomLayerTest
param:…
![](../../users/profiles/2887713.webp)
Steve Staple
- 2,250
- 2
- 27
- 59
-1
votes
1 answer
Spring @ConfigurationProperties doesn't inject anything, field stays null
I am trying to inject values to fields like this:
@Component
@ConfigurationProperties("paypal")
public class Paypal
{
private List
- >> deleterequest;
public List
- >> getDeleterequest()
{
return…
![](../../users/profiles/5117236.webp)
Impulse The Fox
- 2,320
- 1
- 23
- 48
-1
votes
1 answer
YAML Read casts exception
I have an error while reading a file
Exception in thread "main" java.lang.ClassCastException: java.lang.String can not be cast to java.util.ArrayList.
Why does it not occur? I'm using YamlSnake lib
Person.java:
public class Person
{
int id;
…
![](../../users/profiles/6720368.webp)
Vlad Honya
- 143
- 2
- 12
-1
votes
1 answer
Get Array from YAML
I develope a Minecraft Bukkit Plugin and I want to save informations in a configuration file. I want to save an array in my yaml configuration file and load the data. This is my yaml file:
# Locations
Locations:
- name: "Survival"
position: 5
…
![](../../users/profiles/5003229.webp)
Can Spielt
- 27
- 7
-1
votes
1 answer
Is it possible to obtain an yaml property at runtime?
yaml is very convenient because you are getting a nice deserialization from yaml to java but in my case I need to be able to obtain the property value at runtime. Is there a way to accomplish this as if you were using .properties file instead, for…
![](../../users/profiles/1238044.webp)
Todor Kolev
- 1,192
- 1
- 10
- 25
-2
votes
1 answer
How to parse YAML with SnakeYaml low-level API like getAsInt?
The SnakeYaml docs provide examples how to de-serialize YAML into Java Class.
I'm looking for simple low-level API that's similar to GSON getAsInt, does SnakeYaml support that?
![](../../users/profiles/231624.webp)
Alex Craft
- 9,706
- 6
- 45
- 79