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.Path} 025 */ 026@Deprecated 027@Documented 028@Target({PARAMETER,FIELD,METHOD}) 029@Retention(RUNTIME) 030@Inherited 031public @interface Path { 032 033 /** 034 * The path 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 * path variable 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 treated 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 @Path("*")</jc> 057 * <ja>@RemoteMethod</ja>(path=<js>"/mymethod/{foo}/{bar}"</js>) 058 * String myProxyMethod1(<ja>@FormData</ja> Map<String,Object> pathVars); 059 * } 060 * 061 * <jc>// When used on a request bean method</jc> 062 * <jk>public interface</jk> MyRequestBean { 063 * 064 * <jc>// Equivalent to @Path("*")</jc> 065 * <ja>@Path</ja> 066 * Map<String,Object> getPathVars(); 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 @Path("foo")</jc> 078 * <ja>@Path</ja> 079 * String getFoo(); 080 * } 081 * </ul> 082 */ 083 String name() default ""; 084 085 /** 086 * A synonym for {@link #name()}. 087 * 088 * <p> 089 * Allows you to use shortened notation if you're only specifying the name. 090 */ 091 String value() default ""; 092 093 /** 094 * Specifies the {@link HttpPartSerializer} class used for serializing values to strings. 095 * 096 * <p> 097 * The default value defaults to the using the part serializer defined on the {@link RequestBean @RequestBean} annotation, 098 * then on the client which by default is {@link UrlEncodingSerializer}. 099 * 100 * <p> 101 * This annotation is provided to allow values to be custom serialized. 102 */ 103 Class<? extends HttpPartSerializer> serializer() default HttpPartSerializer.Null.class; 104}