001/*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.apache.juneau.rest.config;
018
019import org.apache.juneau.annotation.*;
020import org.apache.juneau.json.*;
021import org.apache.juneau.rest.annotation.*;
022import org.apache.juneau.serializer.annotation.*;
023
024/**
025 * Basic configuration for a REST resource that supports JSON 5 transport.
026 *
027 * <p>
028 *    Default settings defined:
029 * </p>
030 * <ul class='spaced-list'>
031 *    <li class='ja'>{@link Rest}:
032 *       <ul>
033 *          <li class='jma'>{@link Rest#serializers() serializers}:
034 *             <ul class='javatree'>
035 *                <li class='jc'>{@link Json5Serializer}
036 *             </ul>
037 *          </li>
038 *          <li class='jma'>{@link Rest#parsers() parsers}:
039 *             <ul class='javatree'>
040 *                <li class='jc'>{@link Json5Parser}
041 *             </ul>
042 *          </li>
043 *          <li class='jma'>{@link Rest#defaultAccept() defaultAccept}:  <js>"text/json5"</js>
044 *          <li class='jma'>{@link Rest#config() config}:  <js>"$S{juneau.configFile,SYSTEM_DEFAULT}"</js>
045 *    </ul>
046 * </li>
047 *    <li class='ja'>{@link BeanConfig}:
048 *       <ul>
049 *          <li class='jma'>{@link BeanConfig#ignoreUnknownBeanProperties() ignoreUnknownBeanProperties}:  <js>"true"</js>
050 *       </ul>
051 *    </li>
052 *    <li class='ja'>{@link SerializerConfig}:
053 *       <ul>
054 *          <li class='jma'>{@link SerializerConfig#uriResolution() uriResolution}:  <js>"ROOT_RELATIVE"</js>
055 *       </ul>
056 *    </li>
057 * </ul>
058 *
059 * <p>
060 *    This annotation can be applied to REST resource classes to define common JSON default configurations:
061 * </p>
062 * <p class='bjava'>
063 *    <jc>// Used on a top-level resource.</jc>
064 *    <ja>@Rest</ja>
065 *    <jk>public class</jk> MyResource <jk>extends</jk> RestServlet <jk>implements</jk> BasicJson5Config { ... }
066 * </p>
067 * <p class='bjava'>
068 *    <jc>// Used on a child resource.</jc>
069 *    <ja>@Rest</ja>
070 *    <jk>public class</jk> MyResource <jk>extends</jk> RestObject <jk>implements</jk> BasicJson5Config { ... }
071 * </p>
072 *
073 * <p>
074 *    Note that the framework will aggregate annotations defined on all classes in the class hierarchy with
075 *    values defined on child classes overriding values defined on parent classes.  That allows any values defined
076 *    on this interface to be overridden by annotations defined on the implemented class.
077 * </p>
078 *
079 * <h5 class='section'>See Also:</h5><ul>
080 *    <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/RestAnnotatedClassBasics">@Rest-Annotated Class Basics</a>
081 * </ul>
082 */
083@Rest(
084
085   // Default serializers for all Java methods in the class.
086   serializers={
087      Json5Serializer.class,
088   },
089
090   // Default parsers for all Java methods in the class.
091   parsers={
092      Json5Parser.class,
093   },
094
095   // Optional external configuration file.
096   config="$S{juneau.configFile,SYSTEM_DEFAULT}"
097)
098public interface BasicJson5Config extends DefaultConfig {}