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