KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > web > jsf > impl > facesmodel > FacesConfigImpl


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.web.jsf.impl.facesmodel;
21
22
23 import java.util.List JavaDoc;
24 import org.netbeans.modules.web.jsf.api.facesmodel.Converter;
25 import org.netbeans.modules.web.jsf.api.facesmodel.FacesConfig;
26 import org.netbeans.modules.web.jsf.api.facesmodel.JSFConfigVisitor;
27 import org.netbeans.modules.web.jsf.api.facesmodel.ManagedBean;
28 import org.netbeans.modules.web.jsf.api.facesmodel.NavigationRule;
29 import org.w3c.dom.Element JavaDoc;
30
31 /**
32  *
33  * @author Petr Pisl
34  */

35 public class FacesConfigImpl extends JSFConfigComponentImpl implements FacesConfig{
36     
37     /** Creates a new instance of FacesConfigImpl */
38     public FacesConfigImpl(JSFConfigModelImpl model, Element JavaDoc element) {
39         super(model, element);
40     }
41     
42     public FacesConfigImpl(JSFConfigModelImpl model) {
43         this(model, createElementNS(model, JSFConfigQNames.FACES_CONFIG));
44     }
45     
46     public List JavaDoc<ManagedBean> getManagedBeans() {
47         return getChildren(ManagedBean.class);
48     }
49     
50     public void addManagedBean(ManagedBean bean) {
51         appendChild(MANAGED_BEAN, bean);
52     }
53     
54     public void addManagedBean(int index, ManagedBean bean) {
55         insertAtIndex(MANAGED_BEAN, bean, index, ManagedBean.class);
56     }
57     
58     public void removeManagedBean(ManagedBean bean) {
59         removeChild(MANAGED_BEAN, bean);
60     }
61     
62     public List JavaDoc<NavigationRule> getNavigationRules() {
63         return getChildren(NavigationRule.class);
64     }
65     
66     public void addNavigationRule(NavigationRule rule) {
67         appendChild(NAVIGATION_RULE, rule);
68     }
69     
70     public void addNavigationRule(int index, NavigationRule rule) {
71         insertAtIndex(NAVIGATION_RULE, rule, index, NavigationRule.class);
72     }
73     public void removeNavigationRule(NavigationRule rule) {
74         removeChild(NAVIGATION_RULE, rule);
75     }
76     
77     public List JavaDoc<Converter> getConverters() {
78         return getChildren(Converter.class);
79     }
80     
81     public void addConverter(Converter converter) {
82         appendChild(CONVERTER, converter);
83     }
84     
85     public void addConverter(int index, Converter converter) {
86         insertAtIndex(CONVERTER, converter, index, NavigationRule.class);
87     }
88     
89     public void removeConverter(Converter converter) {
90         removeChild(CONVERTER, converter);
91     }
92     
93     public void accept(JSFConfigVisitor visitor) {
94         visitor.visit(this);
95     }
96 }
97
Popular Tags