Package com.damnhandy.uri.template

Examples of com.damnhandy.uri.template.Expression


         {
            throw new MalformedUriTemplateException("Expression close brace was found at position " + position
                  + " yet there was no start brace.");
         }
         expressionCaptureOn = false;
         components.add(new Expression(buffer.toString(), startPosition));
         buffer = null;
      }
      else
      {
         throw new IllegalStateException("Cannot end an expression without beginning the template");
View Full Code Here


         {
            throw new MalformedUriTemplateException("Expression close brace was found at position " + position
                  + " yet there was no start brace.", position);
         }
         expressionCaptureOn = false;
         components.add(new Expression(buffer.toString(), this.startPosition));
         buffer = null;
      }
      else
      {
         throw new IllegalStateException("Cannot end an expression without beginning the template");
View Full Code Here

{

   @Test
   public void testExpressionFromString() throws Exception
   {
      Expression e = new Expression("{test:1}", 0);
      Assert.assertEquals("\\Q{test:1}\\E", e.getReplacementPattern());
   }
View Full Code Here

   }

   @Test
   public void testSimple() throws Exception
   {
      Expression e = Expression.simple(var("var")).build();
      Assert.assertEquals("{var}", e.toString());
   }
View Full Code Here

   }

   @Test
   public void testReserved() throws Exception
   {
      Expression e = Expression.reserved(var("var")).build();
      Assert.assertEquals("{+var}", e.toString());
   }
View Full Code Here

   }

   @Test
   public void testFragment() throws Exception
   {
      Expression e = Expression.fragment(var("var")).build();
      Assert.assertEquals("{#var}", e.toString());
   }
View Full Code Here

   }

   @Test
   public void testLabel() throws Exception
   {
      Expression e = Expression.label(var("var")).build();
      Assert.assertEquals("{.var}", e.toString());
   }
View Full Code Here

   }

   @Test
   public void testPath() throws Exception
   {
      Expression e = Expression.path(var("var")).build();
      Assert.assertEquals("{/var}", e.toString());
   }
View Full Code Here

   }

   @Test
   public void testMatrix() throws Exception
   {
      Expression e = Expression.matrix(var("var")).build();
      Assert.assertEquals("{;var}", e.toString());
   }
View Full Code Here

   }

   @Test
   public void testQuery() throws Exception
   {
      Expression e = Expression.query(var("var")).build();
      Assert.assertEquals("{?var}", e.toString());
   }
View Full Code Here

TOP

Related Classes of com.damnhandy.uri.template.Expression

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.