public class ApiConfigAnnotationReader extends java.lang.Object implements ApiConfigSource
| Constructor and Description |
|---|
ApiConfigAnnotationReader() |
ApiConfigAnnotationReader(java.util.Map<java.lang.String,java.lang.Class<? extends java.lang.annotation.Annotation>> annotationTypes) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isStaticConfig(ApiConfig config)
Returns
true iff configuration from this source is static and cannot change between
calls to this source. |
void |
loadEndpointClass(ServiceContext serviceContext,
java.lang.Class<?> endpointClass,
ApiConfig config)
Loads all configuration data for the endpoint class from the configuration source into
config. |
void |
loadEndpointMethods(ServiceContext serviceContext,
java.lang.Class<?> endpointClass,
ApiClassConfig.MethodConfigMap methodConfigMap)
Loads all configuration data for the methods of the endpoint class from the configuration
source into
methodConfigMap. |
protected void |
readApiAuth(com.google.api.server.spi.config.annotationreader.ApiAuthAnnotationConfig config,
java.lang.annotation.Annotation auth)
Converts the auth config from the auth annotation.
|
protected void |
readApiNamespace(ApiNamespaceAnnotationConfig config,
java.lang.annotation.Annotation namespace) |
public ApiConfigAnnotationReader()
throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundExceptionpublic ApiConfigAnnotationReader(java.util.Map<java.lang.String,java.lang.Class<? extends java.lang.annotation.Annotation>> annotationTypes)
public void loadEndpointClass(ServiceContext serviceContext, java.lang.Class<?> endpointClass, ApiConfig config) throws ApiConfigException
ApiConfigSourceconfig. Does not include configuration data for the endpoint methods.loadEndpointClass in interface ApiConfigSourceserviceContext - Provides context regarding GAE application settings.endpointClass - Class object whose configuration data is being loaded.config - Configuration as loaded so far with defaults and any already-read configurations.
The ApiConfigSource will overwrite any values with those set by its config source.ApiConfigExceptionpublic void loadEndpointMethods(ServiceContext serviceContext, java.lang.Class<?> endpointClass, ApiClassConfig.MethodConfigMap methodConfigMap) throws ApiConfigException
ApiConfigSourcemethodConfigMap.loadEndpointMethods in interface ApiConfigSourceserviceContext - Provides context regarding GAE application settings.endpointClass - Class object whose configuration data is being loaded.methodConfigMap - A map of endpoint method to its configuration data. This data will
can be read and/or overwritten by this method.ApiConfigExceptionpublic boolean isStaticConfig(ApiConfig config)
ApiConfigSourcetrue iff configuration from this source is static and cannot change between
calls to this source. This would be true, for example, when the config is loaded from
annotations on the java classes.isStaticConfig in interface ApiConfigSourceconfig - Configuration as loaded so far with defaults and any already-read configurations.protected void readApiAuth(com.google.api.server.spi.config.annotationreader.ApiAuthAnnotationConfig config,
java.lang.annotation.Annotation auth)
throws java.lang.NoSuchMethodException,
java.lang.IllegalAccessException,
java.lang.reflect.InvocationTargetException
java.lang.NoSuchMethodExceptionjava.lang.IllegalAccessExceptionjava.lang.reflect.InvocationTargetExceptionprotected void readApiNamespace(ApiNamespaceAnnotationConfig config, java.lang.annotation.Annotation namespace) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException
java.lang.IllegalAccessExceptionjava.lang.reflect.InvocationTargetExceptionjava.lang.NoSuchMethodException