Package com.webobjects.foundation

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


  public static Object toJavaCollections(Object obj) {
    Object result;
    if (obj instanceof NSDictionary) {
      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);
View Full Code Here


  public static Object toJavaCollections(Object obj) {
    Object result;
    if (obj instanceof NSDictionary) {
      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);
View Full Code Here

    catch (JSONException e) {
      throw new MarshallException("Could not add nsdictionary to object: " + e.getMessage());
    }
    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
View Full Code Here

     */
    @SuppressWarnings("javadoc")
  public static Properties propertiesFromArgv(String[] argv) {
      ERXProperties._Properties properties = new ERXProperties._Properties();
        NSDictionary argvDict = NSProperties.valuesFromArgv(argv);
        Enumeration e = argvDict.allKeys().objectEnumerator();
        while (e.hasMoreElements()) {
            Object key = e.nextElement();
            properties.put(key, argvDict.objectForKey(key));
        }
        return properties;
View Full Code Here

      if (userInfo == null) {
        userInfo = NSDictionary.EmptyDictionary;
      }

      dos.writeShort(userInfo.count());
      for (Object key : userInfo.allKeys()) {
        byte[] keyBytes = key.toString().getBytes();
        byte[] valueBytes = userInfo.objectForKey(key).toString().getBytes();
        dos.writeShort(keyBytes.length);
        dos.write(keyBytes);
        dos.writeShort(valueBytes.length);
View Full Code Here

    loadModel(file.toURI().toURL());
  }

  private void loadModel(URL url) {
    NSDictionary def = (NSDictionary) NSPropertyListSerialization.propertyListWithPathURL(url);
    for (Enumeration keys = def.allKeys().objectEnumerator(); keys.hasMoreElements();) {
      String key = (String) keys.nextElement();
      NSDictionary indexDef = (NSDictionary) def.objectForKey(key);
      addIndex(key, indexDef);
    }
  }
View Full Code Here

            if(choices != null) {
                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();
View Full Code Here

            if(choices != null) {
                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();
View Full Code Here

            log.debug("Object " + c.valueForKey("object"));
            log.debug("qualifierFormat "+qualFormat);
            log.debug("args "+args);
            log.debug("switchDictionary " + switchDictionary);
        }
        for(Enumeration e = switchDictionary.allKeys().objectEnumerator();
            e.hasMoreElements();){
            String switchKey = (String)e.nextElement();
            String completedQualFormat =
                NSArray.componentsSeparatedByString( qualFormat, "@@").componentsJoinedByString(switchKey);
            EOQualifier qualifier =
View Full Code Here

       
        if (totalDict == null) {
            return 0;
        }

        int totalCount = totalDict.allKeys().count();
        return totalCount;
    }


    public String colorForCoords() {
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.