SnakeYAML: Is it possible to get the anchor name of an object?
<p>When I load the following document with <a href="https://bitbucket.org/asomov/snakeyaml" rel="nofollow">SnakeYAML</a>:</p>

<pre><code>unit:
  &amp;kg
  name: Kilogram
</code></pre>

<p>it returns a map with the following content:</p>

<pre><code>{unit={name=Kilogram}}
</code></pre>

<p>The referencing with anchors works great in SnakeYAML but is it also possible to get the anchor names from the document?</p>

<p>Code snippet:</p>

<pre><code>String text = "unit:\n  &amp;kg\n  name: Kilogram\n";
System.out.println(new Yaml().load(text));  // -&gt; {unit={name=Kilogram}}
</code></pre>