Skip to content

Instantly share code, notes, and snippets.

@lazygarage
Created April 15, 2016 13:50
Show Gist options
  • Save lazygarage/d136e269069d933bf72e2055b6b80d20 to your computer and use it in GitHub Desktop.
Save lazygarage/d136e269069d933bf72e2055b6b80d20 to your computer and use it in GitHub Desktop.
CustomAnnotationExample
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 {};
}
@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();
}
@helloworldtang
Copy link

helloworldtang commented Dec 29, 2016

How to make these annotations work.

after add,nothing happened!

Thanks in advance!
Tang.chen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment