Package com.webobjects.foundation

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


        // 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


                                EOFetchSpecification fs = new EOFetchSpecification(rel.destinationEntity().name(), null, null);
                                NSMutableArray<EOQualifier> qualifiers = new NSMutableArray(rel.joins().count());
                                NSDictionary pk = source.primaryKeyForGlobalID(sourceGlobalID);
                                for (Iterator iterator = rel.joins().iterator(); iterator.hasNext();) {
                                    EOJoin join = (EOJoin) iterator.next();
                                    Object pkValue = pk.objectForKey(join.sourceAttribute().name());
                                    EOKeyValueQualifier qualifier = new EOKeyValueQualifier(join.destinationAttribute().name(), EOQualifier.QualifierOperatorEqual, pkValue);
                                    qualifiers.addObject(qualifier);
                                }
                                fs.setQualifier(qualifiers.count() == 1 ? qualifiers.lastObject() : new EOAndQualifier(qualifiers));
                                value = ec.objectsWithFetchSpecification(fs);
View Full Code Here

                NSMutableArray events = (NSMutableArray)result.objectForKey(statsGroup);
                if (null == events) {
                    events = new NSMutableArray();
                    result.setObjectForKey(events, statsGroup);
                }
                events.addObject(statsDict.objectForKey(key));
            }
        }
        return result;
    }
View Full Code Here

      boolean isDataProperty = _attribute.className().endsWith("NSData");
      boolean isStringProperty = _attribute.className().endsWith("String");
      _termVector = (TermVector) classValue(dict, "termVector", TermVector.class, isClassProperty && !isDataProperty && isStringProperty ? "YES" : "NO");
      _store = (Store) classValue(dict, "store", Store.class, "YES");
      _index = (Index) classValue(dict, "index", Index.class, isClassProperty && !isDataProperty && isStringProperty ? "ANALYZED" : "NOT_ANALYZED");
      String analyzerClass = (String) dict.objectForKey("analyzer");
      if (analyzerClass == null && _columnName.matches("\\w+_(\\w+)")) {
        String locale = _columnName.substring(_columnName.lastIndexOf('_') + 1).toLowerCase();
        analyzerClass = LOCALES.objectForKey(locale);
        if (analyzerClass != null) {
          analyzerClass = ERXPatcher.classForName("org.apache.lucene.analysis." + locale + "." + analyzerClass).getName();
View Full Code Here

        analyzerClass = StandardAnalyzer.class.getName();
      }
      Class c = ERXPatcher.classForName(analyzerClass);
      _analyzer = (Analyzer) _NSUtilities.instantiateObject(c, new Class[] { Version.class }, new Object[] { Version.LUCENE_20 }, true, false);

      _format = (Format) create((String) dict.objectForKey("format"));
      String numberFormat = (String) dict.objectForKey("numberformat");
      if (numberFormat != null) {
        _format = new NSNumberFormatter(numberFormat);
      }
      String dateformat = (String) dict.objectForKey("dateformat");
View Full Code Here

      }
      Class c = ERXPatcher.classForName(analyzerClass);
      _analyzer = (Analyzer) _NSUtilities.instantiateObject(c, new Class[] { Version.class }, new Object[] { Version.LUCENE_20 }, true, false);

      _format = (Format) create((String) dict.objectForKey("format"));
      String numberFormat = (String) dict.objectForKey("numberformat");
      if (numberFormat != null) {
        _format = new NSNumberFormatter(numberFormat);
      }
      String dateformat = (String) dict.objectForKey("dateformat");
      if (dateformat != null) {
View Full Code Here

      _format = (Format) create((String) dict.objectForKey("format"));
      String numberFormat = (String) dict.objectForKey("numberformat");
      if (numberFormat != null) {
        _format = new NSNumberFormatter(numberFormat);
      }
      String dateformat = (String) dict.objectForKey("dateformat");
      if (dateformat != null) {
        _format = new NSTimestampFormatter(dateformat);
      }
    }
View Full Code Here

    public String password() {
        String password = null;
        NSDictionary userInfo = (NSDictionary) ERXWOContext.contextDictionary().objectForKey("ERDEditPassword");
        if(userInfo != null) {
            password = (String) userInfo.objectForKey("ERDEditPassword." + passwordPropertyKey() + ".value");
        }
        return password;
    }

    protected String _passwordConfirm;
View Full Code Here

                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

            } catch (EOObjectNotAvailableException e) {
                exception = ERXValidationFactory.defaultFactory().createCustomException(_object, "EOObjectNotAvailableException");
            } catch (EOGeneralAdaptorException e) {
              NSDictionary userInfo = e.userInfo();
              if(userInfo != null) {
                EODatabaseOperation op = (EODatabaseOperation)userInfo.objectForKey(EODatabaseContext.FailedDatabaseOperationKey);
                if(op.databaseOperator() == EODatabaseOperation.DatabaseDeleteOperator) {
                  exception = ERXValidationFactory.defaultFactory().createCustomException(_object, "EOObjectNotAvailableException");
                }
              }
              if(exception == null) {
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.