Package org.jboss.resteasy.specimpl

Examples of org.jboss.resteasy.specimpl.UriBuilderImpl


   {
      if (finalUri != null)
         return finalUri;

      UriBuilderImpl builder = (UriBuilderImpl) 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.queryParam(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)
               builder.substitutePathParam(entry.getKey(), value, false);
         }
      }
      if (finalUri == null)
         finalUri = builder.build().toString();
      return finalUri;
   }
View Full Code Here


      this.builtinsRegistered = builtinsRegistered;
   }

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

         if (intfMethod == null) return;
         processMethod(ref, base, clazz, intfMethod);
         return;
      }

      UriBuilderImpl builder = new UriBuilderImpl();
      if (base != null) builder.path(base);
      if (clazz.isAnnotationPresent(Path.class))
      {
         builder.path(clazz);
      }
      if (path != null)
      {
         builder.path(method);
      }
      String pathExpression = builder.getPath();
      if (pathExpression == null) pathExpression = "";

      InjectorFactory injectorFactory = providerFactory.getInjectorFactory();
      if (httpMethods == null)
      {
View Full Code Here

      {
         Path path = method.getAnnotation(Path.class);
         Set<String> httpMethods = IsHttpMethod.getHttpMethods(method);
         if (path == null && httpMethods == null) continue;

         UriBuilderImpl builder = new UriBuilderImpl();
         if (base != null) builder.path(base);
         if (clazz.isAnnotationPresent(Path.class)) builder.path(clazz);
         if (path != null) builder.path(method);
         String pathExpression = builder.getPath();
         if (pathExpression == null) pathExpression = "";

         ResourceInvoker invoker = rootSegment.removePath(pathExpression, method);
         if (invoker != null)
         {
View Full Code Here

* {@link UriBuilderImpl}.
*/
public class ClientRequestConfigurer {

    public static ClientRequestConfigurer create(final ClientExecutor executor, final String uriTemplate) {
        final UriBuilder uriBuilder = new UriBuilderImpl().uriTemplate(uriTemplate);
        final ClientRequest clientRequest = executor.createRequest(uriBuilder);
        return new ClientRequestConfigurer(clientRequest, uriBuilder);
    }
View Full Code Here

         if (intfMethod == null) return;
         processMethod(ref, base, clazz, intfMethod);
         return;
      }

      UriBuilderImpl builder = new UriBuilderImpl();
      if (base != null) builder.path(base);
      if (clazz.isAnnotationPresent(Path.class))
      {
         builder.path(clazz);
      }
      if (path != null)
      {
         builder.path(method);
      }
      String pathExpression = builder.getPath();
      if (pathExpression == null) pathExpression = "";

      InjectorFactory injectorFactory = new InjectorFactoryImpl(providerFactory);
      if (httpMethods == null)
      {
View Full Code Here

      {
         Path path = method.getAnnotation(Path.class);
         Set<String> httpMethods = IsHttpMethod.getHttpMethods(method);
         if (path == null && httpMethods == null) continue;

         UriBuilderImpl builder = new UriBuilderImpl();
         if (base != null) builder.path(base);
         if (clazz.isAnnotationPresent(Path.class)) builder.path(clazz);
         if (path != null) builder.path(method);
         String pathExpression = builder.getPath();
         if (pathExpression == null) pathExpression = "";

         if (rootSegment.removePath(pathExpression, method) != null) size--;
      }
   }
View Full Code Here

      URI absolutePath = null;
      try
      {
         URL absolute = new URL(request.getRequestURL().toString());

         UriBuilderImpl builder = new UriBuilderImpl();
         builder.scheme(absolute.getProtocol());
         builder.host(absolute.getHost());
         builder.port(absolute.getPort());
         builder.path(absolute.getPath());
         builder.replaceQuery(absolute.getQuery());
         absolutePath = builder.build();
      }
      catch (MalformedURLException e)
      {
         throw new RuntimeException(e);
      }
View Full Code Here

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

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

   @SuppressWarnings("unchecked")
   public String resolveURI(Object object)
   {
      Class<? extends Object> clazz = AnnotationResolver
            .getClassWithAnnotation(object.getClass(), getAnnotationType());
      UriBuilderImpl 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

TOP

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

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.