juneau-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamesbog...@apache.org
Subject [08/51] [partial] incubator-juneau-website git commit: Javadoc updates.
Date Sat, 01 Apr 2017 23:57:56 GMT
http://git-wip-us.apache.org/repos/asf/incubator-juneau-website/blob/5aed2f48/content/site/apidocs/src-html/org/apache/juneau/rest/RestContext.html
----------------------------------------------------------------------
diff --git a/content/site/apidocs/src-html/org/apache/juneau/rest/RestContext.html b/content/site/apidocs/src-html/org/apache/juneau/rest/RestContext.html
index fe2e718..d1723e2 100644
--- a/content/site/apidocs/src-html/org/apache/juneau/rest/RestContext.html
+++ b/content/site/apidocs/src-html/org/apache/juneau/rest/RestContext.html
@@ -285,1208 +285,1244 @@
 <span class="sourceLineNo">277</span>    */<a name="line.277"></a>
 <span class="sourceLineNo">278</span>   public static final String REST_methodDescription = "RestServlet.methodDescription";<a name="line.278"></a>
 <span class="sourceLineNo">279</span><a name="line.279"></a>
-<span class="sourceLineNo">280</span>   private final Object resource;<a name="line.280"></a>
-<span class="sourceLineNo">281</span>   private final RestConfig config;<a name="line.281"></a>
-<span class="sourceLineNo">282</span>   private final boolean<a name="line.282"></a>
-<span class="sourceLineNo">283</span>      allowHeaderParams,<a name="line.283"></a>
-<span class="sourceLineNo">284</span>      allowBodyParam,<a name="line.284"></a>
-<span class="sourceLineNo">285</span>      renderResponseStackTraces,<a name="line.285"></a>
-<span class="sourceLineNo">286</span>      useStackTraceHashes;<a name="line.286"></a>
-<span class="sourceLineNo">287</span>   private final String<a name="line.287"></a>
-<span class="sourceLineNo">288</span>      defaultCharset,<a name="line.288"></a>
-<span class="sourceLineNo">289</span>      paramFormat,<a name="line.289"></a>
-<span class="sourceLineNo">290</span>      clientVersionHeader,<a name="line.290"></a>
-<span class="sourceLineNo">291</span>      fullPath;<a name="line.291"></a>
-<span class="sourceLineNo">292</span>   private final Set&lt;String&gt; allowMethodParams;<a name="line.292"></a>
-<span class="sourceLineNo">293</span><a name="line.293"></a>
-<span class="sourceLineNo">294</span>   private final ObjectMap properties;<a name="line.294"></a>
-<span class="sourceLineNo">295</span>   private final Class&lt;?&gt;[]<a name="line.295"></a>
-<span class="sourceLineNo">296</span>      beanFilters,<a name="line.296"></a>
-<span class="sourceLineNo">297</span>      pojoSwaps;<a name="line.297"></a>
-<span class="sourceLineNo">298</span>   private final SerializerGroup serializers;<a name="line.298"></a>
-<span class="sourceLineNo">299</span>   private final ParserGroup parsers;<a name="line.299"></a>
-<span class="sourceLineNo">300</span>   private final UrlEncodingSerializer urlEncodingSerializer;<a name="line.300"></a>
-<span class="sourceLineNo">301</span>   private final UrlEncodingParser urlEncodingParser;<a name="line.301"></a>
-<span class="sourceLineNo">302</span>   private final EncoderGroup encoders;<a name="line.302"></a>
-<span class="sourceLineNo">303</span>   private final MediaType[]<a name="line.303"></a>
-<span class="sourceLineNo">304</span>      supportedContentTypes,<a name="line.304"></a>
-<span class="sourceLineNo">305</span>      supportedAcceptTypes;<a name="line.305"></a>
-<span class="sourceLineNo">306</span>   private final Map&lt;String,String&gt; defaultRequestHeaders;<a name="line.306"></a>
-<span class="sourceLineNo">307</span>   private final Map&lt;String,Object&gt; defaultResponseHeaders;<a name="line.307"></a>
-<span class="sourceLineNo">308</span>   private final BeanContext beanContext;<a name="line.308"></a>
-<span class="sourceLineNo">309</span>   private final RestConverter[] converters;<a name="line.309"></a>
-<span class="sourceLineNo">310</span>   private final RestGuard[] guards;<a name="line.310"></a>
-<span class="sourceLineNo">311</span>   private final ResponseHandler[] responseHandlers;<a name="line.311"></a>
-<span class="sourceLineNo">312</span>   private final MimetypesFileTypeMap mimetypesFileTypeMap;<a name="line.312"></a>
-<span class="sourceLineNo">313</span>   private final StreamResource styleSheet, favIcon;<a name="line.313"></a>
-<span class="sourceLineNo">314</span>   private final Map&lt;String,String&gt; staticFilesMap;<a name="line.314"></a>
-<span class="sourceLineNo">315</span>   private final String[] staticFilesPrefixes;<a name="line.315"></a>
-<span class="sourceLineNo">316</span>   private final MessageBundle msgs;<a name="line.316"></a>
-<span class="sourceLineNo">317</span>   private final ConfigFile configFile;<a name="line.317"></a>
-<span class="sourceLineNo">318</span>   private final VarResolver varResolver;<a name="line.318"></a>
-<span class="sourceLineNo">319</span>   private final Map&lt;String,CallRouter&gt; callRouters;<a name="line.319"></a>
-<span class="sourceLineNo">320</span>   private final Map&lt;String,CallMethod&gt; callMethods;<a name="line.320"></a>
-<span class="sourceLineNo">321</span>   private final Map&lt;String,RestContext&gt; childResources;<a name="line.321"></a>
-<span class="sourceLineNo">322</span>   private final RestLogger logger;<a name="line.322"></a>
-<span class="sourceLineNo">323</span>   private final RestCallHandler callHandler;<a name="line.323"></a>
-<span class="sourceLineNo">324</span>   private final RestInfoProvider infoProvider;<a name="line.324"></a>
-<span class="sourceLineNo">325</span>   private final RestException initException;<a name="line.325"></a>
-<span class="sourceLineNo">326</span><a name="line.326"></a>
-<span class="sourceLineNo">327</span>   // In-memory cache of images and stylesheets in the org.apache.juneau.rest.htdocs package.<a name="line.327"></a>
-<span class="sourceLineNo">328</span>   private final Map&lt;String,StreamResource&gt; staticFilesCache = new ConcurrentHashMap&lt;String,StreamResource&gt;();<a name="line.328"></a>
-<span class="sourceLineNo">329</span>   private final Map&lt;String,byte[]&gt; resourceStreams = new ConcurrentHashMap&lt;String,byte[]&gt;();<a name="line.329"></a>
-<span class="sourceLineNo">330</span>   private final Map&lt;String,String&gt; resourceStrings = new ConcurrentHashMap&lt;String,String&gt;();<a name="line.330"></a>
-<span class="sourceLineNo">331</span>   private final ConcurrentHashMap&lt;Integer,AtomicInteger&gt; stackTraceHashes = new ConcurrentHashMap&lt;Integer,AtomicInteger&gt;();<a name="line.331"></a>
-<span class="sourceLineNo">332</span><a name="line.332"></a>
-<span class="sourceLineNo">333</span><a name="line.333"></a>
-<span class="sourceLineNo">334</span>   /**<a name="line.334"></a>
-<span class="sourceLineNo">335</span>    * Constructor.<a name="line.335"></a>
-<span class="sourceLineNo">336</span>    *<a name="line.336"></a>
-<span class="sourceLineNo">337</span>    * @param resource The resource class (a class annotated with {@link RestResource @RestResource}).<a name="line.337"></a>
-<span class="sourceLineNo">338</span>    * @param config The servlet configuration object.<a name="line.338"></a>
-<span class="sourceLineNo">339</span>    * @throws Exception If any initialization problems were encountered.<a name="line.339"></a>
-<span class="sourceLineNo">340</span>    */<a name="line.340"></a>
-<span class="sourceLineNo">341</span>   @SuppressWarnings("unchecked")<a name="line.341"></a>
-<span class="sourceLineNo">342</span>   public RestContext(Object resource, RestConfig config) throws Exception {<a name="line.342"></a>
-<span class="sourceLineNo">343</span>      super(null);<a name="line.343"></a>
-<span class="sourceLineNo">344</span>      RestException _initException = null;<a name="line.344"></a>
-<span class="sourceLineNo">345</span>      try {<a name="line.345"></a>
-<span class="sourceLineNo">346</span>         this.resource = resource;<a name="line.346"></a>
-<span class="sourceLineNo">347</span>         this.config = config;<a name="line.347"></a>
-<span class="sourceLineNo">348</span><a name="line.348"></a>
-<span class="sourceLineNo">349</span>         Builder b = new Builder(resource, config);<a name="line.349"></a>
-<span class="sourceLineNo">350</span>         this.allowHeaderParams = b.allowHeaderParams;<a name="line.350"></a>
-<span class="sourceLineNo">351</span>         this.allowBodyParam = b.allowBodyParam;<a name="line.351"></a>
-<span class="sourceLineNo">352</span>         this.renderResponseStackTraces = b.renderResponseStackTraces;<a name="line.352"></a>
-<span class="sourceLineNo">353</span>         this.useStackTraceHashes = b.useStackTraceHashes;<a name="line.353"></a>
-<span class="sourceLineNo">354</span>         this.allowMethodParams = Collections.unmodifiableSet(b.allowMethodParams);<a name="line.354"></a>
-<span class="sourceLineNo">355</span>         this.defaultCharset = b.defaultCharset;<a name="line.355"></a>
-<span class="sourceLineNo">356</span>         this.paramFormat = b.paramFormat;<a name="line.356"></a>
-<span class="sourceLineNo">357</span>         this.varResolver = b.varResolver;<a name="line.357"></a>
-<span class="sourceLineNo">358</span>         this.configFile = b.configFile;<a name="line.358"></a>
-<span class="sourceLineNo">359</span>         this.properties = b.properties;<a name="line.359"></a>
-<span class="sourceLineNo">360</span>         this.beanFilters = b.beanFilters;<a name="line.360"></a>
-<span class="sourceLineNo">361</span>         this.pojoSwaps = b.pojoSwaps;<a name="line.361"></a>
-<span class="sourceLineNo">362</span>         this.serializers = b.serializers;<a name="line.362"></a>
-<span class="sourceLineNo">363</span>         this.parsers = b.parsers;<a name="line.363"></a>
-<span class="sourceLineNo">364</span>         this.urlEncodingSerializer = b.urlEncodingSerializer;<a name="line.364"></a>
-<span class="sourceLineNo">365</span>         this.urlEncodingParser = b.urlEncodingParser;<a name="line.365"></a>
-<span class="sourceLineNo">366</span>         this.encoders = b.encoders;<a name="line.366"></a>
-<span class="sourceLineNo">367</span>         this.supportedContentTypes = ArrayUtils.toObjectArray(b.supportedContentTypes, MediaType.class);<a name="line.367"></a>
-<span class="sourceLineNo">368</span>         this.supportedAcceptTypes = ArrayUtils.toObjectArray(b.supportedAcceptTypes, MediaType.class);<a name="line.368"></a>
-<span class="sourceLineNo">369</span>         this.clientVersionHeader = b.clientVersionHeader;<a name="line.369"></a>
-<span class="sourceLineNo">370</span>         this.defaultRequestHeaders = Collections.unmodifiableMap(b.defaultRequestHeaders);<a name="line.370"></a>
-<span class="sourceLineNo">371</span>         this.defaultResponseHeaders = Collections.unmodifiableMap(b.defaultResponseHeaders);<a name="line.371"></a>
-<span class="sourceLineNo">372</span>         this.beanContext = b.beanContext;<a name="line.372"></a>
-<span class="sourceLineNo">373</span>         this.converters = b.converters.toArray(new RestConverter[b.converters.size()]);<a name="line.373"></a>
-<span class="sourceLineNo">374</span>         this.guards = b.guards.toArray(new RestGuard[b.guards.size()]);<a name="line.374"></a>
-<span class="sourceLineNo">375</span>         this.responseHandlers = ArrayUtils.toObjectArray(b.responseHandlers, ResponseHandler.class);<a name="line.375"></a>
-<span class="sourceLineNo">376</span>         this.mimetypesFileTypeMap = b.mimetypesFileTypeMap;<a name="line.376"></a>
-<span class="sourceLineNo">377</span>         this.styleSheet = b.styleSheet;<a name="line.377"></a>
-<span class="sourceLineNo">378</span>         this.favIcon = b.favIcon;<a name="line.378"></a>
-<span class="sourceLineNo">379</span>         this.staticFilesMap = Collections.unmodifiableMap(b.staticFilesMap);<a name="line.379"></a>
-<span class="sourceLineNo">380</span>         this.staticFilesPrefixes = b.staticFilesPrefixes;<a name="line.380"></a>
-<span class="sourceLineNo">381</span>         this.msgs = b.messageBundle;<a name="line.381"></a>
-<span class="sourceLineNo">382</span>         this.childResources = Collections.synchronizedMap(new LinkedHashMap&lt;String,RestContext&gt;());  // Not unmodifiable on purpose so that children can be replaced.<a name="line.382"></a>
-<span class="sourceLineNo">383</span>         this.logger = b.logger;<a name="line.383"></a>
-<span class="sourceLineNo">384</span>         this.fullPath = b.fullPath;<a name="line.384"></a>
-<span class="sourceLineNo">385</span><a name="line.385"></a>
-<span class="sourceLineNo">386</span>         //----------------------------------------------------------------------------------------------------<a name="line.386"></a>
-<span class="sourceLineNo">387</span>         // Initialize the child resources.<a name="line.387"></a>
-<span class="sourceLineNo">388</span>         // Done after initializing fields above since we pass this object to the child resources.<a name="line.388"></a>
-<span class="sourceLineNo">389</span>         //----------------------------------------------------------------------------------------------------<a name="line.389"></a>
-<span class="sourceLineNo">390</span>         List&lt;String&gt; methodsFound = new LinkedList&lt;String&gt;();   // Temporary to help debug transient duplicate method issue.<a name="line.390"></a>
-<span class="sourceLineNo">391</span>         Map&lt;String,CallRouter.Builder&gt; routers = new LinkedHashMap&lt;String,CallRouter.Builder&gt;();<a name="line.391"></a>
-<span class="sourceLineNo">392</span>         Map&lt;String,CallMethod&gt; _javaRestMethods = new LinkedHashMap&lt;String,CallMethod&gt;();<a name="line.392"></a>
-<span class="sourceLineNo">393</span>         for (java.lang.reflect.Method method : resource.getClass().getMethods()) {<a name="line.393"></a>
-<span class="sourceLineNo">394</span>            if (method.isAnnotationPresent(RestMethod.class)) {<a name="line.394"></a>
-<span class="sourceLineNo">395</span>               RestMethod a = method.getAnnotation(RestMethod.class);<a name="line.395"></a>
-<span class="sourceLineNo">396</span>               methodsFound.add(method.getName() + "," + a.name() + "," + a.path());<a name="line.396"></a>
-<span class="sourceLineNo">397</span>               try {<a name="line.397"></a>
-<span class="sourceLineNo">398</span>                  if (! Modifier.isPublic(method.getModifiers()))<a name="line.398"></a>
-<span class="sourceLineNo">399</span>                     throw new RestServletException("@RestMethod method {0}.{1} must be defined as public.", this.getClass().getName(), method.getName());<a name="line.399"></a>
-<span class="sourceLineNo">400</span><a name="line.400"></a>
-<span class="sourceLineNo">401</span>                  CallMethod sm = new CallMethod(resource, method, this);<a name="line.401"></a>
-<span class="sourceLineNo">402</span>                  String httpMethod = sm.getHttpMethod();<a name="line.402"></a>
-<span class="sourceLineNo">403</span><a name="line.403"></a>
-<span class="sourceLineNo">404</span>                  // PROXY is a special case where a method returns an interface that we<a name="line.404"></a>
-<span class="sourceLineNo">405</span>                  // can perform REST calls against.<a name="line.405"></a>
-<span class="sourceLineNo">406</span>                  // We override the CallMethod.invoke() method to insert our logic.<a name="line.406"></a>
-<span class="sourceLineNo">407</span>                  if ("PROXY".equals(httpMethod)) {<a name="line.407"></a>
+<span class="sourceLineNo">280</span><a name="line.280"></a>
+<span class="sourceLineNo">281</span>   private final Object resource;<a name="line.281"></a>
+<span class="sourceLineNo">282</span>   private final RestConfig config;<a name="line.282"></a>
+<span class="sourceLineNo">283</span>   private final boolean<a name="line.283"></a>
+<span class="sourceLineNo">284</span>      allowHeaderParams,<a name="line.284"></a>
+<span class="sourceLineNo">285</span>      allowBodyParam,<a name="line.285"></a>
+<span class="sourceLineNo">286</span>      renderResponseStackTraces,<a name="line.286"></a>
+<span class="sourceLineNo">287</span>      useStackTraceHashes;<a name="line.287"></a>
+<span class="sourceLineNo">288</span>   private final String<a name="line.288"></a>
+<span class="sourceLineNo">289</span>      defaultCharset,<a name="line.289"></a>
+<span class="sourceLineNo">290</span>      paramFormat,<a name="line.290"></a>
+<span class="sourceLineNo">291</span>      clientVersionHeader,<a name="line.291"></a>
+<span class="sourceLineNo">292</span>      fullPath,<a name="line.292"></a>
+<span class="sourceLineNo">293</span>      pageTitle, pageText, pageLinks;<a name="line.293"></a>
+<span class="sourceLineNo">294</span>   private final Set&lt;String&gt; allowMethodParams;<a name="line.294"></a>
+<span class="sourceLineNo">295</span><a name="line.295"></a>
+<span class="sourceLineNo">296</span>   private final ObjectMap properties;<a name="line.296"></a>
+<span class="sourceLineNo">297</span>   private final Class&lt;?&gt;[]<a name="line.297"></a>
+<span class="sourceLineNo">298</span>      beanFilters,<a name="line.298"></a>
+<span class="sourceLineNo">299</span>      pojoSwaps;<a name="line.299"></a>
+<span class="sourceLineNo">300</span>   private final SerializerGroup serializers;<a name="line.300"></a>
+<span class="sourceLineNo">301</span>   private final ParserGroup parsers;<a name="line.301"></a>
+<span class="sourceLineNo">302</span>   private final UrlEncodingSerializer urlEncodingSerializer;<a name="line.302"></a>
+<span class="sourceLineNo">303</span>   private final UrlEncodingParser urlEncodingParser;<a name="line.303"></a>
+<span class="sourceLineNo">304</span>   private final EncoderGroup encoders;<a name="line.304"></a>
+<span class="sourceLineNo">305</span>   private final MediaType[]<a name="line.305"></a>
+<span class="sourceLineNo">306</span>      supportedContentTypes,<a name="line.306"></a>
+<span class="sourceLineNo">307</span>      supportedAcceptTypes;<a name="line.307"></a>
+<span class="sourceLineNo">308</span>   private final Map&lt;String,String&gt; defaultRequestHeaders;<a name="line.308"></a>
+<span class="sourceLineNo">309</span>   private final Map&lt;String,Object&gt; defaultResponseHeaders;<a name="line.309"></a>
+<span class="sourceLineNo">310</span>   private final BeanContext beanContext;<a name="line.310"></a>
+<span class="sourceLineNo">311</span>   private final RestConverter[] converters;<a name="line.311"></a>
+<span class="sourceLineNo">312</span>   private final RestGuard[] guards;<a name="line.312"></a>
+<span class="sourceLineNo">313</span>   private final ResponseHandler[] responseHandlers;<a name="line.313"></a>
+<span class="sourceLineNo">314</span>   private final MimetypesFileTypeMap mimetypesFileTypeMap;<a name="line.314"></a>
+<span class="sourceLineNo">315</span>   private final StreamResource styleSheet, favIcon;<a name="line.315"></a>
+<span class="sourceLineNo">316</span>   private final Map&lt;String,String&gt; staticFilesMap;<a name="line.316"></a>
+<span class="sourceLineNo">317</span>   private final String[] staticFilesPrefixes;<a name="line.317"></a>
+<span class="sourceLineNo">318</span>   private final MessageBundle msgs;<a name="line.318"></a>
+<span class="sourceLineNo">319</span>   private final ConfigFile configFile;<a name="line.319"></a>
+<span class="sourceLineNo">320</span>   private final VarResolver varResolver;<a name="line.320"></a>
+<span class="sourceLineNo">321</span>   private final Map&lt;String,CallRouter&gt; callRouters;<a name="line.321"></a>
+<span class="sourceLineNo">322</span>   private final Map&lt;String,CallMethod&gt; callMethods;<a name="line.322"></a>
+<span class="sourceLineNo">323</span>   private final Map&lt;String,RestContext&gt; childResources;<a name="line.323"></a>
+<span class="sourceLineNo">324</span>   private final RestLogger logger;<a name="line.324"></a>
+<span class="sourceLineNo">325</span>   private final RestCallHandler callHandler;<a name="line.325"></a>
+<span class="sourceLineNo">326</span>   private final RestInfoProvider infoProvider;<a name="line.326"></a>
+<span class="sourceLineNo">327</span>   private final RestException initException;<a name="line.327"></a>
+<span class="sourceLineNo">328</span><a name="line.328"></a>
+<span class="sourceLineNo">329</span>   // In-memory cache of images and stylesheets in the org.apache.juneau.rest.htdocs package.<a name="line.329"></a>
+<span class="sourceLineNo">330</span>   private final Map&lt;String,StreamResource&gt; staticFilesCache = new ConcurrentHashMap&lt;String,StreamResource&gt;();<a name="line.330"></a>
+<span class="sourceLineNo">331</span>   private final Map&lt;String,byte[]&gt; resourceStreams = new ConcurrentHashMap&lt;String,byte[]&gt;();<a name="line.331"></a>
+<span class="sourceLineNo">332</span>   private final Map&lt;String,String&gt; resourceStrings = new ConcurrentHashMap&lt;String,String&gt;();<a name="line.332"></a>
+<span class="sourceLineNo">333</span>   private final ConcurrentHashMap&lt;Integer,AtomicInteger&gt; stackTraceHashes = new ConcurrentHashMap&lt;Integer,AtomicInteger&gt;();<a name="line.333"></a>
+<span class="sourceLineNo">334</span><a name="line.334"></a>
+<span class="sourceLineNo">335</span><a name="line.335"></a>
+<span class="sourceLineNo">336</span>   /**<a name="line.336"></a>
+<span class="sourceLineNo">337</span>    * Constructor.<a name="line.337"></a>
+<span class="sourceLineNo">338</span>    *<a name="line.338"></a>
+<span class="sourceLineNo">339</span>    * @param resource The resource class (a class annotated with {@link RestResource @RestResource}).<a name="line.339"></a>
+<span class="sourceLineNo">340</span>    * @param config The servlet configuration object.<a name="line.340"></a>
+<span class="sourceLineNo">341</span>    * @throws Exception If any initialization problems were encountered.<a name="line.341"></a>
+<span class="sourceLineNo">342</span>    */<a name="line.342"></a>
+<span class="sourceLineNo">343</span>   @SuppressWarnings("unchecked")<a name="line.343"></a>
+<span class="sourceLineNo">344</span>   public RestContext(Object resource, RestConfig config) throws Exception {<a name="line.344"></a>
+<span class="sourceLineNo">345</span>      super(null);<a name="line.345"></a>
+<span class="sourceLineNo">346</span>      RestException _initException = null;<a name="line.346"></a>
+<span class="sourceLineNo">347</span>      try {<a name="line.347"></a>
+<span class="sourceLineNo">348</span>         this.resource = resource;<a name="line.348"></a>
+<span class="sourceLineNo">349</span>         this.config = config;<a name="line.349"></a>
+<span class="sourceLineNo">350</span><a name="line.350"></a>
+<span class="sourceLineNo">351</span>         Builder b = new Builder(resource, config);<a name="line.351"></a>
+<span class="sourceLineNo">352</span>         this.allowHeaderParams = b.allowHeaderParams;<a name="line.352"></a>
+<span class="sourceLineNo">353</span>         this.allowBodyParam = b.allowBodyParam;<a name="line.353"></a>
+<span class="sourceLineNo">354</span>         this.renderResponseStackTraces = b.renderResponseStackTraces;<a name="line.354"></a>
+<span class="sourceLineNo">355</span>         this.useStackTraceHashes = b.useStackTraceHashes;<a name="line.355"></a>
+<span class="sourceLineNo">356</span>         this.allowMethodParams = Collections.unmodifiableSet(b.allowMethodParams);<a name="line.356"></a>
+<span class="sourceLineNo">357</span>         this.defaultCharset = b.defaultCharset;<a name="line.357"></a>
+<span class="sourceLineNo">358</span>         this.paramFormat = b.paramFormat;<a name="line.358"></a>
+<span class="sourceLineNo">359</span>         this.varResolver = b.varResolver;<a name="line.359"></a>
+<span class="sourceLineNo">360</span>         this.configFile = b.configFile;<a name="line.360"></a>
+<span class="sourceLineNo">361</span>         this.properties = b.properties;<a name="line.361"></a>
+<span class="sourceLineNo">362</span>         this.beanFilters = b.beanFilters;<a name="line.362"></a>
+<span class="sourceLineNo">363</span>         this.pojoSwaps = b.pojoSwaps;<a name="line.363"></a>
+<span class="sourceLineNo">364</span>         this.serializers = b.serializers;<a name="line.364"></a>
+<span class="sourceLineNo">365</span>         this.parsers = b.parsers;<a name="line.365"></a>
+<span class="sourceLineNo">366</span>         this.urlEncodingSerializer = b.urlEncodingSerializer;<a name="line.366"></a>
+<span class="sourceLineNo">367</span>         this.urlEncodingParser = b.urlEncodingParser;<a name="line.367"></a>
+<span class="sourceLineNo">368</span>         this.encoders = b.encoders;<a name="line.368"></a>
+<span class="sourceLineNo">369</span>         this.supportedContentTypes = ArrayUtils.toObjectArray(b.supportedContentTypes, MediaType.class);<a name="line.369"></a>
+<span class="sourceLineNo">370</span>         this.supportedAcceptTypes = ArrayUtils.toObjectArray(b.supportedAcceptTypes, MediaType.class);<a name="line.370"></a>
+<span class="sourceLineNo">371</span>         this.clientVersionHeader = b.clientVersionHeader;<a name="line.371"></a>
+<span class="sourceLineNo">372</span>         this.defaultRequestHeaders = Collections.unmodifiableMap(b.defaultRequestHeaders);<a name="line.372"></a>
+<span class="sourceLineNo">373</span>         this.defaultResponseHeaders = Collections.unmodifiableMap(b.defaultResponseHeaders);<a name="line.373"></a>
+<span class="sourceLineNo">374</span>         this.beanContext = b.beanContext;<a name="line.374"></a>
+<span class="sourceLineNo">375</span>         this.converters = b.converters.toArray(new RestConverter[b.converters.size()]);<a name="line.375"></a>
+<span class="sourceLineNo">376</span>         this.guards = b.guards.toArray(new RestGuard[b.guards.size()]);<a name="line.376"></a>
+<span class="sourceLineNo">377</span>         this.responseHandlers = ArrayUtils.toObjectArray(b.responseHandlers, ResponseHandler.class);<a name="line.377"></a>
+<span class="sourceLineNo">378</span>         this.mimetypesFileTypeMap = b.mimetypesFileTypeMap;<a name="line.378"></a>
+<span class="sourceLineNo">379</span>         this.styleSheet = b.styleSheet;<a name="line.379"></a>
+<span class="sourceLineNo">380</span>         this.favIcon = b.favIcon;<a name="line.380"></a>
+<span class="sourceLineNo">381</span>         this.staticFilesMap = Collections.unmodifiableMap(b.staticFilesMap);<a name="line.381"></a>
+<span class="sourceLineNo">382</span>         this.staticFilesPrefixes = b.staticFilesPrefixes;<a name="line.382"></a>
+<span class="sourceLineNo">383</span>         this.msgs = b.messageBundle;<a name="line.383"></a>
+<span class="sourceLineNo">384</span>         this.childResources = Collections.synchronizedMap(new LinkedHashMap&lt;String,RestContext&gt;());  // Not unmodifiable on purpose so that children can be replaced.<a name="line.384"></a>
+<span class="sourceLineNo">385</span>         this.logger = b.logger;<a name="line.385"></a>
+<span class="sourceLineNo">386</span>         this.fullPath = b.fullPath;<a name="line.386"></a>
+<span class="sourceLineNo">387</span>         this.pageTitle = b.pageTitle;<a name="line.387"></a>
+<span class="sourceLineNo">388</span>         this.pageText = b.pageText;<a name="line.388"></a>
+<span class="sourceLineNo">389</span>         this.pageLinks = b.pageLinks;<a name="line.389"></a>
+<span class="sourceLineNo">390</span><a name="line.390"></a>
+<span class="sourceLineNo">391</span>         //----------------------------------------------------------------------------------------------------<a name="line.391"></a>
+<span class="sourceLineNo">392</span>         // Initialize the child resources.<a name="line.392"></a>
+<span class="sourceLineNo">393</span>         // Done after initializing fields above since we pass this object to the child resources.<a name="line.393"></a>
+<span class="sourceLineNo">394</span>         //----------------------------------------------------------------------------------------------------<a name="line.394"></a>
+<span class="sourceLineNo">395</span>         List&lt;String&gt; methodsFound = new LinkedList&lt;String&gt;();   // Temporary to help debug transient duplicate method issue.<a name="line.395"></a>
+<span class="sourceLineNo">396</span>         Map&lt;String,CallRouter.Builder&gt; routers = new LinkedHashMap&lt;String,CallRouter.Builder&gt;();<a name="line.396"></a>
+<span class="sourceLineNo">397</span>         Map&lt;String,CallMethod&gt; _javaRestMethods = new LinkedHashMap&lt;String,CallMethod&gt;();<a name="line.397"></a>
+<span class="sourceLineNo">398</span>         for (java.lang.reflect.Method method : resource.getClass().getMethods()) {<a name="line.398"></a>
+<span class="sourceLineNo">399</span>            if (method.isAnnotationPresent(RestMethod.class)) {<a name="line.399"></a>
+<span class="sourceLineNo">400</span>               RestMethod a = method.getAnnotation(RestMethod.class);<a name="line.400"></a>
+<span class="sourceLineNo">401</span>               methodsFound.add(method.getName() + "," + a.name() + "," + a.path());<a name="line.401"></a>
+<span class="sourceLineNo">402</span>               try {<a name="line.402"></a>
+<span class="sourceLineNo">403</span>                  if (! Modifier.isPublic(method.getModifiers()))<a name="line.403"></a>
+<span class="sourceLineNo">404</span>                     throw new RestServletException("@RestMethod method {0}.{1} must be defined as public.", this.getClass().getName(), method.getName());<a name="line.404"></a>
+<span class="sourceLineNo">405</span><a name="line.405"></a>
+<span class="sourceLineNo">406</span>                  CallMethod sm = new CallMethod(resource, method, this);<a name="line.406"></a>
+<span class="sourceLineNo">407</span>                  String httpMethod = sm.getHttpMethod();<a name="line.407"></a>
 <span class="sourceLineNo">408</span><a name="line.408"></a>
-<span class="sourceLineNo">409</span>                     final ClassMeta&lt;?&gt; interfaceClass = beanContext.getClassMeta(method.getGenericReturnType());<a name="line.409"></a>
-<span class="sourceLineNo">410</span>                     sm = new CallMethod(resource, method, this) {<a name="line.410"></a>
-<span class="sourceLineNo">411</span><a name="line.411"></a>
-<span class="sourceLineNo">412</span>                        @Override<a name="line.412"></a>
-<span class="sourceLineNo">413</span>                        int invoke(String pathInfo, RestRequest req, RestResponse res) throws RestException {<a name="line.413"></a>
-<span class="sourceLineNo">414</span><a name="line.414"></a>
-<span class="sourceLineNo">415</span>                           int rc = super.invoke(pathInfo, req, res);<a name="line.415"></a>
-<span class="sourceLineNo">416</span>                           if (rc != SC_OK)<a name="line.416"></a>
-<span class="sourceLineNo">417</span>                              return rc;<a name="line.417"></a>
-<span class="sourceLineNo">418</span><a name="line.418"></a>
-<span class="sourceLineNo">419</span>                           final Object o = res.getOutput();<a name="line.419"></a>
-<span class="sourceLineNo">420</span><a name="line.420"></a>
-<span class="sourceLineNo">421</span>                           if ("GET".equals(req.getMethod())) {<a name="line.421"></a>
-<span class="sourceLineNo">422</span>                              res.setOutput(ClassUtils.getMethodInfo(interfaceClass.getProxyableMethods().values()));<a name="line.422"></a>
-<span class="sourceLineNo">423</span>                              return SC_OK;<a name="line.423"></a>
-<span class="sourceLineNo">424</span><a name="line.424"></a>
-<span class="sourceLineNo">425</span>                           } else if ("POST".equals(req.getMethod())) {<a name="line.425"></a>
-<span class="sourceLineNo">426</span>                              if (pathInfo.indexOf('/') != -1)<a name="line.426"></a>
-<span class="sourceLineNo">427</span>                                 pathInfo = pathInfo.substring(pathInfo.lastIndexOf('/')+1);<a name="line.427"></a>
-<span class="sourceLineNo">428</span>                              pathInfo = RestUtils.decode(pathInfo);<a name="line.428"></a>
-<span class="sourceLineNo">429</span>                              java.lang.reflect.Method m = interfaceClass.getProxyableMethods().get(pathInfo);<a name="line.429"></a>
-<span class="sourceLineNo">430</span>                              if (m != null) {<a name="line.430"></a>
-<span class="sourceLineNo">431</span>                                 try {<a name="line.431"></a>
-<span class="sourceLineNo">432</span>                                    // Parse the args and invoke the method.<a name="line.432"></a>
-<span class="sourceLineNo">433</span>                                    Parser p = req.getParser();<a name="line.433"></a>
-<span class="sourceLineNo">434</span>                                    Object input = p.isReaderParser() ? req.getReader() : req.getInputStream();<a name="line.434"></a>
-<span class="sourceLineNo">435</span>                                    Object output = null;<a name="line.435"></a>
-<span class="sourceLineNo">436</span>                                    try {<a name="line.436"></a>
-<span class="sourceLineNo">437</span>                                       output = m.invoke(o, p.parseArgs(input, m.getGenericParameterTypes()));<a name="line.437"></a>
-<span class="sourceLineNo">438</span>                                    } catch (InvocationTargetException e) {<a name="line.438"></a>
-<span class="sourceLineNo">439</span>                                       res.setHeader("Exception-Name", e.getCause().getClass().getName());<a name="line.439"></a>
-<span class="sourceLineNo">440</span>                                       res.setHeader("Exception-Message", e.getCause().getMessage());<a name="line.440"></a>
-<span class="sourceLineNo">441</span>                                       throw e;<a name="line.441"></a>
-<span class="sourceLineNo">442</span>                                    } catch (Exception e) {<a name="line.442"></a>
-<span class="sourceLineNo">443</span>                                       res.setHeader("Exception-Name", e.getClass().getName());<a name="line.443"></a>
-<span class="sourceLineNo">444</span>                                       res.setHeader("Exception-Message", e.getCause().getMessage());<a name="line.444"></a>
-<span class="sourceLineNo">445</span>                                       throw e;<a name="line.445"></a>
-<span class="sourceLineNo">446</span>                                    }<a name="line.446"></a>
-<span class="sourceLineNo">447</span>                                    res.setOutput(output);<a name="line.447"></a>
-<span class="sourceLineNo">448</span>                                    return SC_OK;<a name="line.448"></a>
-<span class="sourceLineNo">449</span>                                 } catch (Exception e) {<a name="line.449"></a>
-<span class="sourceLineNo">450</span>                                    throw new RestException(SC_INTERNAL_SERVER_ERROR, e);<a name="line.450"></a>
-<span class="sourceLineNo">451</span>                                 }<a name="line.451"></a>
-<span class="sourceLineNo">452</span>                              }<a name="line.452"></a>
-<span class="sourceLineNo">453</span>                           }<a name="line.453"></a>
-<span class="sourceLineNo">454</span>                           return SC_NOT_FOUND;<a name="line.454"></a>
-<span class="sourceLineNo">455</span>                        }<a name="line.455"></a>
-<span class="sourceLineNo">456</span>                     };<a name="line.456"></a>
-<span class="sourceLineNo">457</span><a name="line.457"></a>
-<span class="sourceLineNo">458</span>                     _javaRestMethods.put(method.getName(), sm);<a name="line.458"></a>
-<span class="sourceLineNo">459</span>                     addToRouter(routers, "GET", sm);<a name="line.459"></a>
-<span class="sourceLineNo">460</span>                     addToRouter(routers, "POST", sm);<a name="line.460"></a>
-<span class="sourceLineNo">461</span><a name="line.461"></a>
-<span class="sourceLineNo">462</span>                  } else {<a name="line.462"></a>
+<span class="sourceLineNo">409</span>                  // PROXY is a special case where a method returns an interface that we<a name="line.409"></a>
+<span class="sourceLineNo">410</span>                  // can perform REST calls against.<a name="line.410"></a>
+<span class="sourceLineNo">411</span>                  // We override the CallMethod.invoke() method to insert our logic.<a name="line.411"></a>
+<span class="sourceLineNo">412</span>                  if ("PROXY".equals(httpMethod)) {<a name="line.412"></a>
+<span class="sourceLineNo">413</span><a name="line.413"></a>
+<span class="sourceLineNo">414</span>                     final ClassMeta&lt;?&gt; interfaceClass = beanContext.getClassMeta(method.getGenericReturnType());<a name="line.414"></a>
+<span class="sourceLineNo">415</span>                     sm = new CallMethod(resource, method, this) {<a name="line.415"></a>
+<span class="sourceLineNo">416</span><a name="line.416"></a>
+<span class="sourceLineNo">417</span>                        @Override<a name="line.417"></a>
+<span class="sourceLineNo">418</span>                        int invoke(String pathInfo, RestRequest req, RestResponse res) throws RestException {<a name="line.418"></a>
+<span class="sourceLineNo">419</span><a name="line.419"></a>
+<span class="sourceLineNo">420</span>                           int rc = super.invoke(pathInfo, req, res);<a name="line.420"></a>
+<span class="sourceLineNo">421</span>                           if (rc != SC_OK)<a name="line.421"></a>
+<span class="sourceLineNo">422</span>                              return rc;<a name="line.422"></a>
+<span class="sourceLineNo">423</span><a name="line.423"></a>
+<span class="sourceLineNo">424</span>                           final Object o = res.getOutput();<a name="line.424"></a>
+<span class="sourceLineNo">425</span><a name="line.425"></a>
+<span class="sourceLineNo">426</span>                           if ("GET".equals(req.getMethod())) {<a name="line.426"></a>
+<span class="sourceLineNo">427</span>                              res.setOutput(ClassUtils.getMethodInfo(interfaceClass.getProxyableMethods().values()));<a name="line.427"></a>
+<span class="sourceLineNo">428</span>                              return SC_OK;<a name="line.428"></a>
+<span class="sourceLineNo">429</span><a name="line.429"></a>
+<span class="sourceLineNo">430</span>                           } else if ("POST".equals(req.getMethod())) {<a name="line.430"></a>
+<span class="sourceLineNo">431</span>                              if (pathInfo.indexOf('/') != -1)<a name="line.431"></a>
+<span class="sourceLineNo">432</span>                                 pathInfo = pathInfo.substring(pathInfo.lastIndexOf('/')+1);<a name="line.432"></a>
+<span class="sourceLineNo">433</span>                              pathInfo = RestUtils.decode(pathInfo);<a name="line.433"></a>
+<span class="sourceLineNo">434</span>                              java.lang.reflect.Method m = interfaceClass.getProxyableMethods().get(pathInfo);<a name="line.434"></a>
+<span class="sourceLineNo">435</span>                              if (m != null) {<a name="line.435"></a>
+<span class="sourceLineNo">436</span>                                 try {<a name="line.436"></a>
+<span class="sourceLineNo">437</span>                                    // Parse the args and invoke the method.<a name="line.437"></a>
+<span class="sourceLineNo">438</span>                                    Parser p = req.getParser();<a name="line.438"></a>
+<span class="sourceLineNo">439</span>                                    Object input = p.isReaderParser() ? req.getReader() : req.getInputStream();<a name="line.439"></a>
+<span class="sourceLineNo">440</span>                                    Object output = null;<a name="line.440"></a>
+<span class="sourceLineNo">441</span>                                    try {<a name="line.441"></a>
+<span class="sourceLineNo">442</span>                                       output = m.invoke(o, p.parseArgs(input, m.getGenericParameterTypes()));<a name="line.442"></a>
+<span class="sourceLineNo">443</span>                                    } catch (InvocationTargetException e) {<a name="line.443"></a>
+<span class="sourceLineNo">444</span>                                       res.setHeader("Exception-Name", e.getCause().getClass().getName());<a name="line.444"></a>
+<span class="sourceLineNo">445</span>                                       res.setHeader("Exception-Message", e.getCause().getMessage());<a name="line.445"></a>
+<span class="sourceLineNo">446</span>                                       throw e;<a name="line.446"></a>
+<span class="sourceLineNo">447</span>                                    } catch (Exception e) {<a name="line.447"></a>
+<span class="sourceLineNo">448</span>                                       res.setHeader("Exception-Name", e.getClass().getName());<a name="line.448"></a>
+<span class="sourceLineNo">449</span>                                       res.setHeader("Exception-Message", e.getMessage());<a name="line.449"></a>
+<span class="sourceLineNo">450</span>                                       throw e;<a name="line.450"></a>
+<span class="sourceLineNo">451</span>                                    }<a name="line.451"></a>
+<span class="sourceLineNo">452</span>                                    res.setOutput(output);<a name="line.452"></a>
+<span class="sourceLineNo">453</span>                                    return SC_OK;<a name="line.453"></a>
+<span class="sourceLineNo">454</span>                                 } catch (Exception e) {<a name="line.454"></a>
+<span class="sourceLineNo">455</span>                                    throw new RestException(SC_INTERNAL_SERVER_ERROR, e);<a name="line.455"></a>
+<span class="sourceLineNo">456</span>                                 }<a name="line.456"></a>
+<span class="sourceLineNo">457</span>                              }<a name="line.457"></a>
+<span class="sourceLineNo">458</span>                           }<a name="line.458"></a>
+<span class="sourceLineNo">459</span>                           return SC_NOT_FOUND;<a name="line.459"></a>
+<span class="sourceLineNo">460</span>                        }<a name="line.460"></a>
+<span class="sourceLineNo">461</span>                     };<a name="line.461"></a>
+<span class="sourceLineNo">462</span><a name="line.462"></a>
 <span class="sourceLineNo">463</span>                     _javaRestMethods.put(method.getName(), sm);<a name="line.463"></a>
-<span class="sourceLineNo">464</span>                     addToRouter(routers, httpMethod, sm);<a name="line.464"></a>
-<span class="sourceLineNo">465</span>                  }<a name="line.465"></a>
-<span class="sourceLineNo">466</span>               } catch (RestServletException e) {<a name="line.466"></a>
-<span class="sourceLineNo">467</span>                  throw new RestServletException("Problem occurred trying to serialize methods on class {0}, methods={1}", this.getClass().getName(), JsonSerializer.DEFAULT_LAX.serialize(methodsFound)).initCause(e);<a name="line.467"></a>
-<span class="sourceLineNo">468</span>               }<a name="line.468"></a>
-<span class="sourceLineNo">469</span>            }<a name="line.469"></a>
-<span class="sourceLineNo">470</span>         }<a name="line.470"></a>
-<span class="sourceLineNo">471</span>         this.callMethods = Collections.unmodifiableMap(_javaRestMethods);<a name="line.471"></a>
-<span class="sourceLineNo">472</span><a name="line.472"></a>
-<span class="sourceLineNo">473</span>         Map&lt;String,CallRouter&gt; _callRouters = new LinkedHashMap&lt;String,CallRouter&gt;();<a name="line.473"></a>
-<span class="sourceLineNo">474</span>         for (CallRouter.Builder crb : routers.values())<a name="line.474"></a>
-<span class="sourceLineNo">475</span>            _callRouters.put(crb.getHttpMethodName(), crb.build());<a name="line.475"></a>
-<span class="sourceLineNo">476</span>         this.callRouters = Collections.unmodifiableMap(_callRouters);<a name="line.476"></a>
+<span class="sourceLineNo">464</span>                     addToRouter(routers, "GET", sm);<a name="line.464"></a>
+<span class="sourceLineNo">465</span>                     addToRouter(routers, "POST", sm);<a name="line.465"></a>
+<span class="sourceLineNo">466</span><a name="line.466"></a>
+<span class="sourceLineNo">467</span>                  } else {<a name="line.467"></a>
+<span class="sourceLineNo">468</span>                     _javaRestMethods.put(method.getName(), sm);<a name="line.468"></a>
+<span class="sourceLineNo">469</span>                     addToRouter(routers, httpMethod, sm);<a name="line.469"></a>
+<span class="sourceLineNo">470</span>                  }<a name="line.470"></a>
+<span class="sourceLineNo">471</span>               } catch (RestServletException e) {<a name="line.471"></a>
+<span class="sourceLineNo">472</span>                  throw new RestServletException("Problem occurred trying to serialize methods on class {0}, methods={1}", this.getClass().getName(), JsonSerializer.DEFAULT_LAX.serialize(methodsFound)).initCause(e);<a name="line.472"></a>
+<span class="sourceLineNo">473</span>               }<a name="line.473"></a>
+<span class="sourceLineNo">474</span>            }<a name="line.474"></a>
+<span class="sourceLineNo">475</span>         }<a name="line.475"></a>
+<span class="sourceLineNo">476</span>         this.callMethods = Collections.unmodifiableMap(_javaRestMethods);<a name="line.476"></a>
 <span class="sourceLineNo">477</span><a name="line.477"></a>
-<span class="sourceLineNo">478</span>         // Initialize our child resources.<a name="line.478"></a>
-<span class="sourceLineNo">479</span>         RestResourceResolver rrr = resolve(RestResourceResolver.class, config.resourceResolver);<a name="line.479"></a>
-<span class="sourceLineNo">480</span>         for (Object o : config.childResources) {<a name="line.480"></a>
-<span class="sourceLineNo">481</span>            String path = null;<a name="line.481"></a>
-<span class="sourceLineNo">482</span>            Object r = null;<a name="line.482"></a>
-<span class="sourceLineNo">483</span>            if (o instanceof Pair) {<a name="line.483"></a>
-<span class="sourceLineNo">484</span>               Pair&lt;String,Object&gt; p = (Pair&lt;String,Object&gt;)o;<a name="line.484"></a>
-<span class="sourceLineNo">485</span>               path = p.first();<a name="line.485"></a>
-<span class="sourceLineNo">486</span>               r = p.second();<a name="line.486"></a>
-<span class="sourceLineNo">487</span>            } else if (o instanceof Class&lt;?&gt;) {<a name="line.487"></a>
-<span class="sourceLineNo">488</span>               Class&lt;?&gt; c = (Class&lt;?&gt;)o;<a name="line.488"></a>
-<span class="sourceLineNo">489</span>               r = c;<a name="line.489"></a>
-<span class="sourceLineNo">490</span>            } else {<a name="line.490"></a>
-<span class="sourceLineNo">491</span>               r = o;<a name="line.491"></a>
-<span class="sourceLineNo">492</span>            }<a name="line.492"></a>
-<span class="sourceLineNo">493</span><a name="line.493"></a>
-<span class="sourceLineNo">494</span>            RestConfig childConfig = null;<a name="line.494"></a>
-<span class="sourceLineNo">495</span><a name="line.495"></a>
-<span class="sourceLineNo">496</span>            if (o instanceof Class) {<a name="line.496"></a>
-<span class="sourceLineNo">497</span>               Class&lt;?&gt; oc = (Class&lt;?&gt;)o;<a name="line.497"></a>
-<span class="sourceLineNo">498</span>               childConfig = new RestConfig(config.inner, oc, this);<a name="line.498"></a>
-<span class="sourceLineNo">499</span>               r = rrr.resolve(oc, childConfig);<a name="line.499"></a>
-<span class="sourceLineNo">500</span>            } else {<a name="line.500"></a>
-<span class="sourceLineNo">501</span>               r = o;<a name="line.501"></a>
-<span class="sourceLineNo">502</span>               childConfig = new RestConfig(config.inner, o.getClass(), this);<a name="line.502"></a>
-<span class="sourceLineNo">503</span>            }<a name="line.503"></a>
-<span class="sourceLineNo">504</span><a name="line.504"></a>
-<span class="sourceLineNo">505</span>            if (r instanceof RestServlet) {<a name="line.505"></a>
-<span class="sourceLineNo">506</span>               RestServlet rs = (RestServlet)r;<a name="line.506"></a>
-<span class="sourceLineNo">507</span>               rs.init(childConfig);<a name="line.507"></a>
-<span class="sourceLineNo">508</span>               path = childConfig.path;<a name="line.508"></a>
-<span class="sourceLineNo">509</span>               childResources.put(path, rs.getContext());<a name="line.509"></a>
-<span class="sourceLineNo">510</span>            } else {<a name="line.510"></a>
-<span class="sourceLineNo">511</span><a name="line.511"></a>
-<span class="sourceLineNo">512</span>               // Call the init(RestConfig) method.<a name="line.512"></a>
-<span class="sourceLineNo">513</span>               java.lang.reflect.Method m2 = ClassUtils.findPublicMethod(r.getClass(), "init", Void.class, RestConfig.class);<a name="line.513"></a>
-<span class="sourceLineNo">514</span>               if (m2 != null)<a name="line.514"></a>
-<span class="sourceLineNo">515</span>                  m2.invoke(r, childConfig);<a name="line.515"></a>
+<span class="sourceLineNo">478</span>         Map&lt;String,CallRouter&gt; _callRouters = new LinkedHashMap&lt;String,CallRouter&gt;();<a name="line.478"></a>
+<span class="sourceLineNo">479</span>         for (CallRouter.Builder crb : routers.values())<a name="line.479"></a>
+<span class="sourceLineNo">480</span>            _callRouters.put(crb.getHttpMethodName(), crb.build());<a name="line.480"></a>
+<span class="sourceLineNo">481</span>         this.callRouters = Collections.unmodifiableMap(_callRouters);<a name="line.481"></a>
+<span class="sourceLineNo">482</span><a name="line.482"></a>
+<span class="sourceLineNo">483</span>         // Initialize our child resources.<a name="line.483"></a>
+<span class="sourceLineNo">484</span>         RestResourceResolver rrr = resolve(RestResourceResolver.class, config.resourceResolver);<a name="line.484"></a>
+<span class="sourceLineNo">485</span>         for (Object o : config.childResources) {<a name="line.485"></a>
+<span class="sourceLineNo">486</span>            String path = null;<a name="line.486"></a>
+<span class="sourceLineNo">487</span>            Object r = null;<a name="line.487"></a>
+<span class="sourceLineNo">488</span>            if (o instanceof Pair) {<a name="line.488"></a>
+<span class="sourceLineNo">489</span>               Pair&lt;String,Object&gt; p = (Pair&lt;String,Object&gt;)o;<a name="line.489"></a>
+<span class="sourceLineNo">490</span>               path = p.first();<a name="line.490"></a>
+<span class="sourceLineNo">491</span>               r = p.second();<a name="line.491"></a>
+<span class="sourceLineNo">492</span>            } else if (o instanceof Class&lt;?&gt;) {<a name="line.492"></a>
+<span class="sourceLineNo">493</span>               Class&lt;?&gt; c = (Class&lt;?&gt;)o;<a name="line.493"></a>
+<span class="sourceLineNo">494</span>               r = c;<a name="line.494"></a>
+<span class="sourceLineNo">495</span>            } else {<a name="line.495"></a>
+<span class="sourceLineNo">496</span>               r = o;<a name="line.496"></a>
+<span class="sourceLineNo">497</span>            }<a name="line.497"></a>
+<span class="sourceLineNo">498</span><a name="line.498"></a>
+<span class="sourceLineNo">499</span>            RestConfig childConfig = null;<a name="line.499"></a>
+<span class="sourceLineNo">500</span><a name="line.500"></a>
+<span class="sourceLineNo">501</span>            if (o instanceof Class) {<a name="line.501"></a>
+<span class="sourceLineNo">502</span>               Class&lt;?&gt; oc = (Class&lt;?&gt;)o;<a name="line.502"></a>
+<span class="sourceLineNo">503</span>               childConfig = new RestConfig(config.inner, oc, this);<a name="line.503"></a>
+<span class="sourceLineNo">504</span>               r = rrr.resolve(oc, childConfig);<a name="line.504"></a>
+<span class="sourceLineNo">505</span>            } else {<a name="line.505"></a>
+<span class="sourceLineNo">506</span>               r = o;<a name="line.506"></a>
+<span class="sourceLineNo">507</span>               childConfig = new RestConfig(config.inner, o.getClass(), this);<a name="line.507"></a>
+<span class="sourceLineNo">508</span>            }<a name="line.508"></a>
+<span class="sourceLineNo">509</span><a name="line.509"></a>
+<span class="sourceLineNo">510</span>            if (r instanceof RestServlet) {<a name="line.510"></a>
+<span class="sourceLineNo">511</span>               RestServlet rs = (RestServlet)r;<a name="line.511"></a>
+<span class="sourceLineNo">512</span>               rs.init(childConfig);<a name="line.512"></a>
+<span class="sourceLineNo">513</span>               path = childConfig.path;<a name="line.513"></a>
+<span class="sourceLineNo">514</span>               childResources.put(path, rs.getContext());<a name="line.514"></a>
+<span class="sourceLineNo">515</span>            } else {<a name="line.515"></a>
 <span class="sourceLineNo">516</span><a name="line.516"></a>
-<span class="sourceLineNo">517</span>               RestContext rc2 = new RestContext(r, childConfig);<a name="line.517"></a>
-<span class="sourceLineNo">518</span><a name="line.518"></a>
-<span class="sourceLineNo">519</span>               // Call the init(RestContext) method.<a name="line.519"></a>
-<span class="sourceLineNo">520</span>               m2 = ClassUtils.findPublicMethod(r.getClass(), "init", Void.class, RestContext.class);<a name="line.520"></a>
-<span class="sourceLineNo">521</span>               if (m2 != null)<a name="line.521"></a>
-<span class="sourceLineNo">522</span>                  m2.invoke(r, rc2);<a name="line.522"></a>
+<span class="sourceLineNo">517</span>               // Call the init(RestConfig) method.<a name="line.517"></a>
+<span class="sourceLineNo">518</span>               java.lang.reflect.Method m2 = ClassUtils.findPublicMethod(r.getClass(), "init", Void.class, RestConfig.class);<a name="line.518"></a>
+<span class="sourceLineNo">519</span>               if (m2 != null)<a name="line.519"></a>
+<span class="sourceLineNo">520</span>                  m2.invoke(r, childConfig);<a name="line.520"></a>
+<span class="sourceLineNo">521</span><a name="line.521"></a>
+<span class="sourceLineNo">522</span>               RestContext rc2 = new RestContext(r, childConfig);<a name="line.522"></a>
 <span class="sourceLineNo">523</span><a name="line.523"></a>
-<span class="sourceLineNo">524</span>               path = childConfig.path;<a name="line.524"></a>
-<span class="sourceLineNo">525</span>               childResources.put(path, rc2);<a name="line.525"></a>
-<span class="sourceLineNo">526</span>            }<a name="line.526"></a>
-<span class="sourceLineNo">527</span>         }<a name="line.527"></a>
+<span class="sourceLineNo">524</span>               // Call the init(RestContext) method.<a name="line.524"></a>
+<span class="sourceLineNo">525</span>               m2 = ClassUtils.findPublicMethod(r.getClass(), "init", Void.class, RestContext.class);<a name="line.525"></a>
+<span class="sourceLineNo">526</span>               if (m2 != null)<a name="line.526"></a>
+<span class="sourceLineNo">527</span>                  m2.invoke(r, rc2);<a name="line.527"></a>
 <span class="sourceLineNo">528</span><a name="line.528"></a>
-<span class="sourceLineNo">529</span>         callHandler = config.callHandler == null ? new RestCallHandler(this) : resolve(RestCallHandler.class, config.callHandler, this);<a name="line.529"></a>
-<span class="sourceLineNo">530</span>         infoProvider = config.infoProvider == null ? new RestInfoProvider(this) : resolve(RestInfoProvider.class, config.infoProvider, this);<a name="line.530"></a>
-<span class="sourceLineNo">531</span><a name="line.531"></a>
-<span class="sourceLineNo">532</span>      } catch (RestException e) {<a name="line.532"></a>
-<span class="sourceLineNo">533</span>         _initException = e;<a name="line.533"></a>
-<span class="sourceLineNo">534</span>         throw e;<a name="line.534"></a>
-<span class="sourceLineNo">535</span>      } catch (Exception e) {<a name="line.535"></a>
-<span class="sourceLineNo">536</span>         _initException = new RestException(SC_INTERNAL_SERVER_ERROR, e);<a name="line.536"></a>
-<span class="sourceLineNo">537</span>         throw e;<a name="line.537"></a>
-<span class="sourceLineNo">538</span>      } finally {<a name="line.538"></a>
-<span class="sourceLineNo">539</span>         initException = _initException;<a name="line.539"></a>
-<span class="sourceLineNo">540</span>      }<a name="line.540"></a>
-<span class="sourceLineNo">541</span>   }<a name="line.541"></a>
-<span class="sourceLineNo">542</span><a name="line.542"></a>
-<span class="sourceLineNo">543</span>   private static void addToRouter(Map&lt;String, CallRouter.Builder&gt; routers, String httpMethodName, CallMethod cm) throws RestServletException {<a name="line.543"></a>
-<span class="sourceLineNo">544</span>      if (! routers.containsKey(httpMethodName))<a name="line.544"></a>
-<span class="sourceLineNo">545</span>         routers.put(httpMethodName, new CallRouter.Builder(httpMethodName));<a name="line.545"></a>
-<span class="sourceLineNo">546</span>      routers.get(httpMethodName).add(cm);<a name="line.546"></a>
-<span class="sourceLineNo">547</span>   }<a name="line.547"></a>
-<span class="sourceLineNo">548</span><a name="line.548"></a>
-<span class="sourceLineNo">549</span>   private static class Builder {<a name="line.549"></a>
-<span class="sourceLineNo">550</span><a name="line.550"></a>
-<span class="sourceLineNo">551</span>      boolean allowHeaderParams, allowBodyParam, renderResponseStackTraces, useStackTraceHashes;<a name="line.551"></a>
-<span class="sourceLineNo">552</span>      VarResolver varResolver;<a name="line.552"></a>
-<span class="sourceLineNo">553</span>      ConfigFile configFile;<a name="line.553"></a>
-<span class="sourceLineNo">554</span>      ObjectMap properties;<a name="line.554"></a>
-<span class="sourceLineNo">555</span>      Class&lt;?&gt;[] beanFilters;<a name="line.555"></a>
-<span class="sourceLineNo">556</span>      Class&lt;?&gt;[] pojoSwaps;<a name="line.556"></a>
-<span class="sourceLineNo">557</span>      SerializerGroup serializers;<a name="line.557"></a>
-<span class="sourceLineNo">558</span>      ParserGroup parsers;<a name="line.558"></a>
-<span class="sourceLineNo">559</span>      UrlEncodingSerializer urlEncodingSerializer;<a name="line.559"></a>
-<span class="sourceLineNo">560</span>      UrlEncodingParser urlEncodingParser;<a name="line.560"></a>
-<span class="sourceLineNo">561</span>      EncoderGroup encoders;<a name="line.561"></a>
-<span class="sourceLineNo">562</span>      String clientVersionHeader = "", defaultCharset, paramFormat;<a name="line.562"></a>
-<span class="sourceLineNo">563</span>      List&lt;MediaType&gt; supportedContentTypes, supportedAcceptTypes;<a name="line.563"></a>
-<span class="sourceLineNo">564</span>      Map&lt;String,String&gt; defaultRequestHeaders = new TreeMap&lt;String,String&gt;(String.CASE_INSENSITIVE_ORDER);<a name="line.564"></a>
-<span class="sourceLineNo">565</span>      Map&lt;String,Object&gt; defaultResponseHeaders;<a name="line.565"></a>
-<span class="sourceLineNo">566</span>      BeanContext beanContext;<a name="line.566"></a>
-<span class="sourceLineNo">567</span>      List&lt;RestConverter&gt; converters = new ArrayList&lt;RestConverter&gt;();<a name="line.567"></a>
-<span class="sourceLineNo">568</span>      List&lt;RestGuard&gt; guards = new ArrayList&lt;RestGuard&gt;();<a name="line.568"></a>
-<span class="sourceLineNo">569</span>      List&lt;ResponseHandler&gt; responseHandlers = new ArrayList&lt;ResponseHandler&gt;();<a name="line.569"></a>
-<span class="sourceLineNo">570</span>      MimetypesFileTypeMap mimetypesFileTypeMap;<a name="line.570"></a>
-<span class="sourceLineNo">571</span>      StreamResource styleSheet, favIcon;<a name="line.571"></a>
-<span class="sourceLineNo">572</span>      Map&lt;String,String&gt; staticFilesMap;<a name="line.572"></a>
-<span class="sourceLineNo">573</span>      String[] staticFilesPrefixes;<a name="line.573"></a>
-<span class="sourceLineNo">574</span>      MessageBundle messageBundle;<a name="line.574"></a>
-<span class="sourceLineNo">575</span>      Set&lt;String&gt; allowMethodParams = new LinkedHashSet&lt;String&gt;();<a name="line.575"></a>
-<span class="sourceLineNo">576</span>      RestLogger logger;<a name="line.576"></a>
-<span class="sourceLineNo">577</span>      String fullPath;<a name="line.577"></a>
-<span class="sourceLineNo">578</span><a name="line.578"></a>
-<span class="sourceLineNo">579</span>      @SuppressWarnings("unchecked")<a name="line.579"></a>
-<span class="sourceLineNo">580</span>      private Builder(Object resource, RestConfig sc) throws Exception {<a name="line.580"></a>
-<span class="sourceLineNo">581</span><a name="line.581"></a>
-<span class="sourceLineNo">582</span>         PropertyStore ps = sc.createPropertyStore();<a name="line.582"></a>
+<span class="sourceLineNo">529</span>               path = childConfig.path;<a name="line.529"></a>
+<span class="sourceLineNo">530</span>               childResources.put(path, rc2);<a name="line.530"></a>
+<span class="sourceLineNo">531</span>            }<a name="line.531"></a>
+<span class="sourceLineNo">532</span>         }<a name="line.532"></a>
+<span class="sourceLineNo">533</span><a name="line.533"></a>
+<span class="sourceLineNo">534</span>         callHandler = config.callHandler == null ? new RestCallHandler(this) : resolve(RestCallHandler.class, config.callHandler, this);<a name="line.534"></a>
+<span class="sourceLineNo">535</span>         infoProvider = config.infoProvider == null ? new RestInfoProvider(this) : resolve(RestInfoProvider.class, config.infoProvider, this);<a name="line.535"></a>
+<span class="sourceLineNo">536</span><a name="line.536"></a>
+<span class="sourceLineNo">537</span>      } catch (RestException e) {<a name="line.537"></a>
+<span class="sourceLineNo">538</span>         _initException = e;<a name="line.538"></a>
+<span class="sourceLineNo">539</span>         throw e;<a name="line.539"></a>
+<span class="sourceLineNo">540</span>      } catch (Exception e) {<a name="line.540"></a>
+<span class="sourceLineNo">541</span>         _initException = new RestException(SC_INTERNAL_SERVER_ERROR, e);<a name="line.541"></a>
+<span class="sourceLineNo">542</span>         throw e;<a name="line.542"></a>
+<span class="sourceLineNo">543</span>      } finally {<a name="line.543"></a>
+<span class="sourceLineNo">544</span>         initException = _initException;<a name="line.544"></a>
+<span class="sourceLineNo">545</span>      }<a name="line.545"></a>
+<span class="sourceLineNo">546</span>   }<a name="line.546"></a>
+<span class="sourceLineNo">547</span><a name="line.547"></a>
+<span class="sourceLineNo">548</span>   private static void addToRouter(Map&lt;String, CallRouter.Builder&gt; routers, String httpMethodName, CallMethod cm) throws RestServletException {<a name="line.548"></a>
+<span class="sourceLineNo">549</span>      if (! routers.containsKey(httpMethodName))<a name="line.549"></a>
+<span class="sourceLineNo">550</span>         routers.put(httpMethodName, new CallRouter.Builder(httpMethodName));<a name="line.550"></a>
+<span class="sourceLineNo">551</span>      routers.get(httpMethodName).add(cm);<a name="line.551"></a>
+<span class="sourceLineNo">552</span>   }<a name="line.552"></a>
+<span class="sourceLineNo">553</span><a name="line.553"></a>
+<span class="sourceLineNo">554</span>   private static class Builder {<a name="line.554"></a>
+<span class="sourceLineNo">555</span><a name="line.555"></a>
+<span class="sourceLineNo">556</span>      boolean allowHeaderParams, allowBodyParam, renderResponseStackTraces, useStackTraceHashes;<a name="line.556"></a>
+<span class="sourceLineNo">557</span>      VarResolver varResolver;<a name="line.557"></a>
+<span class="sourceLineNo">558</span>      ConfigFile configFile;<a name="line.558"></a>
+<span class="sourceLineNo">559</span>      ObjectMap properties;<a name="line.559"></a>
+<span class="sourceLineNo">560</span>      Class&lt;?&gt;[] beanFilters;<a name="line.560"></a>
+<span class="sourceLineNo">561</span>      Class&lt;?&gt;[] pojoSwaps;<a name="line.561"></a>
+<span class="sourceLineNo">562</span>      SerializerGroup serializers;<a name="line.562"></a>
+<span class="sourceLineNo">563</span>      ParserGroup parsers;<a name="line.563"></a>
+<span class="sourceLineNo">564</span>      UrlEncodingSerializer urlEncodingSerializer;<a name="line.564"></a>
+<span class="sourceLineNo">565</span>      UrlEncodingParser urlEncodingParser;<a name="line.565"></a>
+<span class="sourceLineNo">566</span>      EncoderGroup encoders;<a name="line.566"></a>
+<span class="sourceLineNo">567</span>      String clientVersionHeader = "", defaultCharset, paramFormat, pageTitle, pageText, pageLinks;<a name="line.567"></a>
+<span class="sourceLineNo">568</span>      List&lt;MediaType&gt; supportedContentTypes, supportedAcceptTypes;<a name="line.568"></a>
+<span class="sourceLineNo">569</span>      Map&lt;String,String&gt; defaultRequestHeaders = new TreeMap&lt;String,String&gt;(String.CASE_INSENSITIVE_ORDER);<a name="line.569"></a>
+<span class="sourceLineNo">570</span>      Map&lt;String,Object&gt; defaultResponseHeaders;<a name="line.570"></a>
+<span class="sourceLineNo">571</span>      BeanContext beanContext;<a name="line.571"></a>
+<span class="sourceLineNo">572</span>      List&lt;RestConverter&gt; converters = new ArrayList&lt;RestConverter&gt;();<a name="line.572"></a>
+<span class="sourceLineNo">573</span>      List&lt;RestGuard&gt; guards = new ArrayList&lt;RestGuard&gt;();<a name="line.573"></a>
+<span class="sourceLineNo">574</span>      List&lt;ResponseHandler&gt; responseHandlers = new ArrayList&lt;ResponseHandler&gt;();<a name="line.574"></a>
+<span class="sourceLineNo">575</span>      MimetypesFileTypeMap mimetypesFileTypeMap;<a name="line.575"></a>
+<span class="sourceLineNo">576</span>      StreamResource styleSheet, favIcon;<a name="line.576"></a>
+<span class="sourceLineNo">577</span>      Map&lt;String,String&gt; staticFilesMap;<a name="line.577"></a>
+<span class="sourceLineNo">578</span>      String[] staticFilesPrefixes;<a name="line.578"></a>
+<span class="sourceLineNo">579</span>      MessageBundle messageBundle;<a name="line.579"></a>
+<span class="sourceLineNo">580</span>      Set&lt;String&gt; allowMethodParams = new LinkedHashSet&lt;String&gt;();<a name="line.580"></a>
+<span class="sourceLineNo">581</span>      RestLogger logger;<a name="line.581"></a>
+<span class="sourceLineNo">582</span>      String fullPath;<a name="line.582"></a>
 <span class="sourceLineNo">583</span><a name="line.583"></a>
-<span class="sourceLineNo">584</span>         LinkedHashMap&lt;Class&lt;?&gt;,RestResource&gt; restResourceAnnotationsChildFirst = ReflectionUtils.findAnnotationsMap(RestResource.class, resource.getClass());<a name="line.584"></a>
-<span class="sourceLineNo">585</span><a name="line.585"></a>
-<span class="sourceLineNo">586</span>         allowHeaderParams = ps.getProperty(REST_allowHeaderParams, boolean.class, true);<a name="line.586"></a>
-<span class="sourceLineNo">587</span>         allowBodyParam = ps.getProperty(REST_allowBodyParam, boolean.class, true);<a name="line.587"></a>
-<span class="sourceLineNo">588</span>         renderResponseStackTraces = ps.getProperty(REST_renderResponseStackTraces, boolean.class, false);<a name="line.588"></a>
-<span class="sourceLineNo">589</span>         useStackTraceHashes = ps.getProperty(REST_useStackTraceHashes, boolean.class, true);<a name="line.589"></a>
-<span class="sourceLineNo">590</span>         defaultCharset = ps.getProperty(REST_defaultCharset, String.class, "utf-8");<a name="line.590"></a>
-<span class="sourceLineNo">591</span>         paramFormat = ps.getProperty(REST_paramFormat, String.class, "");<a name="line.591"></a>
-<span class="sourceLineNo">592</span><a name="line.592"></a>
-<span class="sourceLineNo">593</span>         for (String m : StringUtils.split(ps.getProperty(REST_allowMethodParam, String.class, ""), ','))<a name="line.593"></a>
-<span class="sourceLineNo">594</span>            if (m.equals("true"))  // For backwards compatibility when this was a boolean field.<a name="line.594"></a>
-<span class="sourceLineNo">595</span>               allowMethodParams.add("*");<a name="line.595"></a>
-<span class="sourceLineNo">596</span>            else<a name="line.596"></a>
-<span class="sourceLineNo">597</span>               allowMethodParams.add(m.toUpperCase());<a name="line.597"></a>
-<span class="sourceLineNo">598</span><a name="line.598"></a>
-<span class="sourceLineNo">599</span>         varResolver = sc.varResolverBuilder<a name="line.599"></a>
-<span class="sourceLineNo">600</span>            .vars(LocalizationVar.class, RequestVar.class, SerializedRequestAttrVar.class, ServletInitParamVar.class, UrlEncodeVar.class)<a name="line.600"></a>
-<span class="sourceLineNo">601</span>            .build()<a name="line.601"></a>
-<span class="sourceLineNo">602</span>         ;<a name="line.602"></a>
-<span class="sourceLineNo">603</span>         configFile = sc.configFile.getResolving(this.varResolver);<a name="line.603"></a>
-<span class="sourceLineNo">604</span>         properties = sc.properties;<a name="line.604"></a>
-<span class="sourceLineNo">605</span>         Collections.reverse(sc.beanFilters);<a name="line.605"></a>
-<span class="sourceLineNo">606</span>         Collections.reverse(sc.pojoSwaps);<a name="line.606"></a>
-<span class="sourceLineNo">607</span>         beanFilters = ArrayUtils.toObjectArray(sc.beanFilters, Class.class);<a name="line.607"></a>
-<span class="sourceLineNo">608</span>         pojoSwaps = ArrayUtils.toObjectArray(sc.pojoSwaps, Class.class);<a name="line.608"></a>
-<span class="sourceLineNo">609</span>         clientVersionHeader = sc.clientVersionHeader;<a name="line.609"></a>
-<span class="sourceLineNo">610</span><a name="line.610"></a>
-<span class="sourceLineNo">611</span>         // Find resource resource bundle location.<a name="line.611"></a>
-<span class="sourceLineNo">612</span>         for (Map.Entry&lt;Class&lt;?&gt;,RestResource&gt; e : restResourceAnnotationsChildFirst.entrySet()) {<a name="line.612"></a>
-<span class="sourceLineNo">613</span>            Class&lt;?&gt; c = e.getKey();<a name="line.613"></a>
-<span class="sourceLineNo">614</span>            RestResource r = e.getValue();<a name="line.614"></a>
-<span class="sourceLineNo">615</span>            if (! r.messages().isEmpty()) {<a name="line.615"></a>
-<span class="sourceLineNo">616</span>               if (messageBundle == null)<a name="line.616"></a>
-<span class="sourceLineNo">617</span>                  messageBundle = new MessageBundle(c, r.messages());<a name="line.617"></a>
-<span class="sourceLineNo">618</span>               else<a name="line.618"></a>
-<span class="sourceLineNo">619</span>                  messageBundle.addSearchPath(c, r.messages());<a name="line.619"></a>
-<span class="sourceLineNo">620</span>            }<a name="line.620"></a>
-<span class="sourceLineNo">621</span>         }<a name="line.621"></a>
-<span class="sourceLineNo">622</span><a name="line.622"></a>
-<span class="sourceLineNo">623</span>         if (messageBundle == null)<a name="line.623"></a>
-<span class="sourceLineNo">624</span>            messageBundle = new MessageBundle(resource.getClass(), "");<a name="line.624"></a>
-<span class="sourceLineNo">625</span><a name="line.625"></a>
-<span class="sourceLineNo">626</span>         ps.addBeanFilters(beanFilters).addPojoSwaps(pojoSwaps).setProperties(properties);<a name="line.626"></a>
+<span class="sourceLineNo">584</span>      @SuppressWarnings("unchecked")<a name="line.584"></a>
+<span class="sourceLineNo">585</span>      private Builder(Object resource, RestConfig sc) throws Exception {<a name="line.585"></a>
+<span class="sourceLineNo">586</span><a name="line.586"></a>
+<span class="sourceLineNo">587</span>         PropertyStore ps = sc.createPropertyStore();<a name="line.587"></a>
+<span class="sourceLineNo">588</span><a name="line.588"></a>
+<span class="sourceLineNo">589</span>         LinkedHashMap&lt;Class&lt;?&gt;,RestResource&gt; restResourceAnnotationsChildFirst = ReflectionUtils.findAnnotationsMap(RestResource.class, resource.getClass());<a name="line.589"></a>
+<span class="sourceLineNo">590</span><a name="line.590"></a>
+<span class="sourceLineNo">591</span>         allowHeaderParams = ps.getProperty(REST_allowHeaderParams, boolean.class, true);<a name="line.591"></a>
+<span class="sourceLineNo">592</span>         allowBodyParam = ps.getProperty(REST_allowBodyParam, boolean.class, true);<a name="line.592"></a>
+<span class="sourceLineNo">593</span>         renderResponseStackTraces = ps.getProperty(REST_renderResponseStackTraces, boolean.class, false);<a name="line.593"></a>
+<span class="sourceLineNo">594</span>         useStackTraceHashes = ps.getProperty(REST_useStackTraceHashes, boolean.class, true);<a name="line.594"></a>
+<span class="sourceLineNo">595</span>         defaultCharset = ps.getProperty(REST_defaultCharset, String.class, "utf-8");<a name="line.595"></a>
+<span class="sourceLineNo">596</span>         paramFormat = ps.getProperty(REST_paramFormat, String.class, "");<a name="line.596"></a>
+<span class="sourceLineNo">597</span><a name="line.597"></a>
+<span class="sourceLineNo">598</span>         for (String m : StringUtils.split(ps.getProperty(REST_allowMethodParam, String.class, ""), ','))<a name="line.598"></a>
+<span class="sourceLineNo">599</span>            if (m.equals("true"))  // For backwards compatibility when this was a boolean field.<a name="line.599"></a>
+<span class="sourceLineNo">600</span>               allowMethodParams.add("*");<a name="line.600"></a>
+<span class="sourceLineNo">601</span>            else<a name="line.601"></a>
+<span class="sourceLineNo">602</span>               allowMethodParams.add(m.toUpperCase());<a name="line.602"></a>
+<span class="sourceLineNo">603</span><a name="line.603"></a>
+<span class="sourceLineNo">604</span>         varResolver = sc.varResolverBuilder<a name="line.604"></a>
+<span class="sourceLineNo">605</span>            .vars(LocalizationVar.class, RequestVar.class, SerializedRequestAttrVar.class, ServletInitParamVar.class, UrlEncodeVar.class)<a name="line.605"></a>
+<span class="sourceLineNo">606</span>            .build()<a name="line.606"></a>
+<span class="sourceLineNo">607</span>         ;<a name="line.607"></a>
+<span class="sourceLineNo">608</span>         configFile = sc.configFile.getResolving(this.varResolver);<a name="line.608"></a>
+<span class="sourceLineNo">609</span>         properties = sc.properties;<a name="line.609"></a>
+<span class="sourceLineNo">610</span>         Collections.reverse(sc.beanFilters);<a name="line.610"></a>
+<span class="sourceLineNo">611</span>         Collections.reverse(sc.pojoSwaps);<a name="line.611"></a>
+<span class="sourceLineNo">612</span>         beanFilters = ArrayUtils.toObjectArray(sc.beanFilters, Class.class);<a name="line.612"></a>
+<span class="sourceLineNo">613</span>         pojoSwaps = ArrayUtils.toObjectArray(sc.pojoSwaps, Class.class);<a name="line.613"></a>
+<span class="sourceLineNo">614</span>         clientVersionHeader = sc.clientVersionHeader;<a name="line.614"></a>
+<span class="sourceLineNo">615</span><a name="line.615"></a>
+<span class="sourceLineNo">616</span>         // Find resource resource bundle location.<a name="line.616"></a>
+<span class="sourceLineNo">617</span>         for (Map.Entry&lt;Class&lt;?&gt;,RestResource&gt; e : restResourceAnnotationsChildFirst.entrySet()) {<a name="line.617"></a>
+<span class="sourceLineNo">618</span>            Class&lt;?&gt; c = e.getKey();<a name="line.618"></a>
+<span class="sourceLineNo">619</span>            RestResource r = e.getValue();<a name="line.619"></a>
+<span class="sourceLineNo">620</span>            if (! r.messages().isEmpty()) {<a name="line.620"></a>
+<span class="sourceLineNo">621</span>               if (messageBundle == null)<a name="line.621"></a>
+<span class="sourceLineNo">622</span>                  messageBundle = new MessageBundle(c, r.messages());<a name="line.622"></a>
+<span class="sourceLineNo">623</span>               else<a name="line.623"></a>
+<span class="sourceLineNo">624</span>                  messageBundle.addSearchPath(c, r.messages());<a name="line.624"></a>
+<span class="sourceLineNo">625</span>            }<a name="line.625"></a>
+<span class="sourceLineNo">626</span>         }<a name="line.626"></a>
 <span class="sourceLineNo">627</span><a name="line.627"></a>
-<span class="sourceLineNo">628</span>         serializers = sc.serializers.beanFilters(beanFilters).pojoSwaps(pojoSwaps).properties(properties).build();<a name="line.628"></a>
-<span class="sourceLineNo">629</span>         parsers = sc.parsers.beanFilters(beanFilters).pojoSwaps(pojoSwaps).properties(properties).build();<a name="line.629"></a>
-<span class="sourceLineNo">630</span>         urlEncodingSerializer = new UrlEncodingSerializer(ps);<a name="line.630"></a>
-<span class="sourceLineNo">631</span>         urlEncodingParser = new UrlEncodingParser(ps);<a name="line.631"></a>
-<span class="sourceLineNo">632</span>         encoders = sc.encoders.build();<a name="line.632"></a>
-<span class="sourceLineNo">633</span>         supportedContentTypes = sc.supportedContentTypes != null ? sc.supportedContentTypes : serializers.getSupportedMediaTypes();<a name="line.633"></a>
-<span class="sourceLineNo">634</span>         supportedAcceptTypes = sc.supportedAcceptTypes != null ? sc.supportedAcceptTypes : parsers.getSupportedMediaTypes();<a name="line.634"></a>
-<span class="sourceLineNo">635</span>         defaultRequestHeaders.putAll(sc.defaultRequestHeaders);<a name="line.635"></a>
-<span class="sourceLineNo">636</span>         defaultResponseHeaders = Collections.unmodifiableMap(new LinkedHashMap&lt;String,Object&gt;(sc.defaultResponseHeaders));<a name="line.636"></a>
-<span class="sourceLineNo">637</span>         beanContext = ps.getBeanContext();<a name="line.637"></a>
-<span class="sourceLineNo">638</span><a name="line.638"></a>
-<span class="sourceLineNo">639</span>         for (Object o : sc.converters)<a name="line.639"></a>
-<span class="sourceLineNo">640</span>            converters.add(resolve(RestConverter.class, o));<a name="line.640"></a>
-<span class="sourceLineNo">641</span><a name="line.641"></a>
-<span class="sourceLineNo">642</span>         for (Object o : sc.guards)<a name="line.642"></a>
-<span class="sourceLineNo">643</span>            guards.add(resolve(RestGuard.class, o));<a name="line.643"></a>
-<span class="sourceLineNo">644</span><a name="line.644"></a>
-<span class="sourceLineNo">645</span>         for (Object o : sc.responseHandlers)<a name="line.645"></a>
-<span class="sourceLineNo">646</span>            responseHandlers.add(resolve(ResponseHandler.class, o));<a name="line.646"></a>
-<span class="sourceLineNo">647</span><a name="line.647"></a>
-<span class="sourceLineNo">648</span>         mimetypesFileTypeMap = sc.mimeTypes;<a name="line.648"></a>
+<span class="sourceLineNo">628</span>         if (messageBundle == null)<a name="line.628"></a>
+<span class="sourceLineNo">629</span>            messageBundle = new MessageBundle(resource.getClass(), "");<a name="line.629"></a>
+<span class="sourceLineNo">630</span><a name="line.630"></a>
+<span class="sourceLineNo">631</span>         ps.addBeanFilters(beanFilters).addPojoSwaps(pojoSwaps).setProperties(properties);<a name="line.631"></a>
+<span class="sourceLineNo">632</span><a name="line.632"></a>
+<span class="sourceLineNo">633</span>         serializers = sc.serializers.beanFilters(beanFilters).pojoSwaps(pojoSwaps).properties(properties).build();<a name="line.633"></a>
+<span class="sourceLineNo">634</span>         parsers = sc.parsers.beanFilters(beanFilters).pojoSwaps(pojoSwaps).properties(properties).build();<a name="line.634"></a>
+<span class="sourceLineNo">635</span>         urlEncodingSerializer = new UrlEncodingSerializer(ps);<a name="line.635"></a>
+<span class="sourceLineNo">636</span>         urlEncodingParser = new UrlEncodingParser(ps);<a name="line.636"></a>
+<span class="sourceLineNo">637</span>         encoders = sc.encoders.build();<a name="line.637"></a>
+<span class="sourceLineNo">638</span>         supportedContentTypes = sc.supportedContentTypes != null ? sc.supportedContentTypes : serializers.getSupportedMediaTypes();<a name="line.638"></a>
+<span class="sourceLineNo">639</span>         supportedAcceptTypes = sc.supportedAcceptTypes != null ? sc.supportedAcceptTypes : parsers.getSupportedMediaTypes();<a name="line.639"></a>
+<span class="sourceLineNo">640</span>         defaultRequestHeaders.putAll(sc.defaultRequestHeaders);<a name="line.640"></a>
+<span class="sourceLineNo">641</span>         defaultResponseHeaders = Collections.unmodifiableMap(new LinkedHashMap&lt;String,Object&gt;(sc.defaultResponseHeaders));<a name="line.641"></a>
+<span class="sourceLineNo">642</span>         beanContext = ps.getBeanContext();<a name="line.642"></a>
+<span class="sourceLineNo">643</span><a name="line.643"></a>
+<span class="sourceLineNo">644</span>         for (Object o : sc.converters)<a name="line.644"></a>
+<span class="sourceLineNo">645</span>            converters.add(resolve(RestConverter.class, o));<a name="line.645"></a>
+<span class="sourceLineNo">646</span><a name="line.646"></a>
+<span class="sourceLineNo">647</span>         for (Object o : sc.guards)<a name="line.647"></a>
+<span class="sourceLineNo">648</span>            guards.add(resolve(RestGuard.class, o));<a name="line.648"></a>
 <span class="sourceLineNo">649</span><a name="line.649"></a>
-<span class="sourceLineNo">650</span>         VarResolver vr = sc.getVarResolverBuilder().build();<a name="line.650"></a>
-<span class="sourceLineNo">651</span><a name="line.651"></a>
-<span class="sourceLineNo">652</span>         if (sc.styleSheets != null) {<a name="line.652"></a>
-<span class="sourceLineNo">653</span>            List&lt;InputStream&gt; contents = new ArrayList&lt;InputStream&gt;();<a name="line.653"></a>
-<span class="sourceLineNo">654</span>            for (Object o : sc.styleSheets) {<a name="line.654"></a>
-<span class="sourceLineNo">655</span>               if (o instanceof Pair) {<a name="line.655"></a>
-<span class="sourceLineNo">656</span>                  Pair&lt;Class&lt;?&gt;,String&gt; p = (Pair&lt;Class&lt;?&gt;,String&gt;)o;<a name="line.656"></a>
-<span class="sourceLineNo">657</span>                  for (String path : StringUtils.split(vr.resolve(StringUtils.toString(p.second())), ','))<a name="line.657"></a>
-<span class="sourceLineNo">658</span>                     if (path.startsWith("file://"))<a name="line.658"></a>
-<span class="sourceLineNo">659</span>                        contents.add(new FileInputStream(path));<a name="line.659"></a>
-<span class="sourceLineNo">660</span>                     else<a name="line.660"></a>
-<span class="sourceLineNo">661</span>                        contents.add(ReflectionUtils.getResource(p.first(), path));<a name="line.661"></a>
-<span class="sourceLineNo">662</span>               } else {<a name="line.662"></a>
-<span class="sourceLineNo">663</span>                  contents.add(IOUtils.toInputStream(o));<a name="line.663"></a>
-<span class="sourceLineNo">664</span>               }<a name="line.664"></a>
-<span class="sourceLineNo">665</span>            }<a name="line.665"></a>
-<span class="sourceLineNo">666</span>            styleSheet = new StreamResource(MediaType.forString("text/css"), contents.toArray());<a name="line.666"></a>
-<span class="sourceLineNo">667</span>         }<a name="line.667"></a>
-<span class="sourceLineNo">668</span><a name="line.668"></a>
-<span class="sourceLineNo">669</span>         if (sc.favIcon != null) {<a name="line.669"></a>
-<span class="sourceLineNo">670</span>            Object o = sc.favIcon;<a name="line.670"></a>
-<span class="sourceLineNo">671</span>            InputStream is = null;<a name="line.671"></a>
-<span class="sourceLineNo">672</span>            if (o instanceof Pair) {<a name="line.672"></a>
-<span class="sourceLineNo">673</span>               Pair&lt;Class&lt;?&gt;,String&gt; p = (Pair&lt;Class&lt;?&gt;,String&gt;)o;<a name="line.673"></a>
-<span class="sourceLineNo">674</span>               is = ReflectionUtils.getResource(p.first(), vr.resolve(p.second()));<a name="line.674"></a>
-<span class="sourceLineNo">675</span>            } else {<a name="line.675"></a>
-<span class="sourceLineNo">676</span>               is = IOUtils.toInputStream(o);<a name="line.676"></a>
-<span class="sourceLineNo">677</span>            }<a name="line.677"></a>
-<span class="sourceLineNo">678</span>            if (is != null)<a name="line.678"></a>
-<span class="sourceLineNo">679</span>               favIcon = new StreamResource(MediaType.forString("image/x-icon"), is);<a name="line.679"></a>
-<span class="sourceLineNo">680</span>         }<a name="line.680"></a>
-<span class="sourceLineNo">681</span><a name="line.681"></a>
-<span class="sourceLineNo">682</span>         staticFilesMap = new LinkedHashMap&lt;String,String&gt;();<a name="line.682"></a>
-<span class="sourceLineNo">683</span>         if (sc.staticFiles != null) {<a name="line.683"></a>
-<span class="sourceLineNo">684</span>            for (Object o : sc.staticFiles) {<a name="line.684"></a>
-<span class="sourceLineNo">685</span>               if (o instanceof Pair) {<a name="line.685"></a>
-<span class="sourceLineNo">686</span>                  Pair&lt;Class&lt;?&gt;,String&gt; p = (Pair&lt;Class&lt;?&gt;,String&gt;)o;<a name="line.686"></a>
-<span class="sourceLineNo">687</span>                  // TODO - Currently doesn't take parent class location into account.<a name="line.687"></a>
-<span class="sourceLineNo">688</span>                  staticFilesMap.putAll(JsonParser.DEFAULT.parse(vr.resolve(p.second()), LinkedHashMap.class));<a name="line.688"></a>
-<span class="sourceLineNo">689</span>               } else {<a name="line.689"></a>
-<span class="sourceLineNo">690</span>                  throw new RuntimeException("TODO");<a name="line.690"></a>
-<span class="sourceLineNo">691</span>               }<a name="line.691"></a>
-<span class="sourceLineNo">692</span>            }<a name="line.692"></a>
-<span class="sourceLineNo">693</span>         }<a name="line.693"></a>
-<span class="sourceLineNo">694</span>         staticFilesPrefixes = staticFilesMap.keySet().toArray(new String[0]);<a name="line.694"></a>
-<span class="sourceLineNo">695</span><a name="line.695"></a>
-<span class="sourceLineNo">696</span>         logger = sc.logger == null ? new RestLogger.NoOp() : resolve(RestLogger.class, sc.logger);<a name="line.696"></a>
-<span class="sourceLineNo">697</span><a name="line.697"></a>
-<span class="sourceLineNo">698</span>         fullPath = (sc.parentContext == null ? "" : (sc.parentContext.fullPath + '/')) + sc.path;<a name="line.698"></a>
-<span class="sourceLineNo">699</span>      }<a name="line.699"></a>
-<span class="sourceLineNo">700</span>   }<a name="line.700"></a>
-<span class="sourceLineNo">701</span><a name="line.701"></a>
-<span class="sourceLineNo">702</span>   /**<a name="line.702"></a>
-<span class="sourceLineNo">703</span>    * Returns the variable resolver for this servlet.<a name="line.703"></a>
-<span class="sourceLineNo">704</span>    * &lt;p&gt;<a name="line.704"></a>
-<span class="sourceLineNo">705</span>    * Variable resolvers are used to replace variables in property values.<a name="line.705"></a>
-<span class="sourceLineNo">706</span>    * &lt;/p&gt;<a name="line.706"></a>
-<span class="sourceLineNo">707</span>    * &lt;h6 class='figure'&gt;Example:&lt;/h6&gt;<a name="line.707"></a>
-<span class="sourceLineNo">708</span>    * &lt;p class='bcode'&gt;<a name="line.708"></a>
-<span class="sourceLineNo">709</span>    *    &lt;ja&gt;@RestResource&lt;/ja&gt;(<a name="line.709"></a>
-<span class="sourceLineNo">710</span>    *       messages=&lt;js&gt;"nls/Messages"&lt;/js&gt;,<a name="line.710"></a>
-<span class="sourceLineNo">711</span>    *       properties={<a name="line.711"></a>
-<span class="sourceLineNo">712</span>    *          &lt;ja&gt;@Property&lt;/ja&gt;(name=&lt;js&gt;"title"&lt;/js&gt;,value=&lt;js&gt;"$L{title}"&lt;/js&gt;),  &lt;jc&gt;// Localized variable in Messages.properties&lt;/jc&gt;<a name="line.712"></a>
-<span class="sourceLineNo">713</span>    *

<TRUNCATED>


Mime
View raw message