|
WebObjects 5.4.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.webobjects.foundation.NSPropertyListSerialization
public class NSPropertyListSerialization
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 NSArray, NSDictionary, String, 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 finds out whether 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.
booleanForString
and intForString
.
The NSPropertyListSerialization class cannot be instantiated.
NSPropertyListSerialization.booleanForString(java.lang.String)
,
NSPropertyListSerialization.intForString(java.lang.String)
Field Summary | |
---|---|
static boolean |
ForceXML
Convenience for methods to convert to xml plist. |
static boolean |
Indents
Convenience for methods to convert to plist. |
static boolean |
NoIndents
Convenience for methods to convert to plist. |
Method Summary | |
---|---|
static NSArray |
arrayForString(String value)
Parses the property list representation string and returns the resulting property list as an NSArray. |
static NSArray |
arrayForString(String value,
boolean forceXML)
Parses the property list representation string and returns the resulting property list as an NSArray. |
static NSArray |
arrayWithPathURL(URL url)
Converts a java.net.URL into a property list and returns the resulting property list as an NSArray. |
static NSArray |
arrayWithPathURL(URL url,
boolean forceXML)
Converts a java.net.URL into a property list and returns the resulting property list as an NSArray. |
static boolean |
booleanForString(String value)
Parses a given string for boolean value according to the table below. |
static NSData |
dataFromPropertyList(Object plist)
Deprecated. Use dataFromPropertyList(Object object, String encoding) instead. |
static NSData |
dataFromPropertyList(Object plist,
String encoding)
Converts the property list object into a string using a character encoding and returns it as an NSData object. |
static NSDictionary |
dictionaryForString(String value)
Parses the property list representation string and returns the resulting property list as an NSDictionary. |
static NSDictionary |
dictionaryForString(String value,
boolean forceXML)
Parses the property list representation string and returns the resulting property list as an NSDictionary. |
static NSDictionary |
dictionaryWithPathURL(URL url)
Converts a java.net.URL into a property list and returns the resulting property list as an NSDictionary. |
static NSDictionary |
dictionaryWithPathURL(URL url,
boolean forceXML)
Converts a java.net.URL into a property list and returns the resulting property list as an NSDictionary. |
static int |
intForString(String value)
Parses a given string and returns the corresponding integer value. |
static Object |
propertyListFromData(NSData data)
Deprecated. Use propertyListFromData(NSData data, String encoding) |
static Object |
propertyListFromData(NSData data,
String encoding)
Converts an NSData into a property list using a character encoding and returns it. |
static Object |
propertyListFromString(String string)
Converts a string into a property list and returns it. |
static Object |
propertyListFromString(String string,
boolean forceXML)
Converts a string into a property list and returns it. |
static Object |
propertyListWithPathURL(URL url)
Converts a java.net.URL into a property list and returns it. |
static Object |
propertyListWithPathURL(URL url,
boolean forceXML)
Converts a java.net.URL into a property list and returns it. |
static String |
stringFromPropertyList(Object plist)
Converts a property list object into a string (old style plist) and returns it. |
static String |
stringFromPropertyList(Object plist,
boolean indents)
Converts a property list object into a string (old style plist) and returns it. |
static String |
xmlStringFromPropertyList(Object plist)
Converts a property list object into an XML string and returns it. |
static String |
xmlStringFromPropertyList(Object plist,
boolean indents)
Converts a property list object into an XML string and returns it. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final boolean Indents
public static final boolean NoIndents
public static final boolean ForceXML
Method Detail |
---|
public static String stringFromPropertyList(Object plist)
plist
- the property list to convert
plist
as a stringNSPropertyListSerialization.propertyListFromString(java.lang.String)
public static String stringFromPropertyList(Object plist, boolean indents)
plist
- the property list to convertindents
- if true the resulting plist is indented (tabs and CR) if false no tabs anc CR are inserted in the result
plist
as a stringNSPropertyListSerialization.propertyListFromString(java.lang.String)
public static String xmlStringFromPropertyList(Object plist)
plist
- the property list to convert
plist
as a stringNSPropertyListSerialization.propertyListFromString(java.lang.String)
public static String xmlStringFromPropertyList(Object plist, boolean indents)
plist
- the property list to convertindents
- if true the resulting plist is indented (tabs and CR) if false no tabs anc CR are inserted in the result
plist
as a stringNSPropertyListSerialization.propertyListFromString(java.lang.String)
public static Object propertyListFromString(String string)
string
- the string to convert to a property list
string
as a property listNSPropertyListSerialization.stringFromPropertyList(java.lang.Object)
public static Object propertyListFromString(String string, boolean forceXML)
string
- the string to convert to a property listforceXML
- force xml decoding
string
as a property listNSPropertyListSerialization.stringFromPropertyList(java.lang.Object)
public static Object propertyListWithPathURL(URL url)
url
- the java.net.URL to convert to a property list
url
as a property listNSPropertyListSerialization.stringFromPropertyList(java.lang.Object)
public static Object propertyListWithPathURL(URL url, boolean forceXML)
url
- the java.net.URL to convert to a property listforceXML
- force xml decoding
url
as a property listNSPropertyListSerialization.stringFromPropertyList(java.lang.Object)
@Deprecated public static NSData dataFromPropertyList(Object plist)
object
into a string and returns it as an NSData object. This method uses the platform's default character encoding to convert the result string to byte.
plist
- property list object
object
converted to an NSDataNSPropertyListSerialization.propertyListFromData(NSData, java.lang.String)
public static NSData dataFromPropertyList(Object plist, String encoding)
object
into a string using a character encoding and returns it as an NSData object.
plist
- the property list object to convertencoding
- encoding used to convert the characters in the result string to byte
object
converted to an NSDataNSPropertyListSerialization.propertyListFromData(NSData, java.lang.String)
@Deprecated public static Object propertyListFromData(NSData data)
This method uses the platform's default character encoding to convert the bytes in data
byte array to characters in a string representation.
data
- the byte array to be converted to a property list
data
as a property listNSPropertyListSerialization.dataFromPropertyList(Object, java.lang.String)
public static Object propertyListFromData(NSData data, String encoding)
data
- the byte array to be converted to a property listencoding
- encoding to use to convert the bytes in the data byte array to characters in a string representation
data
as a property listNSPropertyListSerialization.dataFromPropertyList(Object, java.lang.String)
public static boolean booleanForString(String value)
String | Result | |
---|---|---|
"YES" |
true |
|
"true" |
true |
|
any other value | false |
The tests for "YES" and "true" are case insensitive.
value
- the string to be parsed for boolean value
public static int intForString(String value)
value
- the string to be parsed for integer value
string
; 0
if it is null
public static NSArray arrayWithPathURL(URL url)
url
- the java.net.URL to convert to a property list
NSPropertyListSerialization.stringFromPropertyList(java.lang.Object)
public static NSArray arrayWithPathURL(URL url, boolean forceXML)
url
- the java.net.URL to convert to a property listforceXML
- force xml decoding
NSPropertyListSerialization.stringFromPropertyList(java.lang.Object)
public static NSArray arrayForString(String value)
string
and returns the resulting property list as an NSArray.
value
- input property list representation string
NSPropertyListSerialization.dictionaryForString(String)
public static NSArray arrayForString(String value, boolean forceXML)
string
and returns the resulting property list as an NSArray.
value
- input property list representation stringforceXML
- force xml decoding
NSPropertyListSerialization.dictionaryForString(String)
public static NSDictionary dictionaryWithPathURL(URL url)
url
- the java.net.URL to convert to a property list
string
as an NSDictionaryNSPropertyListSerialization.stringFromPropertyList(java.lang.Object)
public static NSDictionary dictionaryWithPathURL(URL url, boolean forceXML)
url
- the java.net.URL to convert to a property listforceXML
- force xml decoding
string
as an NSDictionaryNSPropertyListSerialization.stringFromPropertyList(java.lang.Object)
public static NSDictionary dictionaryForString(String value)
string
and returns the resulting property list as an NSDictionary.
value
- property list representated as a string
string
as an NSDictionaryNSPropertyListSerialization.arrayForString(String)
public static NSDictionary dictionaryForString(String value, boolean forceXML)
string
and returns the resulting property list as an NSDictionary.
value
- property list representated as a stringforceXML
- force xml decoding
string
as an NSDictionaryNSPropertyListSerialization.arrayForString(String)
|
Last updated June 2008 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |