Spring Annotation (java.lang.annotation) 관련 내용 모음.

ITWeb/개발일반 2012. 3. 15. 10:49
[참고문서]

Package org.springframework.beans.factory.annotation

Support package for annotation-driven bean configuration. 
Annotation Types Summary
Autowired Marks a constructor, field, setter method or config method as to be autowired by Spring's dependency injection facilities.
Configurable Marks a class as being eligible for Spring-driven configuration.
Qualifier This annotation may be used on a field or parameter as a qualifier for candidate beans when autowiring.
Required Marks a method (typically a JavaBean setter method) as being 'required': that is, the setter method must be configured to be dependency-injected with a value.
Value Annotation at the field or method/constructor parameter level that indicates a default value expression for the affected argument.

Package org.springframework.context.annotation

Annotation support for the Application Context, including JSR-250 "common" annotations, component-scanning, and Java-based metadata for creating Spring-managed objects 
Annotation Types Summary
Bean Indicates that a method produces a bean to be managed by the Spring container.
ComponentScan Configures component scanning directives for use with @Configuration classes.
ComponentScan.Filter Declares the type filter to be used as an include filter or exclude filter.
Configuration Indicates that a class declares one or more @Bean methods and may be processed by the Spring container to generate bean definitions and service requests for those beans at runtime, for example:
 @Configuration
 public class AppConfig {
     @Bean
     public MyBean myBean() {
         // instantiate, configure and return bean ...
DependsOn Beans on which the current bean depends.
EnableAspectJAutoProxy Enables support for handling components marked with AspectJ's @Aspect annotation, similar to functionality found in Spring's <aop:aspectj-autoproxy> XML element.
EnableLoadTimeWeaving Activates a Spring LoadTimeWeaver for this application context, available as a bean with the name "loadTimeWeaver", similar to the <context:load-time-weaver> element in Spring XML.
Import Indicates one or more @Configuration classes to import.
ImportResource Indicates one or more resources containing bean definitions to import.
Lazy Indicates whether a bean is to be lazily initialized.
Primary Indicates that a bean should be given preference when multiple candidates are qualified to autowire a single-valued dependency.
Profile Indicates that a component is eligible for registration when one or more specified profiles are active.
PropertySource Annotation providing a convenient and declarative mechanism for adding a PropertySource to Spring's Environment.
Role Indicates the 'role' hint for a given bean.
Scope When used as a type-level annotation in conjunction with the Component annotation, indicates the name of a scope to use for instances of the annotated type.

Package org.springframework.core.annotation

Core support package for Java 5 annotations 
Annotation Types Summary
Order Annotation that defines ordering.

Package org.springframework.format.annotation

Annotations for declaratively configuring field formatting rules 
Annotation Types Summary
DateTimeFormat Declares that a field should be formatted as a date time.
NumberFormat Declares that a field should be formatted as a number.

Package org.springframework.jmx.export.annotation

JDK 1.5+ annotations for MBean exposure 
Annotation Types Summary
ManagedAttribute JDK 1.5+ method-level annotation that indicates to expose a given bean property as JMX attribute, corresponding to the ManagedAttribute attribute.
ManagedMetric JDK 1.5+ method-level annotation that indicates to expose a given bean property as JMX attribute, with added Descriptor properties to indicate that it is a metric.
ManagedNotification JDK 1.5+ method-level annotation that indicates a JMX notification emitted by a bean.
ManagedNotifications JDK 1.5+ method-level annotation that indicates JMX notifications emitted by a bean, containing multiple ManagedNotifications
ManagedOperation JDK 1.5+ method-level annotation that indicates to expose a given method as JMX operation, corresponding to the ManagedOperation attribute.
ManagedOperationParameter JDK 1.5+ method-level annotation used to provide metadata about operation parameters, corresponding to a ManagedOperationParameter attribute.
ManagedOperationParameters JDK 1.5+ method-level annotation used to provide metadata about operation parameters, corresponding to an array of ManagedOperationParameter attributes.
ManagedResource JDK 1.5+ class-level annotation that indicates to register instances of a class with a JMX server, corresponding to the ManagedResource attribute.

Package org.springframework.scheduling.annotation

JDK 1.5+ annotation for asynchronous method execution 
Class Summary
AbstractAsyncConfiguration Abstract base Configuration class providing common structure for enabling Spring's asynchronous method execution capability.
AsyncAnnotationAdvisor Advisor that activates asynchronous method execution through the Async annotation.
AsyncAnnotationBeanPostProcessor Bean post-processor that automatically applies asynchronous invocation behavior to any bean that carries the Async annotation at class or method-level by adding a corresponding AsyncAnnotationAdvisor to the exposed proxy (either an existing AOP proxy or a newly generated proxy that implements all of the target's interfaces).
AsyncConfigurationSelector Selects which implementation of AbstractAsyncConfiguration should be used based on the value of EnableAsync.mode() on the importing @Configuration class.
AsyncResult<V> A pass-through Future handle that can be used for method signatures which are declared with a Future return type for asynchronous execution.
ProxyAsyncConfiguration @Configuration class that registers the Spring infrastructure beans necessary to enable proxy-based asynchronous method execution.
ScheduledAnnotationBeanPostProcessor Bean post-processor that registers methods annotated with @Scheduled to be invoked by a TaskScheduler according to the "fixedRate", "fixedDelay", or "cron" expression provided via the annotation.
SchedulingConfiguration @Configuration class that registers a ScheduledAnnotationBeanPostProcessor bean capable of processing Spring's @Scheduled annotation.

Package org.springframework.test.annotation

Support classes for annotation-driven tests 
Annotation Types Summary
DirtiesContext Test annotation which indicates that the ApplicationContext associated with a test is dirty and should be closed: after the current test, when declared at the method level after each test method in the current test class, when declared at the class level with class mode set to AFTER_EACH_TEST_METHOD after the current test class, when declared at the class level with class mode set to AFTER_CLASS
ExpectedException Deprecated. as of Spring 3.1 in favor of using built-in support for declaring expected exceptions in the underlying testing framework (e.g., JUnit, TestNG, etc.)
IfProfileValue Test annotation to indicate that a test is enabled for a specific testing profile or environment.
NotTransactional Deprecated. as of Spring 3.0, in favor of moving the non-transactional test method to a separate (non-transactional) test class or to a @BeforeTransaction or @AfterTransaction method.
ProfileValueSourceConfiguration ProfileValueSourceConfiguration is a class-level annotation which is used to specify what type of ProfileValueSource to use when retrieving profile values configured via the @IfProfileValue annotation.
Repeat Test annotation to indicate that a test method should be invoked repeatedly.
Rollback Test annotation to indicate whether or not the transaction for the annotated test method should be rolled back after the test method has completed.
Timed Test-specific annotation to indicate that a test method has to finish execution in a specified time period.

Package org.springframework.transaction.annotation

JDK 1.5+ annotation for transaction demarcation 
Annotation Types Summary
EnableTransactionManagement Enables Spring's annotation-driven transaction management capability, similar to the support found in Spring's <tx:*> XML namespace.
Transactional Describes transaction attributes on a method or class.

Package org.springframework.validation.annotation

Support classes for annotation-based constraint evaluation, e.g 
Annotation Types Summary
Validated Variant of JSR-303's Valid, supporting the specification of validation groups.

Package org.springframework.web.bind.annotation

Annotations for binding requests to controllers and handler methods as well as for binding request parameters to method arguments 
Annotation Types Summary
CookieValue Annotation which indicates that a method parameter should be bound to an HTTP cookie.
ExceptionHandler Annotation for handling exceptions in specific handler classes and/or handler methods.
InitBinder Annotation that identifies methods which initialize the WebDataBinder which will be used for populating command and form object arguments of annotated handler methods.
Mapping Meta annotation that indicates a web mapping annotation.
ModelAttribute Annotation that binds a method parameter or method return value to a named model attribute, exposed to a web view.
PathVariable Annotation which indicates that a method parameter should be bound to a URI template variable.
RequestBody Annotation indicating a method parameter should be bound to the body of the web request.
RequestHeader Annotation which indicates that a method parameter should be bound to a web request header.
RequestMapping Annotation for mapping web requests onto specific handler classes and/or handler methods.
RequestParam Annotation which indicates that a method parameter should be bound to a web request parameter.
RequestPart Annotation that can be used to associate the part of a "multipart/form-data" request with a method argument.
ResponseBody Annotation which indicates that a method return value should be bound to the web response body.
ResponseStatus Marks a method or exception class with the status code and reason that should be returned.
SessionAttributes Annotation that indicates the session attributes that a specific handler uses.

Package org.springframework.web.portlet.bind.annotation

Annotations for binding portlet requests to handler methods 
Annotation Types Summary
ActionMapping Annotation for mapping Portlet action requests onto handler methods.
EventMapping Annotation for mapping Portlet event requests onto handler methods.
RenderMapping Annotation for mapping Portlet render requests onto handler methods.
ResourceMapping Annotation for mapping Portlet resource requests onto handler methods.

Package org.springframework.web.servlet.config.annotation

Annotation-based setup for Spring MVC 
Annotation Types Summary
EnableWebMvc Add this annotation to an @Configuration class to have the Spring MVC configuration defined in WebMvcConfigurationSupport imported:
 @Configuration
 @EnableWebMvc
 @ComponentScan(basePackageClasses = { MyConfiguration.class })
 public class MyWebConfiguration {

 }

Package org.springframework.stereotype

Annotations denoting the roles of types or methods in the overall architecture (at a conceptual, rather than implementation, level) 
Annotation Types Summary
Component Indicates that an annotated class is a "component".
Controller Indicates that an annotated class is a "Controller" (e.g.
Repository Indicates that an annotated class is a "Repository", originally defined by Domain-Driven Design (Evans, 2003) as "a mechanism for encapsulating storage, retrieval, and search behavior which emulates a collection of objects".
Service Indicates that an annotated class is a "Service", originally defined by Domain-Driven Design (Evans, 2003) as "an operation offered as an interface that stands alone in the model, with no encapsulated state."


Package java.lang.annotation

Provides library support for the Java programming language annotation facility.
Annotation Types Summary
Documented Indicates that annotations with a type are to be documented by javadoc and similar tools by default.
Inherited Indicates that an annotation type is automatically inherited.
Retention Indicates how long annotations with the annotated type are to be retained.
Target Indicates the kinds of program element to which an annotation type is applicable.
 
: