Package com.webobjects.foundation

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


        if (!WOApplication.application().isCachingEnabled() && currentFile() != null) {
            String path=currentFile().getAbsolutePath();
            NSArray components = NSArray.componentsSeparatedByString(path, "/");
            int count=components.count();
            String filePath = count > 2 ?
                (String)components.objectAtIndex(count-3)+"/"+ (String)components.objectAtIndex(count-2) :
                path;
            if (_filePathRuleTraceCache == null)
                _filePathRuleTraceCache = new Hashtable();
            for (Enumeration e = rules.objectEnumerator(); e.hasMoreElements();) {
                _filePathRuleTraceCache.put(e.nextElement(), filePath);
View Full Code Here


        if (!WOApplication.application().isCachingEnabled() && currentFile() != null) {
            String path=currentFile().getAbsolutePath();
            NSArray components = NSArray.componentsSeparatedByString(path, "/");
            int count=components.count();
            String filePath = count > 2 ?
                (String)components.objectAtIndex(count-3)+"/"+ (String)components.objectAtIndex(count-2) :
                path;
            if (_filePathRuleTraceCache == null)
                _filePathRuleTraceCache = new Hashtable();
            for (Enumeration e = rules.objectEnumerator(); e.hasMoreElements();) {
                _filePathRuleTraceCache.put(e.nextElement(), filePath);
View Full Code Here

    protected void _addKeyToVector(String key, Vector vector) {
        if (key.indexOf(".")!=-1) {
            // we only take the first atom, unless it's object or session
            NSArray a=NSArray.componentsSeparatedByString(key,".");
            String firstAtom=(String)a.objectAtIndex(0);
            if ( ! _addKeyToVectorKeysToTakeLiterally().containsObject(firstAtom) )
                key = firstAtom;
        }
        if (!vector.contains(key))
            vector.addElement(key);
View Full Code Here

                                File aFile = someFiles.objectAtIndex(index);
                                NSArray someKeys = aRow.allKeys();
                                int keyCount = someKeys.count();

                                for (int keyIndex = 0; keyIndex < keyCount; keyIndex++) {
                                    Object aKey = someKeys.objectAtIndex(keyIndex);
                                    EOAttribute anAttribute = anEntity.attributeNamed(aKey.toString());
                                    if (anAttribute != null) {
                                        Object aValue = aRow.objectForKey(aKey);

                                        NSKeyValueCoding.DefaultImplementation.takeValueForKey(aFile, aValue, anAttribute.columnName());
View Full Code Here

                if (arguments != null && arguments.count() > 0) {
                    Class argumentClasses[] = new Class[arguments.count()];
                    Object argumentValues[] = new Object[arguments.count()];
                    int count = 0;
                    while (count < arguments.count()) {
                        NSDictionary anArgument = (NSDictionary)arguments.objectAtIndex(count);
                        String argumentClassName = (String)anArgument.objectForKey("className");
                        String argumentContextKey = (String)anArgument.objectForKey("contextKey");
                        argumentValues[count] = context.valueForKeyPath(argumentContextKey);
                        argumentClasses[count] = Class.forName(argumentClassName);
                        count++;
View Full Code Here

        NSArray results = editingContext.objectsWithFetchSpecification(fetchSpec);
        if( results.count() > 1)
        {
          throw new MoreThanOneException("objectMatchingValueForKeyEntityNamed: Matched more than one object with " +qualifier);
        }
        return (results.count() == 0) ? null : (EOEnterpriseObject)results.objectAtIndex(0);
    }

    /**
     * Returns the single object of the given type matching the qualifier.
     * 
View Full Code Here

            }
        } else if (q instanceof EOAndQualifier || q instanceof EOOrQualifier) {
            NSArray oriQualifiers = (NSArray)NSKeyValueCoding.Utility.valueForKey(q, "qualifiers");
            NSMutableArray qualifiers = new NSMutableArray();
            for (int i = oriQualifiers.count(); i-- > 0;) {
                EOQualifier qual = (EOQualifier)oriQualifiers.objectAtIndex(i);
                qualifiers.addObject(localInstancesInQualifier(ec, qual));
            }
            return q instanceof EOAndQualifier ? new EOAndQualifier(qualifiers) : new EOOrQualifier(qualifiers);
        } else if (q instanceof EONotQualifier) {
            EONotQualifier qNot = (EONotQualifier)q;
View Full Code Here

            Object result = null;

            if ( valueCount < 2 )
                throw new RuntimeException("Must have at least 2 components in value: " + value);

            target = c.valueForKeyPath((String)value.objectAtIndex(0));
            if ( target != null ) {
                final int numberOfArguments = valueCount - 2;
                final String selectorName = (String)value.objectAtIndex(1);
                final NSSelector selector;
                Object[] arguments = null;
View Full Code Here

                throw new RuntimeException("Must have at least 2 components in value: " + value);

            target = c.valueForKeyPath((String)value.objectAtIndex(0));
            if ( target != null ) {
                final int numberOfArguments = valueCount - 2;
                final String selectorName = (String)value.objectAtIndex(1);
                final NSSelector selector;
                Object[] arguments = null;

                if ( numberOfArguments > 0 ) {
                    arguments = new Object[numberOfArguments];
View Full Code Here

                if ( numberOfArguments > 0 ) {
                    arguments = new Object[numberOfArguments];

                    for ( int i = 2; i < valueCount; i++ )
                        arguments[i-2] = c.valueForKeyPath((String)value.objectAtIndex(i));
                }

                if ( _log.isDebugEnabled() ) {
                    final StringBuilder sb = new StringBuilder('(');
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.