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.config.element;
20  
21  import java.io.Serializable;
22  import java.util.Collection;
23  
24  import javax.el.ValueExpression;
25  import javax.faces.context.FacesContext;
26  
27  /**
28   * @author Manfred Geiler (latest modification by $Author$)
29   * @version $Revision$ $Date$
30   */
31  public abstract class ManagedBean implements Serializable
32  {
33      // <!ELEMENT managed-bean (description*, display-name*, icon*, managed-bean-name, managed-bean-class,
34      // managed-bean-scope, (managed-property* | map-entries | list-entries))>
35  
36      public static final int INIT_MODE_NO_INIT = 0;
37      public static final int INIT_MODE_PROPERTIES = 1;
38      public static final int INIT_MODE_MAP = 2;
39      public static final int INIT_MODE_LIST = 3;
40  
41      public abstract String getDescription();
42      public abstract String getManagedBeanName();
43      public abstract String getManagedBeanClassName();
44      public abstract Class<?> getManagedBeanClass();
45      public abstract String getManagedBeanScope();
46      
47      public abstract int getInitMode();
48  
49      /**
50       * @return Iterator over {@link ManagedProperty} entries
51       */
52      public abstract Collection<? extends ManagedProperty> getManagedProperties();
53  
54      public abstract MapEntries getMapEntries();
55  
56      public abstract ListEntries getListEntries();
57      
58      /**
59       * Is the value of managed-bean-scope a EL ValueExpression?
60       * @since 2.0
61       * @return
62       */
63      public abstract boolean isManagedBeanScopeValueExpression();
64      
65      /**
66       * Returns the ValueExpression for managed-bean-scope
67       * or null, if managed-bean-scope is literal.
68       * @param facesContext
69       * @since 2.0
70       * @return
71       */
72      public abstract ValueExpression getManagedBeanScopeValueExpression(FacesContext facesContext);
73      
74      /**
75       * Returns the value of the eager attribute. Default is false.
76       * @since 2.0
77       * @return
78       */
79      public abstract String getEager();
80      
81  }