META_DATA_VALUE_FACTORY.createStructureValue();
Map subMap = subStructure.getFieldValuesAsMutableMap();
MutableStringValue aString = mdvFactory.createStringValue();
aString.setValue("a-string");
subMap.put("keyA", aString);
MutableNumberValue eleven = mdvFactory.createNumberValue();
eleven.setValue(new Integer(11));
subMap.put("keyB", eleven);
topMap.put("key1", subStructure.createImmutable());
// create the
// key2[0]/true
// [1]/false
//
// part
MutableListValue metaList = META_DATA_VALUE_FACTORY.createListValue();
List list = metaList.getContentsAsMutableList();
MutableBooleanValue trueBool =
META_DATA_VALUE_FACTORY.createBooleanValue();
trueBool.setValue(Boolean.TRUE);
list.add(trueBool);
MutableBooleanValue falseBool =
META_DATA_VALUE_FACTORY.createBooleanValue();
falseBool.setValue(Boolean.FALSE);
list.add(falseBool);
topMap.put("key2", metaList.createImmutable());
// create the
// key3/set[0]/keyX/b-string
// /keyY/c-string
// /set[1]/true
// /set[2]/x-string
MutableSetValue metaSet = META_DATA_VALUE_FACTORY.createSetValue();
Set set = metaSet.getContentsAsMutableSet();
MutableStructureValue setsStruct =
META_DATA_VALUE_FACTORY.createStructureValue();
Map setsStructMap = setsStruct.getFieldValuesAsMutableMap();
MutableStringValue bString = mdvFactory.createStringValue();
bString.setValue("b-string");
setsStructMap.put("keyX", bString);
MutableStringValue cString = mdvFactory.createStringValue();
cString.setValue("c-string");
setsStructMap.put("keyY", cString);
set.add(setsStruct.createImmutable());
MutableBooleanValue tBool =
META_DATA_VALUE_FACTORY.createBooleanValue();
tBool.setValue(Boolean.TRUE);
set.add(tBool);
MutableStringValue xString = mdvFactory.createStringValue();
xString.setValue("x-string");
set.add(xString);
topMap.put("key3", metaSet.createImmutable());
// create the
//
// key4/z-string
//
// part
MutableStringValue zString = mdvFactory.createStringValue();
zString.setValue("z-string");
topMap.put("key4", zString);
return (ImmutableStructureValue) structure.createImmutable();
}