Skip to content

Commit

Permalink
Remove irrelevant JavaDoc
Browse files Browse the repository at this point in the history
Strings are never UTF-8 encoded.
Strings are a sequence of Unicode characters.
If these Unicode characters are encoded into a sequence of bytes
or decoded from a sequence of bytes, then encodings like UTF-8 come into play.

Same for BOM, they are just not relevant when we talk about Strings,
they are only relevant if starting a stream of bytes, otherwise they are
just content.
  • Loading branch information
Vampire committed Sep 23, 2024
1 parent 321fcaa commit db885f9
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ expect class Load(
/**
* Parse a YAML document and create an instance of an object.
*
* The string must be encoded as UTF-8.
*
* @param string YAML data to load from (BOM must not be present)
* @param string YAML data to load from
* @return parsed instance
* @throws it.krzeminski.snakeyaml.engine.kmp.exceptions.YamlEngineException if the YAML is not valid
*/
Expand All @@ -40,13 +38,10 @@ expect class Load(
internal fun loadOne(source: Source): Any?

/**
* Parse all YAML documents in a String and produce corresponding objects. (Because the
* encoding in known BOM is not respected.) The documents are parsed only when the iterator is
* invoked.
*
* The string must be encoded as UTF-8.
* Parse all YAML documents in a String and produce corresponding objects.
* The documents are parsed only when the iterator is invoked.
*
* @param string YAML data to load from (BOM must not be present)
* @param string YAML data to load from
* @return an [Iterable] over the parsed objects in this stream in proper sequence
*/
fun loadAll(string: String): Iterable<Any?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ internal class LoadCommon(
/**
* Parse a YAML document and create an instance of an object.
*
* The string must be encoded as UTF-8.
*
* @param string YAML data to load from (BOM must not be present)
* @param string YAML data to load from
* @return parsed instance
* @throws it.krzeminski.snakeyaml.engine.kmp.exceptions.YamlEngineException if the YAML is not valid
*/
Expand All @@ -64,13 +62,10 @@ internal class LoadCommon(
Iterable { YamlIterator(composer, constructor) }

/**
* Parse all YAML documents in a String and produce corresponding objects. (Because the
* encoding in known BOM is not respected.) The documents are parsed only when the iterator is
* invoked.
*
* The string must be encoded as UTF-8.
* Parse all YAML documents in a String and produce corresponding objects.
* The documents are parsed only when the iterator is invoked.
*
* @param string YAML data to load from (BOM must not be present)
* @param string YAML data to load from
* @return an [Iterable] over the parsed objects in this stream in proper sequence
*/
fun loadAll(string: String): Iterable<Any?> =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ expect class Parse(
*
* See [Processing Overview](http://www.yaml.org/spec/1.2/spec.html.id2762107).
*
* @param string YAML document(s). The BOM must not be present (it will be parsed as content)
* @param string YAML document(s)
* @return parsed events
*/
fun parse(string: String): Iterable<Event>
Expand All @@ -22,7 +22,7 @@ expect class Parse(
*
* See [Processing Overview](http://www.yaml.org/spec/1.2/spec.html.id2762107).
*
* @param source YAML document(s). The BOM must not be present (it will be parsed as content)
* @param source YAML document(s)
* @return parsed events
*/
fun parse(source: Source): Iterable<Event>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ParseString(
*
* See [Processing Overview](http://www.yaml.org/spec/1.2/spec.html.id2762107).
*
* @param yaml - YAML document(s). The BOM must not be present (it will be parsed as content)
* @param yaml - YAML document(s).
* @return parsed events
*/
fun parseString(yaml: String): Iterable<Event> = parse.parse(yaml)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ actual class Load @JvmOverloads actual constructor(
/**
* Parse a YAML document and create a object instance.
*
* @param reader data to load from (BOM must not be present)
* @param reader data to load from
* @return parsed object instance
*/
fun loadOne(reader: Reader): Any? =
Expand All @@ -80,7 +80,7 @@ actual class Load @JvmOverloads actual constructor(
* Parse all YAML documents in a String and produce corresponding objects. The documents are
* parsed only when the iterator is invoked.
*
* @param reader YAML data to load from (BOM must not be present)
* @param reader YAML data to load from
* @return an [Iterable] over the parsed objects in this stream in proper sequence
*/
fun loadAll(reader: Reader): Iterable<Any?> =
Expand Down

0 comments on commit db885f9

Please sign in to comment.