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.config;
014
015import org.apache.juneau.annotation.*;
016import org.apache.juneau.json.*;
017import org.apache.juneau.rest.annotation.*;
018import org.apache.juneau.serializer.annotation.*;
019
020/**
021 * Basic configuration for a REST resource that supports JSON 5 transport.
022 *
023 * <p>
024 *    Default settings defined:
025 * </p>
026 * <ul class='spaced-list'>
027 *    <li class='ja'>{@link Rest}:
028 *       <ul>
029 *          <li class='jma'>{@link Rest#serializers() serializers}:
030 *             <ul class='javatree'>
031 *                <li class='jc'>{@link Json5Serializer}
032 *             </ul>
033 *          </li>
034 *          <li class='jma'>{@link Rest#parsers() parsers}:
035 *             <ul class='javatree'>
036 *                <li class='jc'>{@link Json5Parser}
037 *             </ul>
038 *          </li>
039 *          <li class='jma'>{@link Rest#defaultAccept() defaultAccept}:  <js>"text/json5"</js>
040 *          <li class='jma'>{@link Rest#config() config}:  <js>"$S{juneau.configFile,SYSTEM_DEFAULT}"</js>
041 *    </ul>
042 * </li>
043 *    <li class='ja'>{@link BeanConfig}:
044 *       <ul>
045 *          <li class='jma'>{@link BeanConfig#ignoreUnknownBeanProperties() ignoreUnknownBeanProperties}:  <js>"true"</js>
046 *       </ul>
047 *    </li>
048 *    <li class='ja'>{@link SerializerConfig}:
049 *       <ul>
050 *          <li class='jma'>{@link SerializerConfig#uriResolution() uriResolution}:  <js>"ROOT_RELATIVE"</js>
051 *       </ul>
052 *    </li>
053 * </ul>
054 *
055 * <p>
056 *    This annotation can be applied to REST resource classes to define common JSON default configurations:
057 * </p>
058 * <p class='bjava'>
059 *    <jc>// Used on a top-level resource.</jc>
060 *    <ja>@Rest</ja>
061 *    <jk>public class</jk> MyResource <jk>extends</jk> RestServlet <jk>implements</jk> BasicJson5Config { ... }
062 * </p>
063 * <p class='bjava'>
064 *    <jc>// Used on a child resource.</jc>
065 *    <ja>@Rest</ja>
066 *    <jk>public class</jk> MyResource <jk>extends</jk> RestObject <jk>implements</jk> BasicJson5Config { ... }
067 * </p>
068 *
069 * <p>
070 *    Note that the framework will aggregate annotations defined on all classes in the class hierarchy with
071 *    values defined on child classes overriding values defined on parent classes.  That allows any values defined
072 *    on this interface to be overridden by annotations defined on the implemented class.
073 * </p>
074 *
075 * <h5 class='section'>See Also:</h5><ul>
076 *    <li class='link'><a class="doclink" href="../../../../../index.html#jrs.AnnotatedClasses">@Rest-Annotated Classes</a>
077 * </ul>
078 */
079@Rest(
080
081   // Default serializers for all Java methods in the class.
082   serializers={
083      Json5Serializer.class,
084   },
085
086   // Default parsers for all Java methods in the class.
087   parsers={
088      Json5Parser.class,
089   },
090
091   // Optional external configuration file.
092   config="$S{juneau.configFile,SYSTEM_DEFAULT}"
093)
094public interface BasicJson5Config extends DefaultConfig {}