Package com.damnhandy.uri.template

Examples of com.damnhandy.uri.template.UriTemplate.expand()


                    UriValue uriValue = link.uriValues()[i];

                    assignTemplateValue(uriTemplate, uriValue.name(), uriValue.value());
                }

                href = uriTemplate.expand();
            } catch (MalformedUriTemplateException | VariableExpansionException e) {
                throw new RuntimeException(e);
            }
        } else {
            href = halLink.getHref();
View Full Code Here


   {
      UriTemplate t = UriTemplate.fromTemplate(template);
      boolean pass = true;
      try
      {
         String actual = t.expand(variables);
         System.out.println(actual);
      }
      catch (ExpressionParseException e)
      {
         pass = false;
View Full Code Here

   @SuppressWarnings("unchecked")
   @Test
   public void test() throws Exception
   {
      UriTemplate t = UriTemplate.fromTemplate(template);
      String actual = t.expand(variables);
      if(expected instanceof String)
      {
         Assert.assertEquals(testsuite + "->  Template: " + template, expected, actual);
      }
      else if(expected instanceof Collection)
View Full Code Here

   public void testExpression() throws Exception
   {
      UriTemplate template = UriTemplate.fromTemplate("{?empty_list}").set(VALUES);

      String expected = "?empty_list=";
      String result = template.expand();
      Assert.assertEquals(expected, result);
   }
}
View Full Code Here

                    UriValue uriValue = link.uriValues()[i];

                    assignTemplateValue(uriTemplate, uriValue.name(), uriValue.value());
                }

                href = uriTemplate.expand();
            } catch (MalformedUriTemplateException | VariableExpansionException e) {
                throw new RuntimeException(e);
            }
        } else {
            href = halLink.getHref();
View Full Code Here

      boolean pass = true;
      String actual = "";
      try
      {
         UriTemplate t = UriTemplate.fromTemplate(template);
         actual = t.expand(variables);
         System.out.println(actual);
      }
      catch (VariableExpansionException e)
      {
         pass = false;
View Full Code Here

   {
      UriTemplate t = UriTemplate.fromTemplate(template);
      String actual;
      try
      {
         actual = t.expand(variables);
         if(expected instanceof String)
         {
            Assert.assertEquals(testsuite + "->  Template: " + template, expected, actual);
         }
         else if(expected instanceof Collection)
View Full Code Here

   public void testExpression() throws Exception
   {
      UriTemplate template = UriTemplate.fromTemplate("{?empty_list}").set(VALUES);

      String expected = "";
      String result = template.expand();
      Assert.assertEquals(expected, result);

      String r2 = com.damnhandy.uri.template.UriTemplate.expand("", new java.util.HashMap<String, Object>() {
          @Override
          public Object put(String key, Object value) {
View Full Code Here

                    UriValue uriValue = link.uriValues()[i];

                    assignTemplateValue(uriTemplate, uriValue.name(), uriValue.value());
                }

                href = uriTemplate.expand();
            } catch (MalformedUriTemplateException | VariableExpansionException e) {
                throw new RuntimeException(e);
            }
        } else {
            href = halLink.getHref();
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.