juneau-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamesbog...@apache.org
Subject juneau git commit: RestContext refactor.
Date Mon, 01 Jan 2018 17:58:24 GMT
Repository: juneau
Updated Branches:
  refs/heads/master fec6af37c -> c36b16d70


RestContext refactor.

Project: http://git-wip-us.apache.org/repos/asf/juneau/repo
Commit: http://git-wip-us.apache.org/repos/asf/juneau/commit/c36b16d7
Tree: http://git-wip-us.apache.org/repos/asf/juneau/tree/c36b16d7
Diff: http://git-wip-us.apache.org/repos/asf/juneau/diff/c36b16d7

Branch: refs/heads/master
Commit: c36b16d70bb5ebeeaaca0005f8a52761a5a6b401
Parents: fec6af3
Author: JamesBognar <jamesbognar@apache.org>
Authored: Mon Jan 1 12:58:21 2018 -0500
Committer: JamesBognar <jamesbognar@apache.org>
Committed: Mon Jan 1 12:58:21 2018 -0500

----------------------------------------------------------------------
 .../org/apache/juneau/rest/RestContext.java     | 115 +++++-
 .../apache/juneau/rest/RestContextBuilder.java  | 363 +++++++++++--------
 .../juneau/rest/RestResourceResolver.java       |  10 +-
 .../juneau/rest/RestResourceResolverSimple.java |  10 +-
 .../juneau/rest/annotation/RestResource.java    | 110 +++---
 5 files changed, 397 insertions(+), 211 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/juneau/blob/c36b16d7/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContext.java
----------------------------------------------------------------------
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContext.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContext.java
index d40ec35..dab4722 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContext.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContext.java
@@ -507,11 +507,110 @@ public final class RestContext extends BeanContext {
 	 * 	<li>Property: {@link RestContext#REST_clientVersionHeader}
 	 * 	<li>Annotation:  {@link RestResource#clientVersionHeader()} 
 	 * 	<li>Method: {@link RestContextBuilder#clientVersionHeader(String)}
-	 * 	<li>The default value is <js>"X-Client-Version"</js>.
 	 *	</ul>
 	 */
 	public static final String REST_clientVersionHeader = PREFIX + "clientVersionHeader.s";
 
+	/**
+	 * <b>Configuration property:</b>  REST resource resolver.
+	 *
+	 * <ul>
+	 * 	<li><b>Name:</b> <js>"RestContext.resourceResolver.o"</js>
+	 * 	<li><b>Data type:</b> <code>Class&lt;? <jk>extends</jk>
RestResourceResolver&gt; | RestResourceResolver</code>
+	 * 	<li><b>Default:</b> {@link RestResourceResolverSimple}
+	 * 	<li><b>Session-overridable:</b> <jk>false</jk>
+	 * </ul>
+	 * 
+	 * The resolver used for resolving child resources.
+	 * 
+	 * <p>
+	 * Can be used to provide customized resolution of REST resource class instances (e.g. resources
retrieve from Spring).
+	 *
+	 * <p>
+	 * <h5 class='section'>Notes:</h5>
+	 * <ul class='spaced-list'>
+	 * 	<li>Property: {@link RestContext#REST_resourceResolver}
+	 * 	<li>Annotation:  {@link RestResource#resourceResolver()} 
+	 * 	<li>Method: {@link RestContextBuilder#resourceResolver(Class)} / {@link RestContextBuilder#resourceResolver(RestResourceResolver)}
+	 * 	<li>Unless overridden, resource resolvers are inherited from parent resources.
+	 *	</ul>
+	 */
+	public static final String REST_resourceResolver = PREFIX + "resourceResolver.o";
+
+	/**
+	 * <b>Configuration property:</b>  REST logger.
+	 * 
+	 * <ul>
+	 * 	<li><b>Name:</b> <js>"RestContext.logger.o"</js>
+	 * 	<li><b>Data type:</b> <code>Class&lt;? <jk>extends</jk>
RestLogger&gt; | RestLogger</code>
+	 * 	<li><b>Default:</b> {@link RestLogger.Normal}
+	 * 	<li><b>Session-overridable:</b> <jk>false</jk>
+	 * </ul>
+	 * 
+	 * <p>
+	 * Specifies the logger to use for logging.
+	 * 
+	 * <p>
+	 * <h5 class='section'>Notes:</h5>
+	 * <ul class='spaced-list'>
+	 * 	<li>Property: {@link RestContext#REST_logger}
+	 * 	<li>Annotation:  {@link RestResource#logger()} 
+	 * 	<li>Method: {@link RestContextBuilder#logger(Class)} / {@link RestContextBuilder#logger(RestLogger)}

+	 * 	<li>The {@link RestLogger.Normal} logger can be used to provide basic error logging
to the Java logger.
+	 *	</ul>
+	 */
+	public static final String REST_logger = PREFIX + "logger.o";
+
+	/**
+	 * <b>Configuration property:</b>  REST call handler.
+	 *
+	 * <ul>
+	 * 	<li><b>Name:</b> <js>"RestContext.callHandler.o"</js>
+	 * 	<li><b>Data type:</b> <code>Class&lt;? <jk>extends</jk>
RestCallHandler&gt; | RestCallHandler</code>
+	 * 	<li><b>Default:</b> {@link RestCallHandler}
+	 * 	<li><b>Session-overridable:</b> <jk>false</jk>
+	 * </ul>
+	 * 
+	 * <p>
+	 * This class handles the basic lifecycle of an HTTP REST call.
+	 * <br>Subclasses can be used to customize how these HTTP calls are handled.
+
+	 * <p>
+	 * <h5 class='section'>Notes:</h5>
+	 * <ul class='spaced-list'>
+	 * 	<li>Property: {@link RestContext#REST_callHandler}
+	 * 	<li>Annotation:  {@link RestResource#callHandler()} 
+	 * 	<li>Method: {@link RestContextBuilder#callHandler(Class)} / {@link RestContextBuilder#callHandler(RestCallHandler)}

+	 *	</ul>
+	 */
+	public static final String REST_callHandler = PREFIX + "callHandler.o";
+
+	/**
+	 * <b>Configuration property:</b>  REST info provider. 
+	 *
+	 * <ul>
+	 * 	<li><b>Name:</b> <js>"RestContext.infoProvider.o"</js>
+	 * 	<li><b>Data type:</b> <code>Class&lt;? <jk>extends</jk>
RestInfoProvider&gt; | RestInfoProvider</code>
+	 * 	<li><b>Default:</b> {@link RestInfoProvider}
+	 * 	<li><b>Session-overridable:</b> <jk>false</jk>
+	 * </ul>
+	 * 
+	 * <p>
+	 * Class used to retrieve title/description/swagger information about a resource.
+	 *
+	 * <p>
+	 * Subclasses can be used to customize the documentation on a resource.
+	 *
+	 * <p>
+	 * <h5 class='section'>Notes:</h5>
+	 * <ul class='spaced-list'>
+	 * 	<li>Property: {@link RestContext#REST_infoProvider}
+	 * 	<li>Annotation:  {@link RestResource#infoProvider()} 
+	 * 	<li>Method: {@link RestContextBuilder#infoProvider(Class)} / {@link RestContextBuilder#infoProvider(RestInfoProvider)}

+	 *	</ul>
+	 */
+	public static final String REST_infoProvider = PREFIX + "infoProvider.o";
+	
 	
 	//-------------------------------------------------------------------------------------------------------------------
 	// Instance
@@ -636,6 +735,8 @@ public final class RestContext extends BeanContext {
 		
 		defaultResponseHeaders = getMapProperty(REST_defaultResponseHeaders, String.class);
 		
+		logger = getInstanceProperty(REST_logger, resource, RestLogger.class, RestLogger.NoOp.class,
false);
+
 		try {
 			this.resourceFinder = new ResourceFinder(resource.getClass());
 
@@ -654,7 +755,6 @@ public final class RestContext extends BeanContext {
 			this.staticFilesPrefixes = b.staticFilesPrefixes;
 			this.msgs = b.messageBundle;
 			this.childResources = Collections.synchronizedMap(new LinkedHashMap<String,RestContext>());
 // Not unmodifiable on purpose so that children can be replaced.
-			this.logger = b.logger;
 			this.fullPath = b.fullPath;
 			this.contextPath = nullIfEmpty(b.contextPath);
 			this.widgets = Collections.unmodifiableMap(b.widgets);
@@ -853,7 +953,7 @@ public final class RestContext extends BeanContext {
 			this.callRouters = Collections.unmodifiableMap(_callRouters);
 
 			// Initialize our child resources.
-			resourceResolver = resolve(resource, RestResourceResolver.class, b.resourceResolver);
+			resourceResolver = getInstanceProperty(REST_resourceResolver, resource, RestResourceResolver.class,
parentContext == null ? RestResourceResolverSimple.class : parentContext.resourceResolver,
true, this);
 			for (Object o : builder.childResources) {
 				String path = null;
 				Object r = null;
@@ -893,8 +993,8 @@ public final class RestContext extends BeanContext {
 				childResources.put(path, rc2);
 			}
 
-			callHandler = builder.callHandler == null ? new RestCallHandler(this) : resolve(resource,
RestCallHandler.class, builder.callHandler, this);
-			infoProvider = builder.infoProvider == null ? new RestInfoProvider(this) : resolve(resource,
RestInfoProvider.class, builder.infoProvider, this);
+			callHandler = getInstanceProperty(REST_callHandler, resource, RestCallHandler.class, RestCallHandler.class,
true, this);
+			infoProvider = getInstanceProperty(REST_infoProvider, resource, RestInfoProvider.class,
RestInfoProvider.class, true, this);
 
 		} catch (RestException e) {
 			_initException = e;
@@ -929,10 +1029,8 @@ public final class RestContext extends BeanContext {
 		Map<String,String> staticFilesMap;
 		String[] staticFilesPrefixes;
 		MessageBundle messageBundle;
-		RestLogger logger;
 		String fullPath;
 		Map<String,Widget> widgets;
-		Object resourceResolver;
 		String contextPath;
 
 		@SuppressWarnings("unchecked")
@@ -942,8 +1040,6 @@ public final class RestContext extends BeanContext {
 			
 			LinkedHashMap<Class<?>,RestResource> restResourceAnnotationsChildFirst = findAnnotationsMap(RestResource.class,
resource.getClass());
 
-			resourceResolver = rcb.resourceResolver;
-
 			varResolver = rcb.varResolverBuilder
 				.vars(FileVar.class, LocalizationVar.class, RequestVar.class, SerializedRequestAttrVar.class,
ServletInitParamVar.class, UrlVar.class, UrlEncodeVar.class, WidgetVar.class)
 				.build()
@@ -993,7 +1089,6 @@ public final class RestContext extends BeanContext {
 			}
 			staticFilesPrefixes = staticFilesMap.keySet().toArray(new String[0]);
 
-			logger = rcb.logger == null ? new RestLogger.NoOp() : resolve(resource, RestLogger.class,
rcb.logger);
 
 			fullPath = (rcb.parentContext == null ? "" : (rcb.parentContext.fullPath + '/')) + rcb.path;
 

http://git-wip-us.apache.org/repos/asf/juneau/blob/c36b16d7/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContextBuilder.java
----------------------------------------------------------------------
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContextBuilder.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContextBuilder.java
index 7fedf52..bc80909 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContextBuilder.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestContextBuilder.java
@@ -112,11 +112,6 @@ public class RestContextBuilder extends BeanContextBuilder implements
ServletCon
 	HtmlDocBuilder htmlDocBuilder;
 	List<Class<? extends Widget>> widgets = new ArrayList<>();
 
-	Object resourceResolver = RestResourceResolverSimple.class;
-	Object logger = RestLogger.Normal.class;
-	Object callHandler = RestCallHandler.class;
-	Object infoProvider = RestInfoProvider.class;
-
 	Class<?> resourceClass;
 
 	/**
@@ -146,7 +141,9 @@ public class RestContextBuilder extends BeanContextBuilder implements
ServletCon
 		this.inner = config;
 		this.resourceClass = resourceClass;
 		this.parentContext = parentContext;
-		this.resourceResolver = parentContext == null ? RestResourceResolverSimple.class : parentContext.getResourceResolver();
+		
+		logger(RestLogger.Normal.class);
+
 		try {
 
 			ConfigFileBuilder cfb = new ConfigFileBuilder();
@@ -705,40 +702,6 @@ public class RestContextBuilder extends BeanContextBuilder implements
ServletCon
 	}
 
 	/**
-	 * Overrides the default REST resource resolver.
-	 *
-	 * <p>
-	 * The resource resolver is used to resolve instances from {@link Class} objects defined
in the
-	 * {@link RestResource#children()} annotation.
-	 * The default value is {@link RestResourceResolverSimple}.
-	 *
-	 * <p>
-	 * This is the programmatic equivalent to the
-	 * {@link RestResource#resourceResolver() @RestResource.resourceResolver()} annotation.
-	 *
-	 * @param resourceResolver The new resource resolver.
-	 * @return This object (for method chaining).
-	 */
-	public RestContextBuilder resourceResolver(Class<? extends RestResourceResolver> resourceResolver)
{
-		this.resourceResolver = resourceResolver;
-		return this;
-	}
-
-	/**
-	 * Overrides the default REST resource resolver.
-	 *
-	 * <p>
-	 * Same as {@link #resourceResolver(Class)} except allows you to specify an instance instead
of a class.
-	 *
-	 * @param resourceResolver The new resource resolver.
-	 * @return This object (for method chaining).
-	 */
-	public RestContextBuilder resourceResolver(RestResourceResolver resourceResolver) {
-		this.resourceResolver = resourceResolver;
-		return this;
-	}
-
-	/**
 	 * Sets the URL path of the resource <js>"/foobar"</js>.
 	 *
 	 * <p>
@@ -779,110 +742,6 @@ public class RestContextBuilder extends BeanContextBuilder implements
ServletCon
 	}
 
 	/**
-	 * Overrides the logger for the resource.
-	 *
-	 * <p>
-	 * This is the programmatic equivalent to the {@link RestResource#logger() @RestResource.logger()}
annotation.
-	 *
-	 * @param logger The new logger for this resource.  Can be <jk>null</jk> to
disable logging.
-	 * @return This object (for method chaining).
-	 */
-	public RestContextBuilder logger(Class<? extends RestLogger> logger) {
-		this.logger = logger;
-		return this;
-	}
-
-	/**
-	 * Overrides the logger for the resource.
-	 *
-	 * <p>
-	 * This is the programmatic equivalent to the {@link RestResource#logger() @RestResource.logger()}
annotation.
-	 *
-	 * @param logger The new logger for this resource.  Can be <jk>null</jk> to
disable logging.
-	 * @return This object (for method chaining).
-	 */
-	public RestContextBuilder logger(RestLogger logger) {
-		this.logger = logger;
-		return this;
-	}
-
-	/**
-	 * Overrides the call handler for the resource.
-	 *
-	 * <p>
-	 * The call handler is the object that handles execution of REST HTTP calls.
-	 * Subclasses can be created that customize the behavior of how REST calls are handled.
-	 *
-	 * <p>
-	 * This is the programmatic equivalent to the {@link RestResource#callHandler() @RestResource.callHandler()}
-	 * annotation.
-	 *
-	 * @param restHandler The new call handler for this resource.
-	 * @return This object (for method chaining).
-	 */
-	public RestContextBuilder callHandler(Class<? extends RestCallHandler> restHandler)
{
-		this.callHandler = restHandler;
-		return this;
-	}
-
-	/**
-	 * Overrides the call handler for the resource.
-	 *
-	 * <p>
-	 * The call handler is the object that handles execution of REST HTTP calls.
-	 * Subclasses can be created that customize the behavior of how REST calls are handled.
-	 *
-	 * <p>
-	 * This is the programmatic equivalent to the {@link RestResource#callHandler() @RestResource.callHandler()}
-	 * annotation.
-	 *
-	 * @param restHandler The new call handler for this resource.
-	 * @return This object (for method chaining).
-	 */
-	public RestContextBuilder callHandler(RestCallHandler restHandler) {
-		this.callHandler = restHandler;
-		return this;
-	}
-
-	/**
-	 * Overrides the info provider for the resource.
-	 *
-	 * <p>
-	 * The info provider provides all the various information about a resource such as the Swagger
documentation.
-	 * Subclasses can be created that customize the information.
-	 *
-	 * <p>
-	 * This is the programmatic equivalent to the {@link RestResource#infoProvider() @RestResource.infoProvider()}
-	 * annotation.
-	 *
-	 * @param infoProvider The new info provider for this resource.
-	 * @return This object (for method chaining).
-	 */
-	public RestContextBuilder infoProvider(Class<? extends RestInfoProvider> infoProvider)
{
-		this.infoProvider = infoProvider;
-		return this;
-	}
-
-	/**
-	 * Overrides the info provider for the resource.
-	 *
-	 * <p>
-	 * The info provider provides all the various information about a resource such as the Swagger
documentation.
-	 * Subclasses can be created that customize the information.
-	 *
-	 * <p>
-	 * This is the programmatic equivalent to the {@link RestResource#infoProvider() @RestResource.infoProvider()}
-	 * annotation.
-	 *
-	 * @param infoProvider The new info provider for this resource.
-	 * @return This object (for method chaining).
-	 */
-	public RestContextBuilder infoProvider(RestInfoProvider infoProvider) {
-		this.infoProvider = infoProvider;
-		return this;
-	}
-
-	/**
 	 * Creates a new {@link PropertyStore} object initialized with the properties defined in
this config.
 	 *
 	 * @return A new property store.
@@ -1661,11 +1520,210 @@ public class RestContextBuilder extends BeanContextBuilder implements
ServletCon
 	}
 
 	/**
+	 * REST resource resolver.
+	 * 
+	 * <p>
+	 * The resolver used for resolving child resources.
+	 * 
+	 * <p>
+	 * Can be used to provide customized resolution of REST resource class instances (e.g. resources
retrieve from Spring).
+	 *
+	 * <p>
+	 * <h5 class='section'>Notes:</h5>
+	 * <ul class='spaced-list'>
+	 * 	<li>Property: {@link RestContext#REST_resourceResolver}
+	 * 	<li>Annotation:  {@link RestResource#resourceResolver()} 
+	 * 	<li>Method: {@link RestContextBuilder#resourceResolver(Class)} / {@link RestContextBuilder#resourceResolver(RestResourceResolver)}
+	 * 	<li>Unless overridden, resource resolvers are inherited from parent resources.
+	 *	</ul>
+	 *
+	 * @param resourceResolver The new resource resolver.
+	 * @return This object (for method chaining).
+	 */
+	public RestContextBuilder resourceResolver(Class<? extends RestResourceResolver> resourceResolver)
{
+		return set(REST_resourceResolver, resourceResolver);
+	}
+
+	/**
+	 * REST resource resolver.
+	 * 
+	 * <p>
+	 * The resolver used for resolving child resources.
+	 * 
+	 * <p>
+	 * Can be used to provide customized resolution of REST resource class instances (e.g. resources
retrieve from Spring).
+	 *
+	 * <p>
+	 * <h5 class='section'>Notes:</h5>
+	 * <ul class='spaced-list'>
+	 * 	<li>Property: {@link RestContext#REST_resourceResolver}
+	 * 	<li>Annotation:  {@link RestResource#resourceResolver()} 
+	 * 	<li>Method: {@link RestContextBuilder#resourceResolver(Class)} / {@link RestContextBuilder#resourceResolver(RestResourceResolver)}
+	 * 	<li>Unless overridden, resource resolvers are inherited from parent resources.
+	 *	</ul>
+	 *
+	 * @param resourceResolver The new resource resolver.
+	 * @return This object (for method chaining).
+	 */
+	public RestContextBuilder resourceResolver(RestResourceResolver resourceResolver) {
+		return set(REST_resourceResolver, resourceResolver);
+	}
+
+	/**
+	 * <b>Configuration property:</b>  REST logger.
+	 * 
+	 * <p>
+	 * Specifies the logger to use for logging.
+	 *
+	 * <p>
+	 * The default logger performs basic error logging to the Java logger.
+	 * <br>Subclasses can be used to customize logging behavior on the resource.
+	 * 
+	 * <p>
+	 * <h5 class='section'>Notes:</h5>
+	 * <ul class='spaced-list'>
+	 * 	<li>Property: {@link RestContext#REST_logger}
+	 * 	<li>Annotation:  {@link RestResource#logger()} 
+	 * 	<li>Method: {@link RestContextBuilder#logger(Class)} / {@link RestContextBuilder#logger(RestLogger)}

+	 *	</ul>
+	 *
+	 * @param logger The new logger for this resource.  Can be <jk>null</jk> to
disable logging.
+	 * @return This object (for method chaining).
+	 */
+	public RestContextBuilder logger(Class<? extends RestLogger> logger) {
+		return set(REST_logger, logger);
+	}
+
+	/**
+	 * <b>Configuration property:</b>  REST logger.
+	 * 
+	 * <p>
+	 * Specifies the logger to use for logging.
+	 *
+	 * <p>
+	 * The default logger performs basic error logging to the Java logger.
+	 * <br>Subclasses can be used to customize logging behavior on the resource.
+	 *
+	 * <p>
+	 * <h5 class='section'>Notes:</h5>
+	 * <ul class='spaced-list'>
+	 * 	<li>Property: {@link RestContext#REST_logger}
+	 * 	<li>Annotation:  {@link RestResource#logger()} 
+	 * 	<li>Method: {@link RestContextBuilder#logger(Class)} / {@link RestContextBuilder#logger(RestLogger)}

+	 *	</ul>
+	 *
+	 * @param logger The new logger for this resource.  Can be <jk>null</jk> to
disable logging.
+	 * @return This object (for method chaining).
+	 */
+	public RestContextBuilder logger(RestLogger logger) {
+		return set(REST_logger, logger);
+	}
+
+	/**
+	 * <b>Configuration property:</b>  REST call handler.
+	 *
+	 * <p>
+	 * This class handles the basic lifecycle of an HTTP REST call.
+	 * <br>Subclasses can be used to customize how these HTTP calls are handled.
+
+	 * <p>
+	 * <h5 class='section'>Notes:</h5>
+	 * <ul class='spaced-list'>
+	 * 	<li>Property: {@link RestContext#REST_callHandler}
+	 * 	<li>Annotation:  {@link RestResource#callHandler()} 
+	 * 	<li>Method: {@link RestContextBuilder#callHandler(Class)} / {@link RestContextBuilder#callHandler(RestCallHandler)}

+	 *	</ul>
+	 *
+	 * @param restHandler The new call handler for this resource.
+	 * @return This object (for method chaining).
+	 */
+	public RestContextBuilder callHandler(Class<? extends RestCallHandler> restHandler)
{
+		return set(REST_callHandler, restHandler);
+	}
+
+	/**
+	 * <b>Configuration property:</b>  REST call handler.
+	 *
+	 * <p>
+	 * This class handles the basic lifecycle of an HTTP REST call.
+	 * <br>Subclasses can be used to customize how these HTTP calls are handled.
+	 * 
+	 * <p>
+	 * <h5 class='section'>Notes:</h5>
+	 * <ul class='spaced-list'>
+	 * 	<li>Property: {@link RestContext#REST_callHandler}
+	 * 	<li>Annotation:  {@link RestResource#callHandler()} 
+	 * 	<li>Method: {@link RestContextBuilder#callHandler(Class)} / {@link RestContextBuilder#callHandler(RestCallHandler)}

+	 *	</ul>
+	 *
+	 * @param restHandler The new call handler for this resource.
+	 * @return This object (for method chaining).
+	 */
+	public RestContextBuilder callHandler(RestCallHandler restHandler) {
+		return set(REST_callHandler, restHandler);
+	}
+
+	/**
+	 * <b>Configuration property:</b>  REST info provider. 
+	 *
+	 * <p>
+	 * Class used to retrieve title/description/swagger information about a resource.
+	 *
+	 * <p>
+	 * Subclasses can be used to customize the documentation on a resource.
+	 *
+	 * <p>
+	 * <h5 class='section'>Notes:</h5>
+	 * <ul class='spaced-list'>
+	 * 	<li>Property: {@link RestContext#REST_infoProvider}
+	 * 	<li>Annotation:  {@link RestResource#infoProvider()} 
+	 * 	<li>Method: {@link RestContextBuilder#infoProvider(Class)} / {@link RestContextBuilder#infoProvider(RestInfoProvider)}

+	 *	</ul>
+	 *
+	 * @param infoProvider The new info provider for this resource.
+	 * @return This object (for method chaining).
+	 */
+	public RestContextBuilder infoProvider(Class<? extends RestInfoProvider> infoProvider)
{
+		return set(REST_infoProvider, infoProvider);
+	}
+
+	/**
+	 * <b>Configuration property:</b>  REST info provider. 
+	 *
+	 * <p>
+	 * Class used to retrieve title/description/swagger information about a resource.
+	 *
+	 * <p>
+	 * Subclasses can be used to customize the documentation on a resource.
+	 *
+	 * <p>
+	 * <h5 class='section'>Notes:</h5>
+	 * <ul class='spaced-list'>
+	 * 	<li>Property: {@link RestContext#REST_infoProvider}
+	 * 	<li>Annotation:  {@link RestResource#infoProvider()} 
+	 * 	<li>Method: {@link RestContextBuilder#infoProvider(Class)} / {@link RestContextBuilder#infoProvider(RestInfoProvider)}

+	 *	</ul>
+	 *
+	 * @param infoProvider The new info provider for this resource.
+	 * @return This object (for method chaining).
+	 */
+	public RestContextBuilder infoProvider(RestInfoProvider infoProvider) {
+		return set(REST_infoProvider, infoProvider);
+	}
+
+	/**
+	 * <b>Configuration property:</b>  Serializer listener.
+	 * 
+	 * <p>
 	 * Specifies the serializer listener class to use for listening to non-fatal serialization
errors.
 	 *
 	 * <p>
-	 * This is the programmatic equivalent to the
-	 * {@link RestResource#serializerListener() @RestResource.serializerListener()} annotation.
+	 * <h5 class='section'>Notes:</h5>
+	 * <ul class='spaced-list'>
+	 * 	<li>Property: {@link Serializer#SERIALIZER_listener}
+	 * 	<li>Annotation:  {@link RestResource#serializerListener()} 
+	 * 	<li>Method: {@link RestContextBuilder#serializerListener(Class)} 
+	 *	</ul>
 	 *
 	 * @param listener The listener to add to this config.
 	 * @return This object (for method chaining).
@@ -1677,11 +1735,18 @@ public class RestContextBuilder extends BeanContextBuilder implements
ServletCon
 	}
 
 	/**
-	 * Specifies the parser listener class to use for listening to non-fatal parse errors.
+	 * <b>Configuration property:</b>  Parser listener.
+	 * 
+	 * <p>
+	 * Specifies the parser listener class to use for listening to non-fatal parsing errors.
 	 *
 	 * <p>
-	 * This is the programmatic equivalent to the
-	 * {@link RestResource#parserListener() @RestResource.parserListener()} annotation.
+	 * <h5 class='section'>Notes:</h5>
+	 * <ul class='spaced-list'>
+	 * 	<li>Property: {@link Parser#PARSER_listener}
+	 * 	<li>Annotation:  {@link RestResource#parserListener()} 
+	 * 	<li>Method: {@link RestContextBuilder#parserListener(Class)} 
+	 *	</ul>
 	 *
 	 * @param listener The listener to add to this config.
 	 * @return This object (for method chaining).

http://git-wip-us.apache.org/repos/asf/juneau/blob/c36b16d7/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestResourceResolver.java
----------------------------------------------------------------------
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestResourceResolver.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestResourceResolver.java
index 467fb05..aef11de 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestResourceResolver.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestResourceResolver.java
@@ -28,10 +28,12 @@ import org.apache.juneau.rest.annotation.*;
  * 	<li>{@link RestContextBuilder#resourceResolver(Class)}/{@link RestContextBuilder#resourceResolver(RestResourceResolver)}
  * 		methods.
  * </ul>
- *
- * <p>
- * An instance of this class can also be passed in through the servlet context as the context
attribute
- * {@link RestResource#resourceResolver()}.
+ * 
+ * Implementations must provide one of the following public constructors:
+ * <ul>
+ * 	<li>RestResourceResolver()
+ * 	<li>RestResourceResolver(RestContext)
+ * </ul>
  */
 public interface RestResourceResolver {
 

http://git-wip-us.apache.org/repos/asf/juneau/blob/c36b16d7/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestResourceResolverSimple.java
----------------------------------------------------------------------
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestResourceResolverSimple.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestResourceResolverSimple.java
index bb96a19..eda2fe2 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestResourceResolverSimple.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/RestResourceResolverSimple.java
@@ -19,10 +19,9 @@ import java.lang.reflect.*;
 /**
  * Denotes the default resolver.
  *
- * <p>
  * The default implementation simply instantiates the class using one of the following constructors:
  * <ul>
- * 	<li><code><jk>public</jk> T(RestConfig)</code>
+ * 	<li><code><jk>public</jk> T(RestContextBuilder)</code>
  * 	<li><code><jk>public</jk> T()</code>
  * </ul>
  *
@@ -32,11 +31,10 @@ import java.lang.reflect.*;
  * full initialization.
  *
  * <p>
- * Non-<code>RestServlet</code> classes can also add the following two methods
to get access to the
- * {@link RestContextBuilder} and {@link RestContext} objects:
+ * Non-<code>RestServlet</code> classes can also add the following method to
get access to the {@link RestContextBuilder} 
+ * object:
  * <ul>
- * 	<li><code><jk>public void</jk> init(RestConfig);</code>
- * 	<li><code><jk>public void</jk> init(RestContext);</code>
+ * 	<li><code><jk>public void</jk> init(RestContextBuilder);</code>
  * </ul>
  *
  */

http://git-wip-us.apache.org/repos/asf/juneau/blob/c36b16d7/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestResource.java
----------------------------------------------------------------------
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestResource.java
b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestResource.java
index b16ea05..a0d95c5 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestResource.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/annotation/RestResource.java
@@ -601,84 +601,110 @@ public @interface RestResource {
 	String clientVersionHeader() default "";
 
 	/**
-	 * Specifies the resolver class to use for resolving child resources by class name.
-	 *
-	 * <p>
-	 * The default implementation simply instantiates the class using one of the following constructors:
-	 * <ul>
-	 * 	<li><code><jk>public</jk> T(RestConfig)</code>
-	 * 	<li><code><jk>public</jk> T()</code>
-	 * </ul>
-	 *
-	 * <p>
-	 * The former constructor can be used to get access to the {@link RestContextBuilder} object
to get access to the config
-	 * file and initialization information or make programmatic modifications to the resource
before full initialization.
-	 *
-	 * <p>
-	 * Non-<code>RestServlet</code> classes can also add the following two methods
to get access to the
-	 * {@link RestContextBuilder} and {@link RestContext} objects:
-	 * <ul>
-	 * 	<li><code><jk>public void</jk> init(RestConfig);</code>
-	 * 	<li><code><jk>public void</jk> init(RestContext);</code>
-	 * </ul>
-	 *
+	 * REST resource resolver.
+	 * 
 	 * <p>
-	 * Subclasses can be used to provide customized resolution of REST resource class instances.
-	 *
+	 * The resolver used for resolving child resources.
+	 * 
 	 * <p>
-	 * If not specified on a child resource, the resource resolver is inherited from the parent
resource context.
+	 * Can be used to provide customized resolution of REST resource class instances (e.g. resources
retrieve from Spring).
 	 *
 	 * <p>
-	 * The programmatic equivalent to this annotation are the {@link RestContextBuilder#resourceResolver(Class)}/
-	 * {@link RestContextBuilder#resourceResolver(RestResourceResolver)} methods.
+	 * <h5 class='section'>Notes:</h5>
+	 * <ul class='spaced-list'>
+	 * 	<li>Property: {@link RestContext#REST_resourceResolver}
+	 * 	<li>Annotation:  {@link RestResource#resourceResolver()} 
+	 * 	<li>Method: {@link RestContextBuilder#resourceResolver(Class)} / {@link RestContextBuilder#resourceResolver(RestResourceResolver)}
+	 * 	<li>Unless overridden, resource resolvers are inherited from parent resources.
+	 *	</ul>
 	 */
 	Class<? extends RestResourceResolver> resourceResolver() default RestResourceResolverSimple.class;
 
 	/**
-	 * Specifies the logger class to use for logging.
-	 *
+	 * REST logger.
+	 * 
 	 * <p>
-	 * The default logger performs basic error logging to the Java logger.
-	 * Subclasses can be used to customize logging behavior on the resource.
+	 * Specifies the logger to use for logging.
 	 *
 	 * <p>
-	 * The programmatic equivalent to this annotation are the
-	 * {@link RestContextBuilder#logger(Class)}/{@link RestContextBuilder#logger(RestLogger)}
methods.
+	 * <h5 class='section'>Notes:</h5>
+	 * <ul class='spaced-list'>
+	 * 	<li>Property: {@link RestContext#REST_logger}
+	 * 	<li>Annotation:  {@link RestResource#logger()} 
+	 * 	<li>Method: {@link RestContextBuilder#logger(Class)} / {@link RestContextBuilder#logger(RestLogger)}

+	 * 	<li>The {@link org.apache.juneau.rest.RestLogger.Normal} logger can be used to
provide basic error logging to the Java logger.
+	 *	</ul>
 	 */
 	Class<? extends RestLogger> logger() default RestLogger.Normal.class;
 
 	/**
-	 * Specifies the REST call handler class.
+	 * REST call handler.
 	 *
 	 * <p>
 	 * This class handles the basic lifecycle of an HTTP REST call.
-	 * Subclasses can be used to customize how these HTTP calls are handled.
-	 *
+	 * <br>Subclasses can be used to customize how these HTTP calls are handled.
+
 	 * <p>
-	 * The programmatic equivalent to this annotation are the
-	 * {@link RestContextBuilder#callHandler(Class)}/{@link RestContextBuilder#callHandler(RestCallHandler)}
methods.
+	 * <h5 class='section'>Notes:</h5>
+	 * <ul class='spaced-list'>
+	 * 	<li>Property: {@link RestContext#REST_callHandler}
+	 * 	<li>Annotation:  {@link RestResource#callHandler()} 
+	 * 	<li>Method: {@link RestContextBuilder#callHandler(Class)} / {@link RestContextBuilder#callHandler(RestCallHandler)}

+	 *	</ul>
 	 */
 	Class<? extends RestCallHandler> callHandler() default RestCallHandler.class;
 
 	/**
-	 * Specifies the class used to retrieve title/description/swagger information about a resource.
+	 * <b>Configuration property:</b>  REST info provider. 
+	 * 
+	 * <p>
+	 * Class used to retrieve title/description/swagger information about a resource.
 	 *
 	 * <p>
 	 * Subclasses can be used to customize the documentation on a resource.
 	 *
 	 * <p>
-	 * The programmatic equivalent to this annotation are the
-	 * {@link RestContextBuilder#infoProvider(Class)}/{@link RestContextBuilder#infoProvider(RestInfoProvider)}
methods.
+	 * <h5 class='section'>Notes:</h5>
+	 * <ul class='spaced-list'>
+	 * 	<li>Property: {@link RestContext#REST_infoProvider}
+	 * 	<li>Annotation:  {@link RestResource#infoProvider()} 
+	 * 	<li>Method: {@link RestContextBuilder#infoProvider(Class)} / {@link RestContextBuilder#infoProvider(RestInfoProvider)}

+	 *	</ul>
 	 */
 	Class<? extends RestInfoProvider> infoProvider() default RestInfoProvider.class;
 
 	/**
-	 * Specifies the serializer listener class to use for listening for non-fatal errors.
+	 * Serializer listener.
+	 * 
+	 * <p>
+	 * Specifies the serializer listener class to use for listening to non-fatal serialization
errors.
+	 *
+	 * <p>
+	 * <h5 class='section'>Notes:</h5>
+	 * <ul class='spaced-list'>
+	 * 	<li>Property: {@link Serializer#SERIALIZER_listener}
+	 * 	<li>Annotation:  {@link RestResource#serializerListener()} 
+	 * 	<li>Method: {@link RestContextBuilder#serializerListener(Class)} 
+	 *	</ul>
 	 */
 	Class<? extends SerializerListener> serializerListener() default SerializerListener.Null.class;
 
 	/**
-	 * Specifies the parser listener class to use for listening for non-fatal errors.
+	 * Parser listener.
+	 * 
+	 * <p>
+	 * Specifies the parser listener class to use for listening to non-fatal parsing errors.
+	 *
+	 * <p>
+	 * <h5 class='section'>Notes:</h5>
+	 * <ul class='spaced-list'>
+	 * 	<li>Property: {@link Parser#PARSER_listener}
+	 * 	<li>Annotation:  {@link RestResource#parserListener()} 
+	 * 	<li>Method: {@link RestContextBuilder#parserListener(Class)} 
+	 *	</ul>
+	 *
+	 * @param listener The listener to add to this config.
+	 * @return This object (for method chaining).
 	 */
 	Class<? extends ParserListener> parserListener() default ParserListener.Null.class;
 


Mime
View raw message