001package ca.uhn.fhir.rest.annotation; 002 003/* 004 * #%L 005 * HAPI FHIR - Core Library 006 * %% 007 * Copyright (C) 2014 - 2017 University Health Network 008 * %% 009 * Licensed under the Apache License, Version 2.0 (the "License"); 010 * you may not use this file except in compliance with the License. 011 * You may obtain a copy of the License at 012 * 013 * http://www.apache.org/licenses/LICENSE-2.0 014 * 015 * Unless required by applicable law or agreed to in writing, software 016 * distributed under the License is distributed on an "AS IS" BASIS, 017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 018 * See the License for the specific language governing permissions and 019 * limitations under the License. 020 * #L% 021 */ 022 023import java.lang.annotation.ElementType; 024import java.lang.annotation.Retention; 025import java.lang.annotation.RetentionPolicy; 026import java.lang.annotation.Target; 027 028import ca.uhn.fhir.rest.server.IResourceProvider; 029 030/** 031 * Denotes a parameter for a REST method which will contain the resource actually 032 * being created/updated/etc in an operation which contains a resource in the HTTP request. 033 * <p> 034 * For example, in a {@link Create} operation the method parameter annotated with this 035 * annotation will contain the actual resource being created. 036 * </p> 037 * <p> 038 * Parameters with this annotation should typically be of the type of resource being 039 * operated on (see below for an exception when raw data is required). For example, in a 040 * {@link IResourceProvider} for Patient resources, the parameter annotated with this 041 * annotation should be of type Patient. 042 * </p> 043 * <p> 044 * Note that in servers it is also acceptable to have parameters with this annotation 045 * which are of type {@link String} or of type <code>byte[]</code>. Parameters of 046 * these types will contain the raw/unparsed HTTP request body. It is fine to 047 * have multiple parameters with this annotation, so you can have one parameter 048 * which accepts the parsed resource, and another which accepts the raw request. 049 * </p> 050 */ 051@Target(value=ElementType.PARAMETER) 052@Retention(RetentionPolicy.RUNTIME) 053public @interface ResourceParam { 054 055}