public abstract class NSObject extends Object
Constructor and Description |
---|
NSObject() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
toASCII(StringBuilder ascii,
int level)
Generates the ASCII representation of this object.
|
protected abstract void |
toASCIIGnuStep(StringBuilder ascii,
int level)
Generates the ASCII representation of this object in the GnuStep format.
|
Object |
toJavaObject()
Converts this NSObject into an equivalent object
of the Java Runtime Environment.
|
String |
toXMLPropertyList()
Generates a valid XML property list including headers using this object as root.
|
static NSNumber |
wrap(boolean value)
Wraps the given value inside a NSObject.
|
static NSData |
wrap(byte[] value)
Wraps the given value inside a NSObject.
|
static NSNumber |
wrap(double value)
Wraps the given value inside a NSObject.
|
static NSNumber |
wrap(long value)
Wraps the given value inside a NSObject.
|
static NSDictionary |
wrap(Map<String,Object> value)
Creates a NSDictionary with the contents of the given map.
|
static NSObject |
wrap(Object o)
Creates a NSObject representing the given Java Object.
|
static NSArray |
wrap(Object[] value)
Creates a NSArray with the contents of the given array.
|
static NSSet |
wrap(Set<Object> value)
Creates a NSSet with the contents of this set.
|
static NSData |
wrapSerialized(Object o)
Serializes the given object using Java's default object serialization
and wraps the serialized object in a NSData object.
|
public String toXMLPropertyList()
protected abstract void toASCII(StringBuilder ascii, int level)
ascii
- The StringBuilder onto which the ASCII representation is appended.level
- The indentation level of the object.protected abstract void toASCIIGnuStep(StringBuilder ascii, int level)
ascii
- The StringBuilder onto which the ASCII representation is appended.level
- The indentation level of the object.public static NSNumber wrap(long value)
value
- The value to represent as a NSObject.public static NSNumber wrap(double value)
value
- The value to represent as a NSObject.public static NSNumber wrap(boolean value)
value
- The value to represent as a NSObject.public static NSData wrap(byte[] value)
value
- The value to represent as a NSObject.public static NSArray wrap(Object[] value)
value
- The value to represent as a NSObject.RuntimeException
- When one of the objects contained in the array cannot be represented by a NSObject.public static NSDictionary wrap(Map<String,Object> value)
value
- The value to represent as a NSObject.RuntimeException
- When one of the values contained in the map cannot be represented by a NSObject.public static NSSet wrap(Set<Object> value)
value
- The value to represent as a NSObject.RuntimeException
- When one of the values contained in the set cannot be represented by a NSObject.public static NSObject wrap(Object o)
o
- The object to represent.public static NSData wrapSerialized(Object o)
o
- The object to serialize and wrap.RuntimeException
- When the object could not be serialized.public Object toJavaObject()
Copyright © 2014. All Rights Reserved.