public class RestAnnotationProcessor<T> extends Object
Modifier and Type | Class and Description |
---|---|
static class |
RestAnnotationProcessor.MethodKey |
Modifier and Type | Field and Description |
---|---|
static String |
BOUNDARY |
static com.google.inject.TypeLiteral<com.google.common.util.concurrent.ListenableFuture<Boolean>> |
futureBooleanLiteral |
static com.google.inject.TypeLiteral<com.google.common.util.concurrent.ListenableFuture<HttpResponse>> |
futureHttpResponseLiteral |
static com.google.inject.TypeLiteral<com.google.common.util.concurrent.ListenableFuture<InputStream>> |
futureInputStreamLiteral |
static com.google.inject.TypeLiteral<com.google.common.util.concurrent.ListenableFuture<String>> |
futureStringLiteral |
static com.google.inject.TypeLiteral<com.google.common.util.concurrent.ListenableFuture<URI>> |
futureURILiteral |
static com.google.inject.TypeLiteral<com.google.common.util.concurrent.ListenableFuture<Void>> |
futureVoidLiteral |
protected Logger |
logger |
Constructor and Description |
---|
RestAnnotationProcessor(com.google.inject.Injector injector,
com.google.common.cache.LoadingCache<Class<?>,Boolean> seedAnnotationCache,
String apiVersion,
String buildVersion,
ParseSax.Factory parserFactory,
HttpUtils utils,
com.google.inject.TypeLiteral<T> typeLiteral) |
Modifier and Type | Method and Description |
---|---|
void |
addHeaderIfAnnotationPresentOnMethod(com.google.common.collect.Multimap<String,String> headers,
Method method,
Collection<Map.Entry<String,String>> tokenValues) |
static URI |
addHostIfMissing(URI original,
URI withHost) |
com.google.common.collect.Multimap<String,String> |
buildHeaders(Collection<Map.Entry<String,String>> tokenValues,
Method method,
Object... args) |
static com.google.common.base.Function<Exception,?> |
createExceptionParserOrThrowResourceNotFoundOn404IfNoAnnotation(com.google.inject.Injector injector,
Method method) |
GeneratedHttpRequest<T> |
createRequest(Method method,
Object... args) |
static com.google.common.base.Function<HttpResponse,?> |
createResponseParser(ParseSax.Factory parserFactory,
com.google.inject.Injector injector,
Method method,
HttpRequest request) |
GeneratedHttpRequest<T> |
decorateRequest(GeneratedHttpRequest<T> request) |
static com.google.common.collect.Multimap<String,String> |
filterOutContentHeaders(com.google.common.collect.Multimap<String,String> headers) |
static HttpRequest |
findHttpRequestInArgs(Object[] args) |
static Payload |
findPayloadInArgs(Object[] args) |
Method |
getDelegateOrNull(Method in) |
static URI |
getEndpointFor(Method method,
Object[] args,
com.google.inject.Injector injector) |
static URI |
getEndpointInParametersOrNull(Method method,
Object[] args,
com.google.inject.Injector injector) |
String |
getHttpMethodOrConstantOrThrowException(Method method) |
static Set<String> |
getHttpMethods(Method method) |
static com.google.inject.Key<? extends com.google.common.base.Function<HttpResponse,?>> |
getJAXBParserKeyForMethod(Method method) |
static com.google.inject.Key<? extends com.google.common.base.Function<HttpResponse,?>> |
getJsonParserKeyForMethod(Method method) |
static com.google.inject.Key<? extends com.google.common.base.Function<HttpResponse,?>> |
getJsonParserKeyForMethodAnType(Method method,
Type returnVal) |
MapBinder |
getMapPayloadBinderOrNull(Method method,
Object... args) |
static com.google.inject.Key<? extends com.google.common.base.Function<HttpResponse,?>> |
getParserOrThrowException(Method method) |
static Type |
getReturnTypeForMethod(Method method) |
static Class<? extends ParseSax.HandlerWithResult<?>> |
getSaxResponseParserClassOrNull(Method method) |
static com.google.common.base.Function<HttpResponse,?> |
getTransformerForMethod(Method method,
com.google.inject.Injector injector) |
static Map<Integer,Set<Annotation>> |
indexWithOnlyOneAnnotation(Method method,
String description,
com.google.common.cache.LoadingCache<Method,com.google.common.cache.LoadingCache<Integer,Set<Annotation>>> toRefine) |
static URI |
replaceQuery(Provider<UriBuilder> uriBuilderProvider,
URI in,
String newQuery,
Comparator<Map.Entry<String,String>> sorter,
char... skips) |
URI |
replaceQuery(URI in,
String newQuery,
Comparator<Map.Entry<String,String>> sorter) |
void |
setCaller(ClassMethodArgs caller) |
boolean |
shouldAddHostHeader(Method method) |
protected Logger logger
public static final String BOUNDARY
public static final com.google.inject.TypeLiteral<com.google.common.util.concurrent.ListenableFuture<Boolean>> futureBooleanLiteral
public static final com.google.inject.TypeLiteral<com.google.common.util.concurrent.ListenableFuture<String>> futureStringLiteral
public static final com.google.inject.TypeLiteral<com.google.common.util.concurrent.ListenableFuture<Void>> futureVoidLiteral
public static final com.google.inject.TypeLiteral<com.google.common.util.concurrent.ListenableFuture<URI>> futureURILiteral
public static final com.google.inject.TypeLiteral<com.google.common.util.concurrent.ListenableFuture<InputStream>> futureInputStreamLiteral
public static final com.google.inject.TypeLiteral<com.google.common.util.concurrent.ListenableFuture<HttpResponse>> futureHttpResponseLiteral
@Inject public RestAnnotationProcessor(com.google.inject.Injector injector, com.google.common.cache.LoadingCache<Class<?>,Boolean> seedAnnotationCache, String apiVersion, String buildVersion, ParseSax.Factory parserFactory, HttpUtils utils, com.google.inject.TypeLiteral<T> typeLiteral) throws ExecutionException
ExecutionException
public static com.google.common.base.Function<HttpResponse,?> createResponseParser(ParseSax.Factory parserFactory, com.google.inject.Injector injector, Method method, HttpRequest request)
public static com.google.common.base.Function<HttpResponse,?> getTransformerForMethod(Method method, com.google.inject.Injector injector)
public static com.google.common.base.Function<Exception,?> createExceptionParserOrThrowResourceNotFoundOn404IfNoAnnotation(com.google.inject.Injector injector, Method method)
public void setCaller(ClassMethodArgs caller)
public GeneratedHttpRequest<T> createRequest(Method method, Object... args)
public static com.google.common.collect.Multimap<String,String> filterOutContentHeaders(com.google.common.collect.Multimap<String,String> headers)
public URI replaceQuery(URI in, String newQuery, @Nullable Comparator<Map.Entry<String,String>> sorter)
public static URI replaceQuery(Provider<UriBuilder> uriBuilderProvider, URI in, String newQuery, @Nullable Comparator<Map.Entry<String,String>> sorter, char... skips)
public static URI getEndpointInParametersOrNull(Method method, Object[] args, com.google.inject.Injector injector) throws ExecutionException
ExecutionException
public static URI getEndpointFor(Method method, Object[] args, com.google.inject.Injector injector) throws ExecutionException
ExecutionException
public static com.google.inject.Key<? extends com.google.common.base.Function<HttpResponse,?>> getParserOrThrowException(Method method)
public static com.google.inject.Key<? extends com.google.common.base.Function<HttpResponse,?>> getJsonParserKeyForMethod(Method method)
public static com.google.inject.Key<? extends com.google.common.base.Function<HttpResponse,?>> getJAXBParserKeyForMethod(Method method)
public static com.google.inject.Key<? extends com.google.common.base.Function<HttpResponse,?>> getJsonParserKeyForMethodAnType(Method method, Type returnVal)
public static Class<? extends ParseSax.HandlerWithResult<?>> getSaxResponseParserClassOrNull(Method method)
public String getHttpMethodOrConstantOrThrowException(Method method)
public boolean shouldAddHostHeader(Method method)
public GeneratedHttpRequest<T> decorateRequest(GeneratedHttpRequest<T> request) throws NegativeArraySizeException, ExecutionException
public static Map<Integer,Set<Annotation>> indexWithOnlyOneAnnotation(Method method, String description, com.google.common.cache.LoadingCache<Method,com.google.common.cache.LoadingCache<Integer,Set<Annotation>>> toRefine) throws ExecutionException
ExecutionException
public com.google.common.collect.Multimap<String,String> buildHeaders(Collection<Map.Entry<String,String>> tokenValues, Method method, Object... args) throws ExecutionException
ExecutionException
public void addHeaderIfAnnotationPresentOnMethod(com.google.common.collect.Multimap<String,String> headers, Method method, Collection<Map.Entry<String,String>> tokenValues)
public static HttpRequest findHttpRequestInArgs(Object[] args)
Copyright © 2009-2012 jclouds. All Rights Reserved.