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.io.Serializable;
22  import java.util.ArrayList;
23  import java.util.Collection;
24  import java.util.Collections;
25  import java.util.List;
26  
27  
28  /**
29   * @author <a href="mailto:oliver@rossmueller.com">Oliver Rossmueller</a>
30   */
31  public class Converter extends org.apache.myfaces.config.element.Converter implements Serializable
32  {
33  
34      private String converterId;
35      private String forClass;
36      private String converterClass;
37      private List<org.apache.myfaces.config.element.Property> _properties = null;
38      private List<org.apache.myfaces.config.element.Attribute> _attributes = null;
39  
40  
41      public String getConverterId()
42      {
43          return converterId;
44      }
45  
46  
47      public void setConverterId(String converterId)
48      {
49          this.converterId = converterId;
50      }
51  
52  
53      public String getForClass()
54      {
55          return forClass;
56      }
57  
58  
59      public void setForClass(String forClass)
60      {
61          this.forClass = forClass;
62      }
63  
64  
65      public String getConverterClass()
66      {
67          return converterClass;
68      }
69  
70  
71      public void setConverterClass(String converterClass)
72      {
73          this.converterClass = converterClass;
74      }
75  
76      public void addProperty(org.apache.myfaces.config.element.Property value)
77      {
78          if(_properties == null)
79          {
80              _properties = new ArrayList<org.apache.myfaces.config.element.Property>();
81          }
82  
83          _properties.add(value);
84      }
85  
86      public Collection<? extends org.apache.myfaces.config.element.Property> getProperties()
87      {
88          if(_properties == null)
89          {
90              return Collections.emptyList();
91          }
92  
93          return _properties;
94      }
95      
96      public void addAttribute(org.apache.myfaces.config.element.Attribute value)
97      {
98          if(_attributes == null)
99          {
100             _attributes = new ArrayList<org.apache.myfaces.config.element.Attribute>();
101         }
102 
103         _attributes.add(value);
104     }
105 
106     public Collection<? extends org.apache.myfaces.config.element.Attribute> getAttributes()
107     {
108         if(_attributes == null)
109         {
110             return Collections.emptyList();
111         }
112 
113         return _attributes;
114     }
115 }