Package com.webobjects.foundation

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


      }

      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);
        dos.write(valueBytes);
      }
View Full Code Here


    }

    public String sqlStringForBindingOnExpression(EOSQLExpression expression) {
        NSDictionary binding = expression.bindVariableDictionaryForAttribute( _attribute, _value );
        expression.addBindVariableDictionary(binding);
        return (String) binding.objectForKey(EOSQLExpression.BindVariablePlaceHolderKey);
    }

}
View Full Code Here

   */
  public static void updateDisplayGroupSort(WODisplayGroup dg, NSArray sortConfig) {
    NSMutableArray sortOrders = new NSMutableArray(sortConfig.count());
    for (int i = 0; i < sortConfig.count(); i++) {
      NSDictionary column = (NSDictionary) sortConfig.objectAtIndex(i);
      sortOrders.addObject(new ERXSortOrdering((String) column.objectForKey(KEY_PATH), (SORT_ASCENDING.equals(column.objectForKey(SORT_DIRECTION)) ? EOSortOrdering.CompareCaseInsensitiveAscending : EOSortOrdering.CompareCaseInsensitiveDescending)));
    }

    // Only set this if there has been an actual change to avoid discarding fetched objects
    if (! sortOrders.equals(dg.sortOrderings()) ) {
      dg.setSortOrderings(sortOrders);
View Full Code Here

   */
  public static void updateDisplayGroupSort(WODisplayGroup dg, NSArray sortConfig) {
    NSMutableArray sortOrders = new NSMutableArray(sortConfig.count());
    for (int i = 0; i < sortConfig.count(); i++) {
      NSDictionary column = (NSDictionary) sortConfig.objectAtIndex(i);
      sortOrders.addObject(new ERXSortOrdering((String) column.objectForKey(KEY_PATH), (SORT_ASCENDING.equals(column.objectForKey(SORT_DIRECTION)) ? EOSortOrdering.CompareCaseInsensitiveAscending : EOSortOrdering.CompareCaseInsensitiveDescending)));
    }

    // Only set this if there has been an actual change to avoid discarding fetched objects
    if (! sortOrders.equals(dg.sortOrderings()) ) {
      dg.setSortOrderings(sortOrders);
View Full Code Here

        StringBuilder sb = new StringBuilder();
        sb.append('{');
        Enumeration keyEnum = dictValue.keyEnumerator();
        while (keyEnum.hasMoreElements()) {
          Object key = keyEnum.nextElement();
          Object value = dictValue.objectForKey(key);
          sb.append(new AjaxValue(key).javascriptValue());
          sb.append(':');
          sb.append(new AjaxValue(value).javascriptValue());
          if (keyEnum.hasMoreElements()) {
            sb.append(',');
View Full Code Here

    }
    public static class QualiferValidation implements EOQualifierEvaluation {
        protected EOQualifier qualifier;
        public QualiferValidation(Object info) {
            NSDictionary dict =(NSDictionary)info;
            qualifier = EOQualifier.qualifierWithQualifierFormat((String)dict.objectForKey("qualifier"), null);
        }
        public boolean evaluateWithObject(Object o) {
            return qualifier.evaluateWithObject(o);
        }
    }
View Full Code Here

     */
    protected NSArray choiceByRemovingKeys(NSArray keys, NSArray choices) {
        NSMutableArray result = new NSMutableArray(choices.count());
        for (Enumeration e = choices.objectEnumerator(); e.hasMoreElements();) {
            NSDictionary choice = (NSDictionary) e.nextElement();
            if(!keys.containsObject(choice.objectForKey(BRANCH_NAME))) {
                result.addObject(choice);
            }
        }
        return result;
    }
View Full Code Here

     */
    protected NSArray choiceByLeavingKeys(NSArray keys, NSArray choices) {
        NSMutableArray result = new NSMutableArray(choices.count());
        for (Enumeration e = choices.objectEnumerator(); e.hasMoreElements();) {
            NSDictionary choice = (NSDictionary) e.nextElement();
            if(keys.containsObject(choice.objectForKey(BRANCH_NAME))) {
                result.addObject(choice);
            }
        }
        return result;
    }
View Full Code Here

            EOKeyGlobalID sourceGid = handler.sourceGlobalID();
            EOEditingContext ec = handler.editingContext();
            synchronized (cache) {
                NSDictionary entries = relationshipCacheEntriesForEntity(sourceGid.entityName(), handler.relationshipName());
                if(entries != null) {
                    NSArray gids = (NSArray) entries.objectForKey(sourceGid);
                    if(gids != null) {
                        NSMutableArray eos = new NSMutableArray(gids.count());
                        for (Enumeration enumerator = gids.objectEnumerator(); enumerator.hasMoreElements();) {
                            EOGlobalID gid = (EOGlobalID) enumerator.nextElement();
                            EOEnterpriseObject eo = ec.faultForGlobalID(gid, ec);
View Full Code Here

        // against the attributes. BUT this dictionary has all entries,
        // even from the child (most likely NULL values)
        // and the current implementation doesn't check against the case
        // when the attribute isn't present in the first place.
        // SO we add this check and live happily ever after
        if (att != null && att._isNonUpdateable() && !dbSnapshot.objectForKey(key).equals(newRow.objectForKey(key))) {
          if (att.isReadOnly()) {
            throw new IllegalStateException("cannot update read-only key '" + key + "' on object:" + dbOp.object() + " of entity: " + entity.name() + " in databaseContext " + this);
          }
          throw new IllegalStateException("cannot update primary-key '" + key + "' from '" + dbSnapshot.objectForKey(key) + "' to '" + newRow.objectForKey(key) + "' on object:" + dbOp.object() + " of entity: " + entity.name() + " in databaseContext " + this);
        }
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.