/** * Constructs the form values dictionary by first calling the method <code> * encodeEnterpriseObjectsPrimaryKeyForUrl</code> and then using the results of that to construct * the dictionary. * * @param eos array of enterprise objects to be encoded in the url * @param separator to be used to separate entity names * @param encrypt flag to determine if the primary key of the objects should be encrypted. * @return dictionary containing all of the key value pairs where the keys denote the entity names * and the values denote the possibly encrypted primary keys. */ public static NSDictionary dictionaryOfFormValuesForEnterpriseObjects( NSArray eos, String separator, boolean encrypt) { String base = encodeEnterpriseObjectsPrimaryKeyForUrl(eos, separator, encrypt); NSArray elements = NSArray.componentsSeparatedByString(base, "&"); return (NSDictionary) NSPropertyListSerialization.propertyListFromString( "{" + elements.componentsJoinedByString(";") + ";}"); }
/** * Creates an NSDictionary from a resource associated with a given bundle that is in property list * format. * * @param name name of the file or resource. * @param bundle NSBundle to which the resource belongs. * @return NSDictionary de-serialized from the property list. */ @SuppressWarnings("unchecked") public static NSDictionary dictionaryFromPropertyList(String name, NSBundle bundle) { String string = ERXStringUtilities.stringFromResource(name, "plist", bundle); return (NSDictionary<?, ?>) NSPropertyListSerialization.propertyListFromString(string); }