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.impl.digester.elements;
20  
21  import java.util.ArrayList;
22  import java.util.HashMap;
23  import java.util.List;
24  import java.util.Map;
25  
26  /**
27   * @author <a href="mailto:oliver@rossmueller.com">Oliver Rossmueller</a>
28   */
29  public class FacesConfig
30  {
31  
32      private List<Application> applications = new ArrayList<Application>();
33      private List<Factory> factories = new ArrayList<Factory>();
34      private Map<String, String> components = new HashMap<String, String>();
35      private List<Converter> converters = new ArrayList<Converter>();
36      private List<ManagedBean> managedBeans = new ArrayList<ManagedBean>();
37      private List<NavigationRule> navigationRules = new ArrayList<NavigationRule>();
38      private List<RenderKit> renderKits = new ArrayList<RenderKit>();
39      private List<String> lifecyclePhaseListener = new ArrayList<String>();
40      private Map<String, String> validators = new HashMap<String, String>();
41  
42      public void addApplication(Application application)
43      {
44          applications.add(application);
45      }
46  
47      public void addFactory(Factory factory)
48      {
49          factories.add(factory);
50      }
51  
52      public void addComponent(String componentType, String componentClass)
53      {
54          components.put(componentType, componentClass);
55      }
56  
57      public void addConverter(Converter converter)
58      {
59          converters.add(converter);
60      }
61  
62      public void addManagedBean(ManagedBean bean)
63      {
64          managedBeans.add(bean);
65      }
66  
67      public void addNavigationRule(NavigationRule rule)
68      {
69          navigationRules.add(rule);
70      }
71  
72      public void addRenderKit(RenderKit renderKit)
73      {
74          renderKits.add(renderKit);
75      }
76  
77      public void addLifecyclePhaseListener(String value)
78      {
79          lifecyclePhaseListener.add(value);
80      }
81  
82      public void addValidator(String id, String validatorClass)
83      {
84          validators.put(id, validatorClass);
85      }
86  
87      public List<Application> getApplications()
88      {
89          return applications;
90      }
91  
92      public List<Factory> getFactories()
93      {
94          return factories;
95      }
96  
97      public Map<String, String> getComponents()
98      {
99          return components;
100     }
101 
102     public List<Converter> getConverters()
103     {
104         return converters;
105     }
106 
107     public List<ManagedBean> getManagedBeans()
108     {
109         return managedBeans;
110     }
111 
112     public List<NavigationRule> getNavigationRules()
113     {
114         return navigationRules;
115     }
116 
117     public List<RenderKit> getRenderKits()
118     {
119         return renderKits;
120     }
121 
122     public List<String> getLifecyclePhaseListener()
123     {
124         return lifecyclePhaseListener;
125     }
126 
127     public Map<String, String> getValidators()
128     {
129         return validators;
130     }
131 }