PATH |
NSPropertyListSerialization
- Inherits from:
- Object
- Package:
- com.webobjects.foundation
Class Description
This class provides static methods that convert between property lists and their string representations, which can be either strings or NSData objects. A property list is a structure that represents organized data. It can be built from a combination of NSArrays, NSDictionaries, Strings, and NSData objects.
The string representation can be in XML or the ASCII plist format. To distinguish between the two formats, the parser that converts strings to property lists checks if the string starts with <?xml
. A discussion of the ASCII plist format, A Primer on ASCII Property Lists, is available in the Mac OS X section of the Apple Developer Connection website. A discussion of XML property lists, Property List Services, is also available in the same area of the Apple Developer Connection website.
Some methods do not support XML property list representations, specifically booleanForString and intForString.
The NSPropertyListSerialization class cannot be instantiated.
Method Types
- Extracting typed data
- arrayForString
- booleanForString
- dictionaryForString
- intForString
- Converting to property lists
- propertyListFromData
- propertyListFromString
- Converting from property lists
- dataFromPropertyList
- stringFromPropertyList
Static Methods
arrayForString
public static NSArray arrayForString(String string)
See Also: dictionaryForString.
booleanForString
public static boolean booleanForString(String string)
string's value | Value returned |
"YES " |
true |
"true " |
true |
Any other value | false |
The tests for "YES
" and "true
" are case insensitive.
dataFromPropertyList
public static NSData dataFromPropertyList( Object object, String encoding)
public static NSData dataFromPropertyList(Object object)
See Also: stringFromPropertyList
dictionaryForString
public static NSDictionary dictionaryForString(String string)
See Also: arrayForString.
intForString
public static int intForString(String string)
null
, returns zero.
propertyListFromData
public static Object propertyListFromData( NSData data, String encoding)
public static Object propertyListFromData(NSData data)
See Also: propertyListFromString
propertyListFromString
public static Object propertyListFromString(String string)
stringFromPropertyList
public static String stringFromPropertyList(Object object)
© 2001 Apple Computer, Inc. (Last Published April 17, 2001)