Package org.jboss.resteasy.specimpl

Examples of org.jboss.resteasy.specimpl.ResteasyUriBuilder


      this.builtinsRegistered = builtinsRegistered;
   }

   public UriBuilder createUriBuilder()
   {
      return new ResteasyUriBuilder();
   }
View Full Code Here


   @SuppressWarnings("unchecked")
   public String resolveURI(Object object)
   {
      Class<? extends Object> clazz = AnnotationResolver
              .getClassWithAnnotation(object.getClass(), getAnnotationType());
      ResteasyUriBuilder uriBuilderImpl = getUriBuilder(clazz);
      Map<String, PropertyDescriptor> descriptors = getPropertyDescriptors(clazz);
      List<Object> values = getValues(object, descriptors, uriBuilderImpl
              .getPathParamNamesInDeclarationOrder());
      return uriBuilderImpl.build(values.toArray()).toString();
   }
View Full Code Here

   }


   private static UriBuilder getBuilder(String uriTemplate)
   {
      return new ResteasyUriBuilder().uriTemplate(uriTemplate);
   }
View Full Code Here

   {
      if (finalUri != null)
         return finalUri;

      ResteasyUriBuilder builder = (ResteasyUriBuilder) uri.clone();
      if (matrixParameters != null)
      {
         for (Map.Entry<String, List<String>> entry : matrixParameters
                 .entrySet())
         {
            List<String> values = entry.getValue();
            for (String value : values)
               builder.matrixParam(entry.getKey(), value);
         }
      }
      if (queryParameters != null)
      {
         for (Map.Entry<String, List<String>> entry : queryParameters
                 .entrySet())
         {
            List<String> values = entry.getValue();
            for (String value : values)
               builder.clientQueryParam(entry.getKey(), value);
         }
      }
      if (pathParameterList != null && !pathParameterList.isEmpty())
      {
         finalUri = builder.build(pathParameterList.toArray()).toString();
      }
      else if (pathParameters != null && !pathParameters.isEmpty())
      {
         for (Map.Entry<String, List<String>> entry : pathParameters.entrySet())
         {
            List<String> values = entry.getValue();
            for (String value : values)
            {
               value = Encode.encodePathAsIs(value);
               builder.substitutePathParam(entry.getKey(), value, true);
            }
         }
      }
      if (finalUri == null)
         finalUri = builder.build().toString();
      return finalUri;
   }
View Full Code Here

   {
      try
      {
         ClientRequest clone = (ClientRequest) this.clone();
         clone.clear();
         clone.uri = new ResteasyUriBuilder();
         clone.uri.uri(uri);
         return clone;
      }
      catch (CloneNotSupportedException e)
      {
View Full Code Here

   }

   protected ResteasyUriBuilder getUriBuilder(Class<? extends Object> clazz)
   {
      MappedBy mappedBy = clazz.getAnnotation(MappedBy.class);
      ResteasyUriBuilder uriBuilderImpl = new ResteasyUriBuilder();
      Class<?> resourceType = mappedBy.resource();
      uriBuilderImpl.path(resourceType);
      String method = mappedBy.method();
      if (method != null && method.length() > 0)
      {
         uriBuilderImpl.path(resourceType, method);
      }
      return uriBuilderImpl;
   }
View Full Code Here

   }

   protected ResteasyUriBuilder getUriBuilder(Class<? extends Object> clazz)
   {
      String uriTemplate = clazz.getAnnotation(URITemplate.class).value();
      ResteasyUriBuilder uriBuilderImpl = new ResteasyUriBuilder();
      uriBuilderImpl.replacePath(uriTemplate);
      return uriBuilderImpl;
   }
View Full Code Here

      return createRequest(base.toString() + uriTemplate);
   }

   public ClientRequest createRequest(String uriTemplate)
   {
      ClientRequest clientRequest = new ClientRequest(new ResteasyUriBuilder()
              .uriTemplate(uriTemplate), executor, providerFactory);
      if (applyDefaultInterceptors)
      {
         ClientInvokerInterceptorFactory.applyDefaultInterceptors(
                 clientRequest, providerFactory);
View Full Code Here

TOP

Related Classes of org.jboss.resteasy.specimpl.ResteasyUriBuilder

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.