1 /*
2 * (C) 2002 David Carr david@carr.name
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19 package net.sourceforge.mflow.api.base;
20
21 import java.util.prefs.Preferences;
22
23 import net.sourceforge.mflow.api.Account;
24
25 /***
26 * @author carrd
27 */
28 public abstract class AbstractAccount implements Account {
29 /***
30 * The node to get account information from
31 */
32 private Preferences node;
33
34 /***
35 * @return the node to get account information from
36 */
37 protected final Preferences getNode() {
38 return this.node;
39 }
40
41 /***
42 * @param aNode the node to load the account from
43 */
44 public AbstractAccount(final Preferences aNode) {
45 this.node = aNode;
46 }
47
48 /***
49 * @return the name of the account
50 */
51 public final String getName() {
52 return this.node.name();
53 }
54
55 /***
56 * @return the class name for the account implementation
57 */
58 public final String getClassName() {
59 return this.node.get("class", null);
60 }
61
62 /***
63 * Sets the class name for the account
64 *
65 * @param aClassName the new class name
66 */
67 protected final void setClassName(final String aClassName) {
68 this.node.put("class", aClassName);
69 }
70 }
This page was automatically generated by Maven