当前位置: 首页>>代码示例>>Java>>正文


Java NSObject.toString方法代码示例

本文整理汇总了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();
}
 
开发者ID:iterate-ch,项目名称:cyberduck,代码行数:13,代码来源:DictionaryLicense.java

示例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();
}
 
开发者ID:iterate-ch,项目名称:cyberduck,代码行数:9,代码来源:PlistDeserializer.java

示例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;
    }
}
 
开发者ID:ctco,项目名称:gradle-mobile-plugin,代码行数:10,代码来源:PlistUtil.java

示例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();
}
 
开发者ID:horrorho,项目名称:LiquidDonkey,代码行数:8,代码来源:PropertyLists.java

示例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;
    }
  }
}
 
开发者ID:saleehk,项目名称:buck-cutom,代码行数:72,代码来源:ProjectParser.java


注:本文中的com.dd.plist.NSObject.toString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。