01: /*
02: ItsNat Java Web Application Framework
03: Copyright (C) 2007 Innowhere Software Services S.L., Spanish Company
04: Author: Jose Maria Arranz Santamaria
05:
06: This program is free software: you can redistribute it and/or modify
07: it under the terms of the GNU Affero General Public License as published by
08: the Free Software Foundation, either version 3 of the License, or
09: (at your option) any later version. See the GNU Affero General Public
10: License for more details. See the copy of the GNU Affero General Public License
11: included in this program. If not, see <http://www.gnu.org/licenses/>.
12: */
13:
14: package org.itsnat.core;
15:
16: /**
17: * This class is provided to specify a generic pair name-value object, this value
18: * may be used by the framework with several objectives.
19: *
20: * <p>For instance, artifacts can be used to specify custom structures used in lists,
21: * tables or trees.</p>
22: *
23: * <p>They provide a generic mechanism to configure a component with no specific API.</p>
24: *
25: *
26: * @author Jose Maria Arranz Santamaria
27: * @see org.itsnat.comp.ItsNatComponent#getArtifact(String)
28: * @see org.itsnat.core.ItsNatDocument#getArtifact(String)
29: * @see org.itsnat.core.DocumentTemplate#getArtifact(String)
30: * @see org.itsnat.core.ItsNatServletConfig#getArtifact(String)
31: * @see org.itsnat.comp.ItsNatComponentManager#createItsNatComponent(Node,String,NameValue[])
32: */
33: public class NameValue {
34: private String name;
35: private Object value;
36:
37: /**
38: * Creates a new instance with the specified name and value.
39: *
40: * @param name the name of the pair name/value.
41: * @param value the value of the pair name/value.
42: */
43: public NameValue(String name, Object value) {
44: this .name = name;
45: this .value = value;
46: }
47:
48: /**
49: * Returns the name of the pair name/value.
50: *
51: * @return the name.
52: */
53: public String getName() {
54: return name;
55: }
56:
57: /**
58: * Returns the value of the pair name/value.
59: *
60: * @return the value.
61: */
62: public Object getValue() {
63: return value;
64: }
65: }
|