Package com.google.code.regexp

Examples of com.google.code.regexp.Matcher.group()


            if (matcher.find())
            {
                StringBuilder tmp = new StringBuilder();
                tmp.append(newIndent).append(matcher.group("modifiers")).append(simpleName).append("(");
               
                String[] args = matcher.group("parameters").split(", ");
                for(int x = 2; x < args.length; x++)
                    tmp.append(args[x]).append(x < args.length - 1 ? ", " : "");
                tmp.append(")");
               
                tmp.append(matcher.group("end"));
View Full Code Here


                String[] args = matcher.group("parameters").split(", ");
                for(int x = 2; x < args.length; x++)
                    tmp.append(args[x]).append(x < args.length - 1 ? ", " : "");
                tmp.append(")");
               
                tmp.append(matcher.group("end"));
                newLine = tmp.toString();
               
                if (args.length <= 2 && newLine.endsWith("}"))
                    newLine = "";
            }
View Full Code Here

           
            // find constructor calls...
            matcher = constructorCall.matcher(line);
            if (matcher.find())
            {
                String body = matcher.group("body");
               
                if (!Strings.isNullOrEmpty(body))
                {
                    String[] args = body.split(", ");
                    args = Arrays.copyOfRange(args, 2, args.length);
View Full Code Here

                    String[] args = body.split(", ");
                    args = Arrays.copyOfRange(args, 2, args.length);
                    body = Joiner.on(", ").join(args);
                }
               
                newLine = newIndent + "   " + matcher.group("name") + "(" + body + ")" + matcher.group("end");
            }
           
            if (prevSynthetic)
            {
                matcher = valueField.matcher(line);
View Full Code Here

                    String[] args = body.split(", ");
                    args = Arrays.copyOfRange(args, 2, args.length);
                    body = Joiner.on(", ").join(args);
                }
               
                newLine = newIndent + "   " + matcher.group("name") + "(" + body + ")" + matcher.group("end");
            }
           
            if (prevSynthetic)
            {
                matcher = valueField.matcher(line);
View Full Code Here

        {
            Matcher matcher = METHOD_REG.matcher(line);
            boolean found = matcher.find();
            if (!line.endsWith(";") && !line.endsWith(",") && found)// && !line.contains("=") && !NESTED_PERINTH.matcher(line).find())
            {
                method = new MethodInfo(method, matcher.group("indent"));
                method.lines.add(line);

                boolean invalid = false; // Can't think of a better way to filter out enum declarations, so make sure that all the parameters have types
                String args = matcher.group("parameters");
                if (args != null)
View Full Code Here

            {
                method = new MethodInfo(method, matcher.group("indent"));
                method.lines.add(line);

                boolean invalid = false; // Can't think of a better way to filter out enum declarations, so make sure that all the parameters have types
                String args = matcher.group("parameters");
                if (args != null)
                {
                    for (String str : Splitter.on(',').trimResults().omitEmptyStrings().split(args))
                    {
                        if (str.indexOf(' ') == -1)
View Full Code Here

            {
                method.lines.add(line);
                matcher = CATCH_REG.matcher(line);
                if (matcher.find())
                {
                    method.addVar(matcher.group(1));
                }
                else
                {
                    matcher = VAR_CALL.matcher(line);
                    while (matcher.find())
View Full Code Here

                else
                {
                    matcher = VAR_CALL.matcher(line);
                    while (matcher.find())
                    {
                        String match = matcher.group();
                        if (!match.startsWith("return") && !match.startsWith("throw"))
                        {
                            method.addVar(match);
                        }
                    }
View Full Code Here

    }
   
    protected static String getGroupName(String input,String groupName,Pattern pattern){
      Matcher m = pattern.matcher(input);
      if(m.matches()){
        return m.group(groupName);
      }
      return 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.