01: /*
02: * Copyright (C) 2004 NNL Technology AB
03: * Visit www.infonode.net for information about InfoNode(R)
04: * products and how to contact NNL Technology AB.
05: *
06: * This program is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU General Public License
08: * as published by the Free Software Foundation; either version 2
09: * of the License, or (at your option) any later version.
10: *
11: * This program is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14: * GNU General Public License for more details.
15: *
16: * You should have received a copy of the GNU General Public License
17: * along with this program; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
19: * MA 02111-1307, USA.
20: */
21:
22: // $Id: PropertyValueHandler.java,v 1.4 2004/09/22 14:32:50 jesper Exp $
23: package net.infonode.properties.util;
24:
25: import net.infonode.properties.base.Property;
26:
27: /**
28: * Sets and gets property values to and from value objects.
29: *
30: * @author $Author: jesper $
31: * @version $Revision: 1.4 $
32: */
33: public interface PropertyValueHandler {
34: /**
35: * Gets the value of a property from a value container.
36: *
37: * @param property the property
38: * @param valueContainer the object containing the value
39: * @return the property value, null if the container doesn't contain the value
40: */
41: Object getValue(Property property, Object valueContainer);
42:
43: /**
44: * Sets the value of a property in a value container.
45: *
46: * @param property the property
47: * @param valueContainer the object that will contain the value
48: * @param value the property value
49: */
50: void setValue(Property property, Object valueContainer, Object value);
51:
52: /**
53: * Removes a property value from a value container.
54: *
55: * @param property the property
56: * @param valueContainer the value container
57: */
58: void removeValue(Property property, Object valueContainer);
59:
60: /**
61: * Returns true if a value for the property is set in the value container.
62: *
63: * @param property the property
64: * @param valueContainer the value container
65: * @return true if a value for the property is set in the value container
66: */
67: boolean getValueIsSet(Property property, Object valueContainer);
68:
69: /**
70: * Returns true if the property value is removable from the value container.
71: *
72: * @param property the property
73: * @param valueContainer the value container
74: * @return true if the property value is removable from the value container
75: */
76: boolean getValueIsRemovable(Property property, Object valueContainer);
77: }
|