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.marshall.yaml.*; 020import org.apache.juneau.rest.server.*; 021 022/** 023 * Basic configuration for a REST resource that supports YAML transport. 024 * 025 * <p> 026 * Default settings defined: 027 * </p> 028 * <ul class='spaced-list'> 029 * <li class='ja'>{@link Rest}: 030 * <ul> 031 * <li class='jma'>{@link Rest#serializers() serializers}: 032 * <ul class='javatree'> 033 * <li class='jc'>{@link YamlSerializer} 034 * </ul> 035 * </li> 036 * <li class='jma'>{@link Rest#parsers() parsers}: 037 * <ul class='javatree'> 038 * <li class='jc'>{@link YamlParser} 039 * </ul> 040 * </li> 041 * <li class='jma'>{@link Rest#defaultAccept() defaultAccept}: <js>"application/yaml"</js> 042 * </ul> 043 * </li> 044 * </ul> 045 * 046 * <p> 047 * This annotation can be applied to REST resource classes to define common YAML default configurations: 048 * </p> 049 * <p class='bjava'> 050 * <jc>// Used on a top-level resource.</jc> 051 * <ja>@Rest</ja> 052 * <jk>public class</jk> MyResource <jk>extends</jk> RestServlet <jk>implements</jk> BasicYamlConfig { ... } 053 * </p> 054 * 055 * <h5 class='section'>See Also:</h5><ul> 056 * <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/RestAnnotatedClasses">@Rest-Annotated Class</a> 057 * </ul> 058 */ 059// @formatter:off 060@Rest( 061 062 // Default serializers for all Java methods in the class. 063 serializers={ 064 YamlSerializer.class, 065 }, 066 067 // Default parsers for all Java methods in the class. 068 parsers={ 069 YamlParser.class, 070 }, 071 072 defaultAccept="application/yaml" 073) 074public interface BasicYamlConfig extends DefaultConfig {}