1   /*
2    * Copyright 2003 - 2013 The eFaps Team
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   *
16   * Revision:        $Rev$
17   * Last Changed:    $Date$
18   * Last Changed By: $Author$
19   */
20  
21  package org.efaps.update.schema.user;
22  
23  import java.net.URL;
24  import java.util.List;
25  import java.util.Map;
26  
27  import org.efaps.update.AbstractUpdate;
28  import org.efaps.util.EFapsException;
29  
30  /**
31   * @author The eFaps Team
32   * @version $Id$
33   */
34  public class CompanyUpdate
35      extends AbstractUpdate
36  {
37      /**
38       *
39       * @param _url URL of the file
40       */
41      public CompanyUpdate(final URL _url)
42      {
43          super(_url, "Admin_User_Company");
44      }
45  
46      /**
47       * Creates new instance of class {@link CompanyDefinition}.
48       *
49       * @return new definition instance
50       * @see CompanyDefinition
51       */
52      @Override
53      protected AbstractDefinition newDefinition()
54      {
55          return new CompanyDefinition();
56      }
57  
58  
59      /**
60       *
61       */
62      public class CompanyDefinition
63          extends AbstractDefinition
64      {
65          @Override
66          protected void readXML(final List<String> _tags,
67                                 final Map<String, String> _attributes,
68                                 final String _text)
69              throws EFapsException
70          {
71              final String value = _tags.get(0);
72              if ("status".equals(value)) {
73                  addValue("Status", _text);
74              } else {
75                  super.readXML(_tags, _attributes, _text);
76              }
77          }
78      }
79  }