本文整理汇总了Java中com.dd.plist.NSObject.toString方法的典型用法代码示例。如果您正苦于以下问题:Java NSObject.toString方法的具体用法?Java NSObject.toString怎么用?Java NSObject.toString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.dd.plist.NSObject
的用法示例。
在下文中一共展示了NSObject.toString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getValue
import com.dd.plist.NSObject; //导入方法依赖的package包/类
@Override
public String getValue(final String property) {
if(null == dictionary) {
return null;
}
final NSObject value = dictionary.objectForKey(property);
if(null == value) {
log.warn(String.format("No value for key %s in dictionary %s", property, dictionary));
return null;
}
return value.toString();
}
示例2: stringForKey
import com.dd.plist.NSObject; //导入方法依赖的package包/类
@Override
public String stringForKey(final String key) {
final NSObject value = dict.objectForKey(key);
if(null == value) {
return null;
}
return value.toString();
}
示例3: getStringValue
import com.dd.plist.NSObject; //导入方法依赖的package包/类
public static String getStringValue(File plistFile, String keyName) throws IOException {
NSDictionary baseDict = PlistUtil.getRootDictionary(plistFile);
if (baseDict.containsKey(keyName)) {
NSObject entry = baseDict.get(keyName);
return entry.toString();
} else {
return null;
}
}
示例4: string
import com.dd.plist.NSObject; //导入方法依赖的package包/类
static String string(NSDictionary dictionary, String key) throws BadDataException {
NSObject object = dictionary.get(key);
if (object == null) {
throw new BadDataException("Missing key: " + key);
}
return object.toString();
}
示例5: doExtractTargetNameToGIDAndFileNameMaps
import com.dd.plist.NSObject; //导入方法依赖的package包/类
private static void doExtractTargetNameToGIDAndFileNameMaps(
NSDictionary objects,
ImmutableMap.Builder<String, String> targetNamesToGIDs,
Optional<ImmutableMap.Builder<String, String>> targetNamesToFileNames) {
HashMap<String, String> builtProductReferenceGidsToPaths = new HashMap<>();
for (String gid : objects.allKeys()) {
NSObject object = objects.objectForKey(gid);
if (!(object instanceof NSDictionary)) {
throw new HumanReadableException("Malformed Xcode project (non-dictionary object)");
}
NSDictionary objectDict = (NSDictionary) object;
NSObject isa = objectDict.objectForKey("isa");
if (!(isa instanceof NSString)) {
throw new HumanReadableException("Malformed Xcode project (non-string isa)");
}
// No need really to cast here just to call toString().
switch (isa.toString()) {
case "PBXNativeTarget":
// Fall through.
case "PBXAggregateTarget":
{
NSObject name = objectDict.objectForKey("name");
if (!(name instanceof NSString)) {
throw new HumanReadableException("Malformed Xcode project (non-string name)");
}
targetNamesToGIDs.put(name.toString(), gid);
NSObject productReference = objectDict.objectForKey("productReference");
if (productReference != null) {
if (!(productReference instanceof NSString)) {
throw new HumanReadableException(
"Malformed Xcode project (non-string productReference)");
}
String targetFileName = builtProductReferenceGidsToPaths.get(
productReference.toString());
if (targetFileName == null) {
LOG.error(
"Target %s has no built product reference (looked for gid %s)",
name.toString(),
gid);
throw new HumanReadableException(
"Malformed Xcode project (PBXFileReference %s missing)",
productReference.toString());
}
LOG.debug(
"Mapped target %s to built product filename %s (gid %s)",
name.toString(),
targetFileName,
gid);
if (targetNamesToFileNames.isPresent()) {
targetNamesToFileNames.get().put(name.toString(), targetFileName);
}
}
break;
}
case "PBXFileReference":
NSObject sourceTree = objectDict.objectForKey("sourceTree");
if (!(sourceTree instanceof NSString)) {
throw new HumanReadableException("Malformed Xcode project (non-string sourceTree)");
}
if (sourceTree.toString().equals("BUILT_PRODUCTS_DIR")) {
NSObject path = objectDict.objectForKey("path");
if (!(path instanceof NSString)) {
throw new HumanReadableException("Malformed Xcode project (non-string path)");
}
builtProductReferenceGidsToPaths.put(gid, path.toString());
}
break;
}
}
}