Package com.webobjects.foundation

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


                NSMutableArray keyChoices = new NSMutableArray();
                if(choices instanceof NSArray) {
                    for(Enumeration e = ((NSArray)choices).objectEnumerator(); e.hasMoreElements(); ) {
                        NSDictionary dict = (NSDictionary)e.nextElement();
                        String key = (String)dict.allKeys().lastObject();
                        String value = (String)dict.objectForKey(key);
                        keyChoices.addObject(new ERXKeyValuePair(key, ERXLocalizer.currentLocalizer().localizedStringForKeyWithDefault(value)));
                    }
                } else if(choices instanceof NSDictionary) {
                    NSArray keys = ((NSDictionary)choices).allKeys();
                    keys = ERXArrayUtilities.sortedArraySortedWithKey(keys, "toString");
View Full Code Here


   
                        // 2. write keys and values
                        for (Enumeration keyEnum = dict.keyEnumerator(); keyEnum.hasMoreElements(); ) {
                            Object aKey = keyEnum.nextElement();
                            dictionary.addKeyRef(encodeObject(aKey, objectList, uniquingTable));
                            dictionary.addValueRef(encodeObject(dict.objectForKey(aKey), objectList, uniquingTable));
                        }
            }
          break;
        }
        case ARRAY: {
View Full Code Here

   
    String _mappedKey;
    public String mappedKey() {
        if (_mappedKey==null) {
            NSDictionary mapping=(NSDictionary)d2wContext().valueForKey("keyMappingsForComparisonObject");
            _mappedKey = (String) (mapping!=null ? mapping.objectForKey(propertyKey()) : null);
        }
        return _mappedKey;
    }

    public boolean renderMe() {
View Full Code Here

        if (mk==null && propertyKey()!=null && propertyKey().indexOf(".")!=-1) {
            // if the key is not mentioned we render it EXCEPT if it is a key path
            // and the first atom of that kp is not rendering (in which case the keypath we know will fail
            NSArray components=NSArray.componentsSeparatedByString(propertyKey(),".");
            NSDictionary mapping=(NSDictionary)d2wContext().valueForKey("keyMappingsForComparisonObject");
            String mappingForFirstAtom=(String)mapping.objectForKey(components.objectAtIndex(0));
            if (mappingForFirstAtom!=null && mappingForFirstAtom.length()==0) mk="";
        }
        return (mk==null || mk.length()>0) && propertyKey()!=null;
    }
   
View Full Code Here

      NSDictionary dict = ((EOGeneralAdaptorException) e).userInfo();
      if (dict != null) {
        Object value;
        // this one is a little bit heavyweight...
        // value = NSPropertyListSerialization.stringFromPropertyList(dict);
        value = dict.objectForKey(EODatabaseContext.FailedDatabaseOperationKey);
        if (value != null) {
          extraInfo.setObjectForKey(value.toString(), EODatabaseContext.FailedDatabaseOperationKey);
        }
        value = dict.objectForKey(EOAdaptorChannel.AdaptorFailureKey);
        if (value != null) {
View Full Code Here

        // value = NSPropertyListSerialization.stringFromPropertyList(dict);
        value = dict.objectForKey(EODatabaseContext.FailedDatabaseOperationKey);
        if (value != null) {
          extraInfo.setObjectForKey(value.toString(), EODatabaseContext.FailedDatabaseOperationKey);
        }
        value = dict.objectForKey(EOAdaptorChannel.AdaptorFailureKey);
        if (value != null) {
          extraInfo.setObjectForKey(value.toString(), EOAdaptorChannel.AdaptorFailureKey);
        }
        value = dict.objectForKey(EOAdaptorChannel.FailedAdaptorOperationKey);
        if (value != null) {
View Full Code Here

        }
        value = dict.objectForKey(EOAdaptorChannel.AdaptorFailureKey);
        if (value != null) {
          extraInfo.setObjectForKey(value.toString(), EOAdaptorChannel.AdaptorFailureKey);
        }
        value = dict.objectForKey(EOAdaptorChannel.FailedAdaptorOperationKey);
        if (value != null) {
          extraInfo.setObjectForKey(value.toString(), EOAdaptorChannel.FailedAdaptorOperationKey);
        }
        if (e instanceof JDBCAdaptorException) {
          value = ((JDBCAdaptorException) e).sqlException();
View Full Code Here

          if(log.isDebugEnabled())
            log.debug("Loading url: " + url);
         
            if(url != null) {
                model = Services.dictionaryFromPathURL(url);
                NSArray rules = (NSArray)model.objectForKey("rules");
                Enumeration e = rules.objectEnumerator();
                boolean patchRules = ERXProperties.booleanForKeyWithDefault("er.directtoweb.ERXD2WModel.patchRules", true);
                while(e.hasMoreElements()) {
                    NSMutableDictionary dict = (NSMutableDictionary)e.nextElement();
                    if(patchRules) {
View Full Code Here

            setCurrentFile(modelFile);
            NSDictionary dic = dictionaryFromPathUrl(modelURL);
            if(dic != null) {
                if (ruleDecodeLog.isDebugEnabled()) {
                    ruleDecodeLog.debug("Got dictionary for file: " + modelFile + "\n\n");
                    for (Enumeration e = ((NSArray)dic.objectForKey("rules")).objectEnumerator(); e.hasMoreElements();) {
                        NSDictionary aRule = (NSDictionary)e.nextElement();
                        NSMutableDictionary aRuleDictionary = new NSMutableDictionary(aRule, "rule");
                        EOKeyValueUnarchiver archiver = new EOKeyValueUnarchiver(aRuleDictionary);
                        try {
                            addRule((Rule)archiver.decodeObjectForKey("rule"));
View Full Code Here

        NSDictionary userInfo = notification.userInfo();

        ERCNConfiguration configuration = ERCNNotificationCoordinator.coordinator().configuration();
        if (configuration.changeTypesToPublish().containsObject(INSERTED))
            _shapshotsForInsertionGroupedByEntity = snapshotsGroupedByEntity((NSArray)userInfo.objectForKey("inserted"));
        else
            _shapshotsForInsertionGroupedByEntity = NSDictionary.EmptyDictionary;

        if (configuration.changeTypesToPublish().containsObject(UPDATED))
            _shapshotsForUpdateGroupedByEntity = snapshotsGroupedByEntity((NSArray)userInfo.objectForKey("updated"));
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.