stringWithPropertyList static method

String stringWithPropertyList(
  1. Object obj
)

For the object graph provided, returns a property list as an xml String. Equivalent to iOS method [NSPropertyList dataWithPropertyList:format:options:error]

The obj parameter is object graph to write out as a xml property list. The object graph may only contain the following types: String, int, Float32, double, Map<String, Object>, List, DateTime, bool or ByteData.

Returns a String of the xml plist.

Throws PropertyListWriteStreamException if the object graph is incompatible.

Implementation

static String stringWithPropertyList(Object obj) {
  try {
    var p = XMLPropertyListWriter(obj);
    return p.write();
  } catch(e, s) {
    print(s);
    throw PropertyListWriteStreamException.nested(e);
  }
}