Examples of CapturingGroup


Examples of org.ocpsoft.rewrite.util.ParseTools.CapturingGroup

   }

   @Test
   public void testBalancedCaptureNested2()
   {
      CapturingGroup group = ParseTools.balancedCapture("(one(two)(three(four(five))))".toCharArray(), 4, 28,
               CaptureType.PAREN);
      Assert.assertEquals(8, group.getEnd());
      Assert.assertArrayEquals("two".toCharArray(), group.getCaptured());
   }
View Full Code Here

Examples of org.ocpsoft.rewrite.util.ParseTools.CapturingGroup

   }

   @Test
   public void testBalancedCaptureNested3()
   {
      CapturingGroup group = ParseTools.balancedCapture("(one(two)(three(four(five))))".toCharArray(), 9, 28,
               CaptureType.PAREN);
      Assert.assertEquals(27, group.getEnd());
      Assert.assertArrayEquals("three(four(five))".toCharArray(), group.getCaptured());
   }
View Full Code Here

Examples of org.ocpsoft.rewrite.util.ParseTools.CapturingGroup

   }

   @Test
   public void testBalancedCaptureNested4()
   {
      CapturingGroup group = ParseTools.balancedCapture("(one(two)(three(four(five))))".toCharArray(), 15, 28,
               CaptureType.PAREN);
      Assert.assertEquals(26, group.getEnd());
      Assert.assertArrayEquals("four(five)".toCharArray(), group.getCaptured());
   }
View Full Code Here

Examples of org.ocpsoft.rewrite.util.ParseTools.CapturingGroup

   }

   @Test
   public void testBalancedCaptureNested5()
   {
      CapturingGroup group = ParseTools.balancedCapture("(one(two)(three(four(five))))".toCharArray(), 20, 28,
               CaptureType.PAREN);
      Assert.assertEquals(25, group.getEnd());
      Assert.assertArrayEquals("five".toCharArray(), group.getCaptured());
   }
View Full Code Here

Examples of org.ocpsoft.urlbuilder.util.CapturingGroup

              subSequence = Encoder.path(subSequence);
           
            result.append(subSequence);

            int startPos = cursor;
            CapturingGroup group = ParseTools.balancedCapture(sequence, startPos, sequence.length() - 1,
                     CaptureType.BRACE);
            cursor = group.getEnd();
            lastEnd = group.getEnd() + 1;

            String name = group.getCaptured().toString();

            Parameter parameter = parameters.get(name);
            if (parameter == null || !parameter.hasValues())
               throw new IllegalStateException("No parameter [" + name + "] was set in the pattern [" + sequence
                        + "]. Call address.set(\"" + name + "\", value); or remove the parameter from the pattern.");
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.