Package com.webobjects.foundation

Examples of com.webobjects.foundation.NSArray.objectEnumerator()


        }
    }

    public void init(GSVModel model, EOEntity eoentity) {
  NSArray myattributes = attributes().immutableClone();
  for ( Enumeration e = myattributes.objectEnumerator(); e.hasMoreElements();) {
      GSVAttribute attribute = (GSVAttribute)e.nextElement();
      //NSLog.debug.appendln("checking attribute"+eoentity.name()+"."+attribute.name());
      EOAttribute a = eoentity.attributeNamed(attribute.name());
      EORelationship p = eoentity.relationshipNamed(attribute.name());
     
View Full Code Here


        }

        // Look through the array of instances, and see if we need to add/remove any - configure the rest
        NSMutableArray currentInstances = new NSMutableArray(aConfig.instanceArray());
        if (instanceArray != null) {
            for (Enumeration e = instanceArray.objectEnumerator(); e.hasMoreElements(); ) {
                NSDictionary anInst = (NSDictionary) e.nextElement();
                String hostName = (String) anInst.valueForKey("hostName");
                Integer port = (Integer) anInst.valueForKey("port");
                MInstance anMInstance = aConfig.instanceWithHostnameAndPort(hostName, port);
                // if I can't find the instance, I might be updating the port - in that case, look under the oldport number.
View Full Code Here

        NSArray components = NSArray.componentsSeparatedByString(template, delimiter);
        if (! isLoggingDisabled  &&  log.isDebugEnabled()) {
            log.debug("Components: " + components);
        }
        boolean deriveElement = false; // if the template starts with delim, the first component will be a zero-length string
        for (Enumeration e = components.objectEnumerator(); e.hasMoreElements();) {
            String element = (String)e.nextElement();
            if (deriveElement) {
                if (element.length() == 0) {
                    throw new IllegalArgumentException("\"\" is not a valid keypath");
                }
View Full Code Here

        if (otherObject != null) {
            objects = new Object[] {object, otherObject};
        } else {
            objects = new Object[] {object};
        }
        for (Enumeration e = components.objectEnumerator(); e.hasMoreElements();) {
            String element = (String)e.nextElement();
            if(!isLoggingDisabled) {
                log.debug("Processing Element: " + element);
            }
            if(deriveElement) {
View Full Code Here

                        }
                        if (instanceArray != null) {
                            NSMutableArray instanceArrayResponse = new NSMutableArray(instanceArray.count());

                            // update-remove - for each instance listed - instanceWithHostnameAndPort + removeInstance_W
                            for (Enumeration e = instanceArray.objectEnumerator(); e.hasMoreElements(); ) {
                                NSDictionary anInst = (NSDictionary) e.nextElement();
                                String hostName = (String) anInst.valueForKey("hostName");
                                Integer port = (Integer) anInst.valueForKey("port");
                                MInstance anMInstance = aConfig.instanceWithHostnameAndPort(hostName, port);
                                if (anMInstance == null) {
View Full Code Here

                        }
                        if (instanceArray != null) {
                            NSMutableArray instanceArrayResponse = new NSMutableArray(instanceArray.count());

                            //  update-add - for each instance listed - addInstance_W
                            for (Enumeration e = instanceArray.objectEnumerator(); e.hasMoreElements(); ) {
                                NSDictionary anInst = (NSDictionary) e.nextElement();
                                aConfig.addInstance_W(new MInstance(anInst, aConfig));
                                instanceArrayResponse.addObject(successElement);
                            }
                            addResponse.takeValueForKey(instanceArrayResponse, "instanceArray");
View Full Code Here

                        }
                        if (instanceArray != null) {
                            NSMutableArray instanceArrayResponse = new NSMutableArray(instanceArray.count());

                            // update-configure - for each instance listed - instanceWithHostnameAndPort + updateValues
                            for (Enumeration e = instanceArray.objectEnumerator(); e.hasMoreElements(); ) {
                                NSDictionary anInst = (NSDictionary) e.nextElement();
                                String hostName = (String) anInst.valueForKey("hostName");
                                Integer port = (Integer) anInst.valueForKey("port");
                                MInstance anMInstance = aConfig.instanceWithHostnameAndPort(hostName, port);
                                // if I can't find the instance, I might be updating the port - in that case, look under the oldport number.
View Full Code Here

    if (_subEntitiesCache != null && _subEntitiesCache.count() > 0) {
      for (Enumeration parentNameEnumerator = _subEntitiesCache.keyEnumerator(); parentNameEnumerator.hasMoreElements();) {
        String parentName = (String) parentNameEnumerator.nextElement();
        NSArray children = (NSArray) _subEntitiesCache.objectForKey(parentName);
        EOEntity parent = entityNamed(parentName);
        for (Enumeration childrenEnumerator = children.objectEnumerator(); childrenEnumerator.hasMoreElements();) {
          String childName = (String) childrenEnumerator.nextElement();
          EOEntity child = entityNamed(childName);

          if (child.parentEntity() != parent && !parent.subEntities().containsObject(child)) {
            log.debug("Found entity: " + child.name() + " which should have: " + parent.name() + " as it's parent.");
View Full Code Here

   * @param attribute
   */
  private void flattenPrototypeAttribute(EOAttribute prototypeAttribute, EOAttribute attribute) {
    NSArray prototypeKeys = _prototypeKeys();
    NSMutableArray overriddenKeys = new NSMutableArray();
    Enumeration prototypeKeysEnum = prototypeKeys.objectEnumerator();
    while (prototypeKeysEnum.hasMoreElements()) {
      String prototypeKey = (String) prototypeKeysEnum.nextElement();
      if (_isKeyEnumOverriden(attribute, _enumForKey(prototypeKey))) {
        overriddenKeys.addObject(prototypeKey);
      }
View Full Code Here

                    String relationshipKey = (String) c.valueForKey("keyWhenRelationship");
                    if(keyPath != null) {
                        objects = (NSArray) c.valueForKeyPath(keyPath + "." + relationshipKey +".@flatten.@unique");
                    }
                    if(objects != null) {
                        for (Enumeration e = objects.objectEnumerator(); e.hasMoreElements();) {
                            Object o = e.nextElement();
                            result.addObject(key + ".@" + o);
                        }
                    }
                    c.setPropertyKey(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.