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,
com.google.common.cache.Cache<RestAnnotationProcessor.MethodKey,Method> delegationMap,
String apiVersion,
String buildVersion,
ParseSax.Factory parserFactory,
HttpUtils utils,
ContentMetadataCodec contentMetadataCodec,
com.google.inject.TypeLiteral<T> typeLiteral) |
Modifier and Type | Method and Description |
---|---|
void |
addHeaderIfAnnotationPresentOnMethod(com.google.common.collect.Multimap<String,String> headers,
Method method,
com.google.common.collect.Multimap<String,?> tokenValues) |
com.google.common.collect.Multimap<String,String> |
buildHeaders(com.google.common.collect.Multimap<String,?> tokenValues,
Method method,
Object... args) |
static com.google.common.base.Function<Exception,?> |
createExceptionParserOrThrowResourceNotFoundOn404IfNoAnnotation(com.google.inject.Injector injector,
Method method) |
GeneratedHttpRequest |
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 |
decorateRequest(GeneratedHttpRequest 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) |
Class<T> |
getDeclaring()
the class that is being processed
|
Method |
getDelegateOrNull(Method in) |
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) |
protected com.google.common.base.Optional<?> |
getParamValue(Method method,
Object[] args,
Set<Annotation> extractors,
Map.Entry<Integer,Set<Annotation>> entry,
String paramKey) |
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) |
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, com.google.common.cache.Cache<RestAnnotationProcessor.MethodKey,Method> delegationMap, String apiVersion, String buildVersion, ParseSax.Factory parserFactory, HttpUtils utils, ContentMetadataCodec contentMetadataCodec, com.google.inject.TypeLiteral<T> typeLiteral)
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 createRequest(Method method, Object... args)
public static com.google.common.collect.Multimap<String,String> filterOutContentHeaders(com.google.common.collect.Multimap<String,String> headers)
public static URI getEndpointInParametersOrNull(Method method, Object[] args, com.google.inject.Injector injector)
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 decorateRequest(GeneratedHttpRequest request) throws NegativeArraySizeException
NegativeArraySizeException
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)
public com.google.common.collect.Multimap<String,String> buildHeaders(com.google.common.collect.Multimap<String,?> tokenValues, Method method, Object... args)
public void addHeaderIfAnnotationPresentOnMethod(com.google.common.collect.Multimap<String,String> headers, Method method, com.google.common.collect.Multimap<String,?> tokenValues)
public static HttpRequest findHttpRequestInArgs(Object[] args)
protected com.google.common.base.Optional<?> getParamValue(Method method, Object[] args, Set<Annotation> extractors, Map.Entry<Integer,Set<Annotation>> entry, String paramKey)
Copyright © 2009-2013 jclouds. All Rights Reserved.