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.http.annotation; 014 015import java.lang.annotation.*; 016 017import org.apache.juneau.httppart.*; 018 019/** 020 * A concrete implementation of the {@link Request} annotation. 021 */ 022public class RequestAnnotation implements Request { 023 024 private Class<? extends HttpPartSerializer> serializer = HttpPartSerializer.Null.class; 025 private Class<? extends HttpPartParser> parser = HttpPartParser.Null.class; 026 027 @Override /* Annotation */ 028 public Class<? extends Annotation> annotationType() { 029 return Request.class; 030 } 031 032 @Override /* Request */ 033 public Class<? extends HttpPartSerializer> serializer() { 034 return serializer; 035 } 036 037 /** 038 * Sets the <c>serializer</c> property on this annotation. 039 * 040 * @param value The new value for this property. 041 * @return This object (for method chaining). 042 */ 043 public RequestAnnotation serializer(Class<? extends HttpPartSerializer> value) { 044 this.serializer = value; 045 return this; 046 } 047 048 @Override /* Request */ 049 public Class<? extends HttpPartParser> parser() { 050 return parser; 051 } 052 053 /** 054 * Sets the <c>parser</c> property on this annotation. 055 * 056 * @param value The new value for this property. 057 * @return This object (for method chaining). 058 */ 059 public RequestAnnotation parser(Class<? extends HttpPartParser> value) { 060 this.parser = value; 061 return this; 062 } 063}