View Javadoc
1   package org.codehaus.plexus.component.configurator;
2   
3   /*
4    * The MIT License
5    *
6    * Copyright (c) 2004, The Codehaus
7    *
8    * Permission is hereby granted, free of charge, to any person obtaining a copy of
9    * this software and associated documentation files (the "Software"), to deal in
10   * the Software without restriction, including without limitation the rights to
11   * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
12   * of the Software, and to permit persons to whom the Software is furnished to do
13   * so, subject to the following conditions:
14   *
15   * The above copyright notice and this permission notice shall be included in all
16   * copies or substantial portions of the Software.
17   *
18   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24   * SOFTWARE.
25   */
26  
27  
28  import org.codehaus.plexus.configuration.PlexusConfiguration;
29  
30  import java.util.List;
31  
32  /**
33   *
34   * 
35   * @author Jason van Zyl
36   *
37   * @version $Id$
38   */
39  public class ComponentWithSetters
40  {
41      private int intValueVariable;
42      private float floatValueVariable;
43      private long longValueVariable;
44      private double doubleValueVariable;
45      private String stringValueVariable;
46      private List importantThingsVariable;
47      private PlexusConfiguration configurationVariable;
48  
49      public int getIntValue()
50      {
51          return intValueVariable;
52      }
53                                            
54      public float getFloatValue()
55      {
56          return floatValueVariable;
57      }
58  
59      public long getLongValue()
60      {
61          return longValueVariable;
62      }
63  
64      public double getDoubleValue()
65      {
66          return doubleValueVariable;
67      }
68  
69      public String getStringValue()
70      {
71          return stringValueVariable;
72      }
73  
74      public List getImportantThings()
75      {
76          return importantThingsVariable;
77      }
78  
79      public PlexusConfiguration getConfiguration()
80      {
81          return configurationVariable;
82      }
83  
84      // ----------------------------------------------------------------------
85      // setters
86      // ----------------------------------------------------------------------
87  
88      boolean intValueSet;
89      boolean floatValueSet;
90      boolean longValueSet;
91      boolean doubleValueSet;
92      boolean stringValueSet;
93      boolean importantThingsValueSet;
94      boolean configurationValueSet;
95  
96      public void setIntValue( int intValue )
97      {
98          this.intValueVariable = intValue;
99  
100         intValueSet = true;
101     }
102 
103     public void setFloatValue( float floatValue )
104     {
105         this.floatValueVariable = floatValue;
106 
107         floatValueSet = true;
108     }
109 
110     public void setLongValue( long longValue )
111     {
112         this.longValueVariable = longValue;
113 
114         longValueSet = true;
115     }
116 
117     public void setDoubleValue( double doubleValue )
118     {
119         this.doubleValueVariable = doubleValue;
120 
121         doubleValueSet = true;
122     }
123 
124     public void setStringValue( String stringValue )
125     {
126         this.stringValueVariable = stringValue;
127 
128         stringValueSet = true;
129     }
130 
131     public void setImportantThings( List importantThings )
132     {
133         this.importantThingsVariable = importantThings;
134 
135         importantThingsValueSet = true;
136     }
137 
138     public void setConfiguration( PlexusConfiguration configuration )
139     {
140         this.configurationVariable = configuration;
141 
142         configurationValueSet = true;
143     }
144 }