View Javadoc

1   /**
2    * Project MI+
3    *
4    * Copyright (c) 2013, Syed Muhammad Humayun - smhumayun@gmail.com
5    *
6    * This project includes software developed by Syed Muhammad Humayun - smhumayun@gmail.com
7    * http://www.smhumayun.com
8    *
9    * Licensed under the Apache License, Version 2.0 (the
10   * "License"); you may not use this file except in compliance
11   * with the License. You may obtain a copy of the License at:
12   *
13   * http://www.apache.org/licenses/LICENSE-2.0
14   *
15   * Unless required by applicable law or agreed to in writing,
16   * software distributed under the License is distributed on
17   * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18   * KIND, either express or implied. See the License for the
19   * specific language governing permissions and limitations
20   * under the License.
21   */
22  package com.smhumayun.mi_plus;
23  
24  import java.lang.annotation.ElementType;
25  import java.lang.annotation.Retention;
26  import java.lang.annotation.RetentionPolicy;
27  import java.lang.annotation.Target;
28  
29  /**
30   * Project MI+'s custom annotation to enable MI support
31   *
32   * @author smhumayun
33   * @since 1.0
34   */
35  
36  @Target(ElementType.TYPE)
37  @Retention(RetentionPolicy.RUNTIME)
38  public @interface MISupport {
39  
40      /**
41       * Parent classes to extend from
42       *  - Only concrete classes are allowed; no interfaces or abstract classes
43       *  - Nested classes are not allowed (why? http://codeoftheday.blogspot.com/2013/07/no-arguments-default-constructor-and.html)
44       *  - Order of the classes matters, depending upon the selected {@link MIMethodResolver}
45       *
46       * @return parent classes to extend from
47       */
48      Class[] parentClasses();
49  
50      /**
51       * Scope for container and composed objects
52       *  - Default is {@link MIObjectScope#SINGLETON_CONTAINER_SINGLETON_COMPOSED}
53       *
54       * @return scope for container and composed objects
55       * @see {@link MIObjectScope}
56       */
57      MIObjectScope scope() default MIObjectScope.SINGLETON_CONTAINER_SINGLETON_COMPOSED;
58  
59  }