001// ***************************************************************************************************************************
002// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.  See the NOTICE file *
003// * distributed with this work for additional information regarding copyright ownership.  The ASF licenses this file        *
004// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance            *
005// * with the License.  You may obtain a copy of the License at                                                              *
006// *                                                                                                                         *
007// *  http://www.apache.org/licenses/LICENSE-2.0                                                                             *
008// *                                                                                                                         *
009// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an  *
010// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the        *
011// * specific language governing permissions and limitations under the License.                                              *
012// ***************************************************************************************************************************
013package org.apache.juneau.rest;
014
015import org.apache.juneau.*;
016import org.apache.juneau.internal.*;
017
018/**
019 * Denotes the default resolver for child resources.
020 *
021 * The default implementation simply instantiates the class using one of the following constructors:
022 * <ul>
023 *    <li><code><jk>public</jk> T(RestContextBuilder)</code>
024 *    <li><code><jk>public</jk> T()</code>
025 * </ul>
026 *
027 * <p>
028 * The former constructor can be used to get access to the {@link RestContextBuilder} object to get access to the
029 * config file and initialization information or make programmatic modifications to the resource before
030 * full initialization.
031 *
032 * <p>
033 * Child classes can also be defined as inner-classes of the parent resource class.
034 *
035 * <ul class='seealso'>
036 *    <li class='link'>{@doc juneau-rest-server.Instantiation.ResourceResolvers}
037 * </ul>
038 */
039public class BasicRestResourceResolver extends FuzzyResourceResolver implements RestResourceResolver {
040
041   @Override /* RestResourceResolver */
042   public <T> T resolve(Object parent, Class<T> c, RestContextBuilder builder, Object...args) {
043      return resolve(parent, c, ArrayUtils.append(args, builder));
044   }
045}