Package com.webobjects.foundation

Examples of com.webobjects.foundation.NSKeyValueCodingAdditions


    public NSArray recordsForRawRecords(NSArray rawr) {
        NSMutableArray recs = new NSMutableArray();
        Enumeration anEnum = rawr.objectEnumerator();

        while (anEnum.hasMoreElements()) {
            NSKeyValueCodingAdditions rawrec = (NSKeyValueCodingAdditions)anEnum.nextElement();
            recs.addObject(DRRecord.withRawRecordModel(rawrec, this));
        }

        return new NSArray(recs);
    }
View Full Code Here


  }
 
  @Override
  public boolean evaluateWithObject(Object object) {
    boolean match = false;
    NSKeyValueCodingAdditions obj = (NSKeyValueCodingAdditions) object;
    if (obj != null && subqualifier != null) {
      NSKeyValueCodingAdditions finalObj = (NSKeyValueCodingAdditions) obj.valueForKeyPath(baseKeyPath);
      if (finalObj != null) {
        if (finalObj instanceof NSArray) {
          NSArray<NSKeyValueCoding> objArray = (NSArray<NSKeyValueCoding>) finalObj;
          objArray = ERXArrayUtilities.removeNullValues(objArray);
          if (objArray != null && objArray.count() > 0) {
View Full Code Here

   *
   * @return an Object which implements KVC + KVC additions
   */
  public NSKeyValueCodingAdditions objectStore() {
    if (_objectStore == null) {
      _objectStore = new NSKeyValueCodingAdditions() {
        public void takeValueForKey(Object arg0, String arg1) {
          if (arg0 == null) {
            removeObjectForKey(arg1);
          }
          else {
View Full Code Here

  /**
   * Makes ERXConstants available for binding in the UI. Bind to <code>application.constants.MyConstantClass</code>.
   */
  public NSKeyValueCodingAdditions constants() {
    return new NSKeyValueCodingAdditions() {

      public void takeValueForKey(Object value, String key) {
        throw new IllegalArgumentException("Can't set constant");
      }

View Full Code Here

 
  public void testParseTemplatedStringWithNSKeyValueCodingAdditionsObject() {
    String template = "The @@animal.description@@ brown @@animal.type@@ jumped over the fence";
   
    // Anonymous classes
    NSKeyValueCodingAdditions variables = new AnimalHolder();
   
    String result = ERXSimpleTemplateParser.parseTemplatedStringWithObject(template, variables);
   
    assertEquals("The LAZY brown FOX jumped over the fence", result);
  }
View Full Code Here

TOP

Related Classes of com.webobjects.foundation.NSKeyValueCodingAdditions

Copyright © 2018 www.massapicom. 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.