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.remoteable; 014 015import static java.lang.annotation.ElementType.*; 016import static java.lang.annotation.RetentionPolicy.*; 017 018import java.lang.annotation.*; 019 020import org.apache.juneau.httppart.*; 021import org.apache.juneau.urlencoding.*; 022 023/** 024 * @deprecated Use {@link org.apache.juneau.http.annotation.Query} 025 */ 026@Deprecated 027@Documented 028@Target({PARAMETER,FIELD,METHOD}) 029@Retention(RUNTIME) 030@Inherited 031public @interface Query { 032 033 /** 034 * The query parameter name. 035 * 036 * <p> 037 * Note that {@link #name()} and {@link #value()} are synonyms. 038 * 039 * <p> 040 * The value should be either <js>"*"</js> to represent multiple name/value pairs, or a label that defines the 041 * query parameter name. 042 * 043 * <p> 044 * A blank value (the default) has the following behavior: 045 * <ul class='spaced-list'> 046 * <li> 047 * If the data type is <code>NameValuePairs</code>, <code>Map</code>, or a bean, 048 * then it's the equivalent to <js>"*"</js> which will cause the value to be serialized as name/value pairs. 049 * 050 * <h5 class='figure'>Example:</h5> 051 * <p class='bcode'> 052 * <jc>// When used on a remote method parameter</jc> 053 * <ja>@Remoteable</ja>(path=<js>"/myproxy"</js>) 054 * <jk>public interface</jk> MyProxy { 055 * 056 * <jc>// Equivalent to @Query("*")</jc> 057 * <ja>@RemoteMethod</ja>(path=<js>"/mymethod"</js>) 058 * String myProxyMethod1(<ja>@Query</ja> Map<String,Object> formData); 059 * } 060 * 061 * <jc>// When used on a request bean method</jc> 062 * <jk>public interface</jk> MyRequestBean { 063 * 064 * <jc>// Equivalent to @Query("*")</jc> 065 * <ja>@Query</ja> 066 * Map<String,Object> getFoo(); 067 * } 068 * </p> 069 * </li> 070 * <li> 071 * If used on a request bean method, uses the bean property name. 072 * 073 * <h5 class='figure'>Example:</h5> 074 * <p class='bcode'> 075 * <jk>public interface</jk> MyRequestBean { 076 * 077 * <jc>// Equivalent to @Query("foo")</jc> 078 * <ja>@Query</ja> 079 * String getFoo(); 080 * } 081 * </p> 082 * </li> 083 * </ul> 084 */ 085 String name() default ""; 086 087 /** 088 * A synonym for {@link #name()}. 089 * 090 * <p> 091 * Allows you to use shortened notation if you're only specifying the name. 092 */ 093 String value() default ""; 094 095 /** 096 * Skips this value if it's an empty string or empty collection/array. 097 * 098 * <p> 099 * Note that <jk>null</jk> values are already ignored. 100 */ 101 boolean skipIfEmpty() default false; 102 103 /** 104 * Specifies the {@link HttpPartSerializer} class used for serializing values to strings. 105 * 106 * <p> 107 * The default value defaults to the using the part serializer defined on the {@link RequestBean @RequestBean} annotation, 108 * then on the client which by default is {@link UrlEncodingSerializer}. 109 * 110 * <p> 111 * This annotation is provided to allow values to be custom serialized. 112 */ 113 Class<? extends HttpPartSerializer> serializer() default HttpPartSerializer.Null.class; 114}