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  
20  package org.apache.myfaces.view.facelets.bean;
21  
22  public class Example {
23      
24      private static String[] Departments = new String[] { "HR", "RD" };
25  
26      public Example() {
27          super();
28      }
29      
30      public static Company createCompany() {
31          Company c = new Company();
32          c.setName("Enverio");
33          c.setPresident(new Employee(1, "Hookom", "Jacob", true));
34          c.getDepartments().add(createHR());
35          c.getDepartments().add(createRD());
36          return c;
37      }
38      
39      public static Department createDepartment() {
40          return createRD();
41      }
42      
43      public static Department createHR() {
44          Department d = new Department();
45          d.setDirector(new Employee(2, "Ashenbrener", "Aubrey", true));
46          d.setName("HR");
47          d.getEmployees().add(new Employee(3, "Ellen", "Sue", false));
48          d.getEmployees().add(new Employee(4, "Scooner", "Mary", false));
49          return d;
50      }
51      
52      public static Department createRD() {
53          Department d = new Department();
54          d.setDirector(new Employee(5, "Winer", "Adam", true));
55          d.setName("RD");
56          d.getEmployees().add(new Employee(6, "Burns", "Ed", false));
57          d.getEmployees().add(new Employee(7, "Lubke", "Ryan", false));
58          d.getEmployees().add(new Employee(8, "Kitain", "Roger", false));
59          return d;
60      }
61  
62  }