Questions tagged [yamlbeans]
9 questions
4
votes
1 answer
Tabs cannot be used for indentation when parsing YAML string
I have a byte[] that represents a UTF-8-encoded YAML string and I want to deserialize it. Here's the generic method I'm using:
public static T getInstanceFromBinary(final Class clazz, final byte[] binary, final String encoding)
throws…

m0skit0
- 25,268
- 11
- 79
- 127
2
votes
1 answer
Getting Yaml string without class tags
Is there a method to hide all tags from the output of the YamlWriter using the yamlbeans lib?
public String toYaml(T object) {
try (StringWriter stringWriter = new StringWriter()) {
YamlWriter writer = new YamlWriter(stringWriter);
…

Tirla Alin
- 21
- 1
1
vote
1 answer
yamlbeans: why is a scalar for String type expected?
Introduction
I'm attempting to deserialize the contents of a YAML document into a Java object using yamlbeans (v1.0).
Here's the YAML document which I'm trying to deserialize (topologyGrammar.yml):
---
rules:
- !tp.aoi.topology.TopologyRule {…

karobar
- 1,250
- 8
- 30
- 61
0
votes
1 answer
YamlBeans: Turning an object into a hashmap
I have a Yaml file that's something like below:
rules:
- p_table:
["p_event/Name",
"p_fault/Name"]
- s_table:
["s_event/Name",
"s_fault/Name"]
- r_table:
["r_event/Name",
…

veila
- 83
- 8
0
votes
0 answers
YAMLBeans - Expected data for a field but found: scalar
I am working on a simple project where I need to write person data into a yaml file . I am using yamlbeans to serialize and de-serialize the data. I specifically want all the java bean properties to be String. Here's how my bean properties looks…

wicke_s
- 33
- 5
0
votes
0 answers
!java.util.LinkedHashMap appearing in file while using YAML Beans Writer
I am reading a yaml file and I am writing it simply to a path (e.g. I am reading a test.yml file and writing it to tester.yml). I can now read and write the file but the actual problem is that I am getting "!java.util.LinkedHashMap" in my out put…

G.S.Shriram
- 91
- 1
- 8
0
votes
3 answers
iterate, find and update value in nested Map
I have a YML file, which I parse to Map using yamlBeans library.
I don't know how deep the nested map goes.
for example:
key1:
key2: value1
key3:
key4: value2
key5: value3
I need to find a specific value in this map, update it,…

barsi
- 3
- 1
- 5
0
votes
1 answer
Drools not matching nested object obtained from deserialization
I'm trying to create a rule in Drools that would trigger based on a hypothetical student getting straight As.
import Student
import Semester
import java.util.*
dialect "mvel"
rule "straight As1"
when
$s : Student(
grades !=…
user6548046
0
votes
1 answer
yamlbeans configuration to set privateFields
I need to configure how yamlbeans processes classes.
I want to set privateFields to true to non-transient fields will be used.
What do I need for this? Which file should I create and what to place in it?
I use Java and audit4j and I want to specify…

Alex Po
- 1,837
- 1
- 24
- 28