Package groovy.lang

Examples of groovy.lang.Tuple


            while (matcher.find()) {
                newSql.append(sql.substring(txtIndex, matcher.start())).append('?');
                String indexStr = matcher.group(1);
                int index = (indexStr == null || indexStr.length() == 0) ? 0 : new Integer(indexStr) - 1;
                String prop = matcher.group(2);
                indexPropList.add(new Tuple(new Object[]{index, prop.length() == 0 ? "<this>" : prop}));
                txtIndex = matcher.end();
            }
            newSql.append(sql.substring(txtIndex)); // append ending SQL after last param.
            return newSql.toString();
        }
View Full Code Here


        while (matcher.find()) {
            newSql.append(sql.substring(txtIndex, matcher.start())).append('?');
            String indexStr = matcher.group(1);
            int index = (indexStr == null || indexStr.length() == 0) ? 0 : new Integer(matcher.group(1)) - 1;
            String prop = matcher.group(2);
            indexPropList.add(new Tuple(new Object[]{index, prop}));
            txtIndex = matcher.end();
        }
        newSql.append(sql.substring(txtIndex)); // append ending SQL after last param.
        return newSql.toString();
    }
View Full Code Here

            String indexStr = matcher.group(1);
            if (indexStr == null) indexStr = matcher.group(3);
            int index = (indexStr == null || indexStr.length() == 0 || ":".equals(indexStr)) ? 0 : new Integer(indexStr) - 1;
            String prop = matcher.group(2);
            if (prop == null) prop = matcher.group(4);
            indexPropList.add(new Tuple(new Object[]{index, prop == null || prop.length() == 0 ? "<this>" : prop}));
            txtIndex = matcher.end();
        }
        newSql.append(sql.substring(txtIndex)); // append ending SQL after last param.
        return newSql.toString();
    }
View Full Code Here

        while (matcher.find()) {
            newSql.append(sql.substring(txtIndex, matcher.start())).append('?');
            String indexStr = matcher.group(1);
            int index = (indexStr == null || indexStr.length() == 0) ? 0 : new Integer(matcher.group(1)) - 1;
            String prop = matcher.group(2);
            indexPropList.add(new Tuple(new Object[]{index, prop}));
            txtIndex = matcher.end();
        }
        newSql.append(sql.substring(txtIndex)); // append ending SQL after last param.
        return newSql.toString();
    }
View Full Code Here

  private static Object[] unwrapArgs(Object arguments) {
    if (arguments == null) {
      return MetaClassHelper.EMPTY_ARRAY;
    } else if (arguments instanceof Tuple) {
      Tuple tuple = (Tuple) arguments;
      return tuple.toArray();
    } else if (arguments instanceof Object[]) {
      return (Object[])arguments;
    } else {
      return new Object[]{arguments};
    }
View Full Code Here

TOP

Related Classes of groovy.lang.Tuple

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.