Created
April 15, 2016 13:50
-
-
Save lazygarage/d136e269069d933bf72e2055b6b80d20 to your computer and use it in GitHub Desktop.
CustomAnnotationExample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.lang.annotation.ElementType; | |
import java.lang.annotation.Retention; | |
import java.lang.annotation.RetentionPolicy; | |
import java.lang.annotation.Target; | |
import io.swagger.annotations.Extension; | |
@Target(ElementType.METHOD) | |
@Retention(RetentionPolicy.RUNTIME) | |
public @interface AwsExtension { | |
/** | |
* An option name for these extensions. | |
* | |
* @return an option name for these extensions - will be prefixed with "x-" | |
*/ | |
String name() default ""; | |
/** | |
* The aws extension properties. | |
* | |
* @return the aws extension properties | |
* @see AwsExtensionProperty | |
*/ | |
AwsExtensionProperty[] properties(); | |
/** | |
* The extensions | |
* @return the actual extension | |
* @see Extension | |
*/ | |
Extension[] extensions() default {}; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Target(ElementType.ANNOTATION_TYPE) | |
@Retention(RetentionPolicy.RUNTIME) | |
public @interface AwsExtensionProperty { | |
/** | |
* The name of the property. | |
* | |
* @return the name of the property | |
*/ | |
String name(); | |
/** | |
* The value of the property. | |
* | |
* @return the value of the property | |
*/ | |
String value(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to make these annotations work.
after add,nothing happened!
Thanks in advance!
Tang.chen