Skip to content
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add @Header and @headers
  • Loading branch information
maltzj authored and WonderCsabo committed Sep 21, 2015
commit 23715ea0940fcbede643ff6d4e80a5122237899f
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/**
* Copyright (C) 2010-2015 eBusiness Information, Excilys Group
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed To in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package org.androidannotations.rest.spring.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* Use on methods in {@link Rest} annotated classes to add headers to a
* particular method.
*
* <blockquote>
*
* <b>Example :</b>
*
* <pre>
* &#064;Rest(converters = MappingJacksonHttpMessageConverter.class)
* public interface MyRestClient {
*
* &#064;Header(name = &quot;keep-alive&quot;, name = &quot;300&quot;)
* &#064;Post(&quot;/test&quot;)
* void testRoute();
* }
* </pre>
*
* </blockquote>
*
* @see Headers
*/
@Retention(RetentionPolicy.CLASS)
@Target(ElementType.METHOD)
public @interface Header {
String name();

String value();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/**
* Copyright (C) 2010-2015 eBusiness Information, Excilys Group
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed To in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package org.androidannotations.rest.spring.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* Use on methods in {@link Rest} annotated classes to add multiple headers to a
* given method.
*
* <blockquote>
*
* <b>Example :</b>
*
* <pre>
* &#064;Rest(converters = MappingJacksonHttpMessageConverter.class)
* public interface MyRestClient {
*
* &#064;Headers({
* &#064;Header(name = &quot;keep-alive&quot;, value = &quot;300&quot;),
* &#064;Header(name = &quot;cache-control&quot;, value = &quot;64000&quot;)})
* &#064;Post(&quot;/test&quot;)
* void testRoute();
* }
* </pre>
*
* </blockquote>
*
* @see Header
*/
@Retention(RetentionPolicy.CLASS)
@Target(ElementType.METHOD)
public @interface Headers {
Header[] value();
}