As Andrey mentions, there's no such thing as a "named" document in
YAML. However, there are a few ways to do this.
First, you could choose the documents from separate files, so the
documents are "named" by the filename. You would have NM.yaml and
local.yaml (or whatever).
Second, you could load both documents from a single file as a mapping,
then choose the one you wanted:
---
NM:
host1 : machine1
host2 : machine2
local:
host1 : localhost
host2 : localhost
...
Then the Java code, assuming each of your "documents" corresponds to a
class named "Settings":
Yaml yaml = new Yaml();
Map<String,Settings> settingsMap = (Map<String,Settings>)yaml.load
( inputStream );
Settings localSettings = settingsMap.get ( "local" );
Settings nmSettings = settingsMap.get ( "NM" );
/Jordan
P.S. YAML doesn't use '=', it uses ':'.