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.msgpack.annotation; 014 015import static java.lang.annotation.ElementType.*; 016import static java.lang.annotation.RetentionPolicy.*; 017 018import java.lang.annotation.*; 019 020import org.apache.juneau.annotation.*; 021import org.apache.juneau.msgpack.*; 022import org.apache.juneau.serializer.*; 023 024/** 025 * Annotation for specifying config properties defined in {@link MsgPackSerializer} and {@link MsgPackParser}. 026 * 027 * <p> 028 * Used primarily for specifying bean configuration properties on REST classes and methods. 029 */ 030@Documented 031@Target({TYPE,METHOD}) 032@Retention(RUNTIME) 033@Inherited 034@PropertyStoreApply(MsgPackConfigApply.class) 035public @interface MsgPackConfig { 036 037 //------------------------------------------------------------------------------------------------------------------- 038 // MsgPackSerializer 039 //------------------------------------------------------------------------------------------------------------------- 040 041 /** 042 * Configuration property: Add <js>"_type"</js> properties when needed. 043 * 044 * <p> 045 * If <js>"true"</js>, then <js>"_type"</js> properties will be added to beans if their type cannot be inferred 046 * through reflection. 047 * 048 * <p> 049 * When present, this value overrides the {@link Serializer#SERIALIZER_addBeanTypes} setting and is 050 * provided to customize the behavior of specific serializers in a {@link SerializerGroup}. 051 * 052 * <ul class='notes'> 053 * <li> 054 * Possible values: 055 * <ul> 056 * <li><js>"true"</js> 057 * <li><js>"false"</js> (default) 058 * </ul> 059 * <li> 060 * Supports {@doc DefaultSvlVariables} (e.g. <js>"$C{myConfigVar}"</js>). 061 * <li> 062 * A default global value can be set via the system property <js>"MsgPackSerializer.addBeanTypes.b"</js>. 063 * </ul> 064 * 065 * <ul class='seealso'> 066 * <li class='jf'>{@link MsgPackSerializer#MSGPACK_addBeanTypes} 067 * </ul> 068 */ 069 String addBeanTypes() default ""; 070}