Package com.webobjects.foundation

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


      Map map = new HashMap();
      NSDictionary nsDict = (NSDictionary) obj;
      Enumeration keysEnum = nsDict.allKeys().objectEnumerator();
      while (keysEnum.hasMoreElements()) {
        Object key = keysEnum.nextElement();
        Object value = nsDict.objectForKey(key);
        key = toJavaCollections(key);
        value = toJavaCollections(value);
        map.put(key, value);
      }
      result = map;
View Full Code Here


      Map map = new HashMap();
      NSDictionary nsDict = (NSDictionary) obj;
      Enumeration keysEnum = nsDict.allKeys().objectEnumerator();
      while (keysEnum.hasMoreElements()) {
        Object key = keysEnum.nextElement();
        Object value = nsDict.objectForKey(key);
        key = toJavaCollections(key);
        value = toJavaCollections(value);
        map.put(key, value);
      }
      result = map;
View Full Code Here

      // New object. Return null.
      if(pkDict == null) {
        return null;
      }
      // Return value for key
      return pkDict.objectForKey(key);
    }
    return super.handleQueryWithUnboundKey(key);
  }
 
  /**
 
View Full Code Here

      NSArray<String> languageArray = new NSArray<String>(language);
      URL url = ERXFileUtilities.pathURLForResourceNamed(selectedFilename, selectedFramework, languageArray);
      NSMutableDictionary dict = new NSMutableDictionary();
         for (Enumeration entries = data.objectEnumerator(); entries.hasMoreElements();) {
           NSDictionary entry = (NSDictionary) entries.nextElement();
           String key = (String) entry.objectForKey("key");
        Object value = entry.objectForKey(language);
        if (value != null && !value.equals(UNSET)) {
          dict.setObjectForKey(value, key);
        }
      }
View Full Code Here

      URL url = ERXFileUtilities.pathURLForResourceNamed(selectedFilename, selectedFramework, languageArray);
      NSMutableDictionary dict = new NSMutableDictionary();
         for (Enumeration entries = data.objectEnumerator(); entries.hasMoreElements();) {
           NSDictionary entry = (NSDictionary) entries.nextElement();
           String key = (String) entry.objectForKey("key");
        Object value = entry.objectForKey(language);
        if (value != null && !value.equals(UNSET)) {
          dict.setObjectForKey(value, key);
        }
      }
         String result = ERXStringUtilities.stringFromDictionary(dict);
View Full Code Here

   */
  public static AjaxProgress progress(WOSession session, String id) {
    AjaxProgress progress = null;
    NSDictionary progresses = (NSDictionary) session.objectForKey(AjaxProgressBar.AJAX_PROGRESSES_KEY);
    if (progresses != null) {
      progress = (AjaxProgress) progresses.objectForKey(id);
    }
    return progress;
  }
}
View Full Code Here

    Object key = null;
    try {
      Enumeration keyEnum = dictionary.allKeys().objectEnumerator();
      while (keyEnum.hasMoreElements()) {
        key = keyEnum.nextElement();
        Object value = dictionary.objectForKey(key);
        String keyString = key.toString(); // only support String keys

        Object json = ser.marshall(state, dictionarydata, value, keyString);

        // omit the object entirely if it's a circular reference or duplicate
View Full Code Here

        NSMutableArray pks = new NSMutableArray();
        String pkAtttributeName = entity.primaryKeyAttributes().lastObject().name();

        for ( Enumeration rowEnumerator = pkDicts.objectEnumerator(); rowEnumerator.hasMoreElements(); ) {
            NSDictionary row = (NSDictionary) rowEnumerator.nextElement();
            pks.addObject( row.objectForKey( pkAtttributeName ));
        }

        EOFetchSpecification spec = new EOFetchSpecification(entityName, null, sortOrderings);
        spec.setRefreshesRefetchedObjects( refreshesCache );
        return new ERXFetchSpecificationBatchIterator( spec, pks, ec, batchSize);
View Full Code Here

        File file = (File)n.object();
        try {
            defaultLog.debug("Reading .plist for entity <"+entity()+">");

            NSDictionary userInfo = (NSDictionary)NSPropertyListSerialization.propertyListFromString(ERXFileUtilities.stringFromFile(file));
            entity().setUserInfo((NSDictionary)userInfo.objectForKey("userInfo"));
           
            _validationInfo = ERXValueUtilities.dictionaryValue(entity().userInfo().objectForKey("ERXValidation"));
            _validationQualiferCache = ERXMutableDictionary.synchronizedDictionary();
            _initialDefaultValues = null;
            readDefaultValues();
View Full Code Here

                for(Enumeration e = qualifiers.objectEnumerator(); e.hasMoreElements();) {
                    NSDictionary info = (NSDictionary)e.nextElement();
                    if(validationLog.isDebugEnabled())
                        validationLog.debug("Validate " + validationTypeString +"."+ property +" with <"+ value + "> on " + object + "\nRule: " + info);
                    if(!validateObjectValueDictWithInfo(values, info, validationTypeString+property+i)) {
                        String message = (String)info.objectForKey("message");
                        String keyPaths = (String)info.objectForKey("keyPaths");
                        property = keyPaths == null ? property : keyPaths;
                        if(validationLog.isDebugEnabled())
                            validationLog.info("Validation failed " + validationTypeString +"."+ property +" with <"+ value + "> on " + object);
                        throw ERXValidationFactory.defaultFactory().createException(object, property, value,message);
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.