Package blackberry.common.util

Examples of blackberry.common.util.StringTokenizer


        // Parse whether leftField contains subfield or attribute
        Scriptable o = object;
        String optional = "";
        String key = fieldName;
        if (key.indexOf('.') >= 0) {
            final StringTokenizer st = new StringTokenizer(key, ".");
            while (true) {
                key = st.nextToken();
                if (!st.hasMoreTokens()) {
                    break;
                }

                Object field;
                try {
                    field = o.getField(key);
                } catch (final Exception e) {
                    field = null;
                }

                if (field == null) {
                    return null;
                }

                if (field instanceof Scriptable) {
                    o = (Scriptable) field;
                }
                else if (field instanceof Date) {
                    optional = st.nextToken();
                    break;
                }
            }
        }
View Full Code Here


        // Parse whether leftField contains subfield or attribute
        ScriptableObjectBase o = object;
        String optional = "";
        String key = fieldName;
        if( key.indexOf( '.' ) >= 0 ) {
            final StringTokenizer st = new StringTokenizer( key, "." );
            while( true ) {
                key = st.nextToken();
                if( !st.hasMoreTokens() ) {
                    break;
                }

                final ScriptField field = o.getItem( key );
                if( field == null ) {
                    return null;
                }

                if( field.getType() == ScriptField.TYPE_SCRIPTABLE ) {
                    o = (ScriptableObjectBase) field.getValue();
                    if( o == null ) {
                        return null;
                    }
                } else {
                    // allow other types have sub-property???
                    optional = st.nextToken();
                    break;
                }
            }
        }
View Full Code Here

TOP

Related Classes of blackberry.common.util.StringTokenizer

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.