MVCAware.java
01 /*
02  * Copyright 2008-2014 the original author or authors.
03  *
04  * Licensed under the Apache License, Version 2.0 (the "License");
05  * you may not use this file except in compliance with the License.
06  * You may obtain a copy of the License at
07  *
08  *     http://www.apache.org/licenses/LICENSE-2.0
09  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package griffon.transform;
17 
18 import java.lang.annotation.*;
19 
20 /**
21  <p>Annotates a class.</p>
22  <p/>
23  <p>When annotating a class it indicates that it will be able to
24  * handle MVC groups, that is, instantiate them. The class will have
25  * the ability to create new instances of MVC groups, including short-lived
26  * ones.</p>
27  <p/>
28  * The following methods will be added to classes annotated with &#064;MVCAware
29  <ul>
30  <p/>
31  <li><code>public MVCGroup buildMVCGroup(String mvcType)</code></li>
32  <li><code>public MVCGroup buildMVCGroup(String mvcType, String mvcId)</code></li>
33  <li><code>public MVCGroup buildMVCGroup(Map&lt;String, Object&gt; args, String mvcType)</code></li>
34  <li><code>public MVCGroup buildMVCGroup(String mvcType, Map&lt;String, Object&gt; args)</code></li>
35  <li><code>public MVCGroup buildMVCGroup(Map&lt;String, Object&gt; args, String mvcType, String mvcId)</code></li>
36  <li><code>public MVCGroup buildMVCGroup(String mvcType, String mvcId, Map&lt;String, Object&gt; args)</code></li>
37  <li><code>public List&lt;? extends GriffonMvcArtifact&gt; createMVCGroup(String mvcType)</code></li>
38  <li><code>public List&lt;? extends GriffonMvcArtifact&gt; createMVCGroup(Map&lt;String, Object&gt; args, String mvcType)</code></li>
39  <li><code>public List&lt;? extends GriffonMvcArtifact&gt; createMVCGroup(String mvcType, Map&lt;String, Object&gt; args)</code></li>
40  <li><code>public List&lt;? extends GriffonMvcArtifact&gt; createMVCGroup(String mvcType, String mvcId)</code></li>
41  <li><code>public List&lt;? extends GriffonMvcArtifact&gt; createMVCGroup(Map&lt;String, Object&gt; args, String mvcType, String mvcId)</code></li>
42  <li><code>public List&lt;? extends GriffonMvcArtifact&gt; createMVCGroup(String mvcType, String mvcId, Map&lt;String, Object&gt; args)</code></li>
43  <li><code>public void destroyMVCGroup(String mvcId)</code></li>
44  <li><code>public void withMVCGroup(String mvcType, Closure handler)</code></li>
45  <li><code>public void withMVCGroup(String mvcType, String mvcId, Closure handler)</code></li>
46  <li><code>public void withMVCGroup(String mvcType, String mvcId, Map&lt;String, Object&gt; args, Closure handler)</code></li>
47  <li><code>public void withMVCGroup(Map&lt;String, Object&gt; args, String mvcType, String mvcId, Closure handler)</code></li>
48  <li><code>public void withMVCGroup(String mvcType, Map&lt;String, Object&gt; args, Closure handler)</code></li>
49  <li><code>public void withMVCGroup( Object&gt; args, String mvcType, Map&lt;String,Closure handler)</code></li>
50  <li><code>public &lt;M extends GriffonModel, V extends GriffonView, C extends GriffonController&gt; void withMVCGroup(String mvcType, MVCClosure&lt;M, V, C&gt; handler)</code></li>
51  <li><code>public &lt;M extends GriffonModel, V extends GriffonView, C extends GriffonController&gt; void withMVCGroup(String mvcType, String mvcId, MVCClosure&lt;M, V, C&gt; handler)</code></li>
52  <li><code>public &lt;M extends GriffonModel, V extends GriffonView, C extends GriffonController&gt; void withMVCGroup(String mvcType, String mvcId, Map&lt;String, Object&gt; args, MVCClosure&lt;M, V, C&gt; handler)</code></li>
53  <li><code>public &lt;M extends GriffonModel, V extends GriffonView, C extends GriffonController&gt; void withMVCGroup(Map&lt;String, Object&gt; args, String mvcType, String mvcId, MVCClosure&lt;M, V, C&gt; handler)</code></li>
54  <li><code>public &lt;M extends GriffonModel, V extends GriffonView, C extends GriffonController&gt; void withMVCGroup(String mvcType, Map&lt;String, Object&gt; args, MVCClosure&lt;M, V, C&gt; handler)</code></li>
55  <p/>
56  <li><code>public &lt;M extends GriffonModel, V extends GriffonView, C extends GriffonController&gt; void withMVCGroup(Map&lt;String, Object&gt; args, String mvcType, MVCClosure&lt;M, V, C&gt; handler)</code></li>
57  <p/>
58  </ul>
59  *
60  @author Andres Almiray
61  @see griffon.core.mvc.MVCHandler
62  @since 2.0.0
63  */
64 @Documented
65 @Retention(RetentionPolicy.SOURCE)
66 @Target({ElementType.TYPE})
67 public @interface MVCAware {
68 }