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