Package com.webobjects.foundation

Examples of com.webobjects.foundation.NSMutableDictionary.objectForKey()


    protected NSMutableDictionary encodeDictionaryWithEOs(NSDictionary dictionary) {
      NSMutableDictionary theMutableDictionary = (NSMutableDictionary) ((dictionary instanceof NSMutableDictionary) ? dictionary : dictionary.mutableClone());

      for (Enumeration anEnum = theMutableDictionary.keyEnumerator(); anEnum.hasMoreElements();) {
        String key = (String) anEnum.nextElement();
        Object value = theMutableDictionary.objectForKey(key);

        if (value instanceof EOEnterpriseObject && !ERXEOControlUtilities.isNewObject((EOEnterpriseObject)value)) {
                    EOEnterpriseObject eo = (EOEnterpriseObject)value;
                    NSMutableDictionary encodedDict = encodeEO(eo);
          theMutableDictionary.setObjectForKey(encodedDict, key);
View Full Code Here


                return  (eo != null) ? eo : dictionary;
      }

      for (Enumeration anEnum = theMutableDictionary.keyEnumerator(); anEnum.hasMoreElements();) {
        String key = (String) anEnum.nextElement();
        Object value = theMutableDictionary.objectForKey(key);

        if (value instanceof NSDictionary) {
          theMutableDictionary.setObjectForKey(decodeDictionaryWithEOs((NSDictionary) value), key);
        }
      }
View Full Code Here

    aLog.append(new StringBuilder().append(indentString).append("<EOAttribute ").append(name()).append('\n').toString());
    String aKey = "";
    try {
      NSMutableDictionary aDictionary = new NSMutableDictionary();
      encodeIntoPropertyList(aDictionary);
      for (Enumeration enumerator = aDictionary.keyEnumerator(); enumerator.hasMoreElements(); aLog.append(new StringBuilder().append(indentString).append('\t').append(aKey).append(" : '").append(aDictionary.objectForKey(aKey)).append("'\n").toString()))
        aKey = (String) enumerator.nextElement();

    }
    catch (Exception exception) {
      aLog.append(new StringBuilder().append(indentString).append('\t').append(getClass().getName()).append(".toString: characteristics ").append(aKey).append(" exception ").append(exception).append('\n').toString());
View Full Code Here

            model = Services.dictionaryFromFile(file);
            NSArray rules = (NSArray)model.objectForKey("rules");
            Enumeration e = rules.objectEnumerator();
            while(e.hasMoreElements()) {
                NSMutableDictionary dict = (NSMutableDictionary)e.nextElement();
                if("com.webobjects.directtoweb.Rule".equals(dict.objectForKey("class"))) {
                    dict.setObjectForKey("ERD2WExtendedRule", "class");
                }
            }
        } catch (Throwable throwable) {
            NSLog.err.appendln("****** DirectToWeb: Problem reading file "
View Full Code Here

        for (Enumeration enumerator = relationships.objectEnumerator(); enumerator.hasMoreElements();) {
            EORelationship relationship = (EORelationship) enumerator.nextElement();
            NSMutableDictionary pk = EOUtilities.destinationKeyForSourceObject(ec, eo, relationship.name()).mutableClone();
            for (int i=0; i<keys.count(); i++) {
                String key = (String)keys.objectAtIndex(i);
                if(pk.objectForKey(key) != null) {
                    Object val = changedValues.objectForKey(key);
                    pk.setObjectForKey(val, key);
                }
            }
            EOEntity destEnt = relationship.destinationEntity();
View Full Code Here

        dict = selectedRule.parameters();
        String k,v;
        KeyValue temp;
        for(int i = 0; i<dict.allKeys().count();i++){
            k = (String)dict.allKeys().objectAtIndex(i);
            v = (String)dict.objectForKey(k);
            temp  = new KeyValue(k,v);
            keyValueParameters.addObject(temp);
        }
    }
   
View Full Code Here

            Object eo = e.nextElement();
            Object key = NSKeyValueCodingAdditions.Utility.valueForKeyPath(eo,keyPath);
            boolean isNullKey = key==null || key instanceof NSKeyValueCoding.Null;
            if (!isNullKey || nullGroupingKey != null) {
                if (isNullKey) key=nullGroupingKey;
                NSMutableArray existingGroup=(NSMutableArray)result.objectForKey(key);
                if (existingGroup==null) {
                    existingGroup=new NSMutableArray();
                    result.setObjectForKey(existingGroup,key);
                }
                if (valueKeyPath!=null) {
View Full Code Here

            if (!isNullKey || nullGroupingKey != null) {
                if (isNullKey) key=nullGroupingKey;
                NSArray array = (NSArray)key;
                for(@SuppressWarnings("null") Enumeration keys = array.objectEnumerator(); keys.hasMoreElements(); ) {
                    key = keys.nextElement();
                    NSMutableArray existingGroup=(NSMutableArray)result.objectForKey(key);
                    if (existingGroup==null) {
                        existingGroup=new NSMutableArray();
                        result.setObjectForKey(existingGroup,key);
                    }
                    if (valueKeyPath!=null) {
View Full Code Here

            } else {
                NSMutableDictionary dict = new NSMutableDictionary();
                NSArray<ERXStats.LogEntry> entries = ERXStats.aggregateLogEntries();
                for (ERXStats.LogEntry logEntry : entries) {
                    String group = ERXStringUtilities.firstPropertyKeyInKeyPath(logEntry.key());
                    NSMutableArray eventsForType = (NSMutableArray)dict.objectForKey(group);
                    if (null == eventsForType) {
                        eventsForType = new NSMutableArray();
                        dict.setObjectForKey(eventsForType, group);
                    }
                    eventsForType.addObject(logEntry);
View Full Code Here

    protected void setNavigationItems(NSArray items) {
        NSMutableDictionary itemsByName = new NSMutableDictionary();
        if (items != null && items.count() > 0) {
            for (Enumeration e = items.objectEnumerator(); e.hasMoreElements();) {
                ERXNavigationItem item = (ERXNavigationItem)e.nextElement();
                if (itemsByName.objectForKey(item.name()) != null) {
                    log.warn("Attempting to register multiple navigation items for the same name: " + item.name());
                } else {
                    itemsByName.setObjectForKey(item, item.name());
                    if (item.name().equals("Root"))
                        rootNavigationItem = item;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.