View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.myfaces.orchestra.annotation;
20  
21  import java.lang.reflect.Method;
22  
23  import org.apache.myfaces.orchestra.conversation.annotations.ConversationName;
24  import org.apache.myfaces.orchestra.conversation.annotations.ConversationRequire;
25  import org.apache.myfaces.orchestra.viewController.annotations.ViewController;
26  
27  /**
28   * Holds information extracted out of a single bean using its annotations.
29   */
30  public class AnnotationInfo
31  {
32      private final String beanName;
33      private final Class<?> beanClass;
34  
35      private ConversationName conversationName;
36      private ConversationRequire conversationRequire;
37      private ViewController viewController;
38  
39      // Method-level annotations for viewController callbacks
40      private Method initViewMethod;
41      private Method preProcessMethod;
42      private Method preRenderViewMethod;
43  
44      public AnnotationInfo(String beanName, Class<?> beanClass)
45      {
46          this.beanName = beanName;
47          this.beanClass = beanClass;
48      }
49  
50      public String getBeanName()
51      {
52          return beanName;
53      }
54  
55      public Class<?> getBeanClass()
56      {
57          return beanClass;
58      }
59  
60      public ConversationName getConversationName()
61      {
62          return conversationName;
63      }
64  
65      public void setConversationName(ConversationName conversationName)
66      {
67          this.conversationName = conversationName;
68      }
69  
70      public ConversationRequire getConversationRequire()
71      {
72          return conversationRequire;
73      }
74  
75      public void setConversationRequire(ConversationRequire conversationRequire)
76      {
77          this.conversationRequire = conversationRequire;
78      }
79  
80      public ViewController getViewController()
81      {
82          return viewController;
83      }
84  
85      public void setViewController(ViewController viewController)
86      {
87          this.viewController = viewController;
88      }
89  
90      public Method getInitViewMethod()
91      {
92          return initViewMethod;
93      }
94  
95      public void setInitViewMethod(Method initViewMethod)
96      {
97          this.initViewMethod = initViewMethod;
98      }
99  
100     public Method getPreProcessMethod()
101     {
102         return preProcessMethod;
103     }
104 
105     public void setPreProcessMethod(Method preProcessMethod)
106     {
107         this.preProcessMethod = preProcessMethod;
108     }
109 
110     public Method getPreRenderViewMethod()
111     {
112         return preRenderViewMethod;
113     }
114 
115     public void setPreRenderViewMethod(Method preRenderViewMethod)
116     {
117         this.preRenderViewMethod = preRenderViewMethod;
118     }
119 }