org.apache.commons.scaffold.util
Interface Mapped


public interface Mapped

Simple interface to describe an object that can set and return its public properties via a Map. business logic object.

Version:
$Revision: 1.3 $ $Date: 2004/03/21 21:10:10 $

Method Summary
 java.util.Map getMap()
          Return a Map of this object's public properties.
 java.lang.Object getValue(java.lang.Object key)
          Returns the value to which this map maps the specified key -- the equivalent of Object getMap().get(key).
 void setMap(java.util.Map map)
          Set this object's public properties via a Map.
 java.lang.Object setValue(java.lang.Object key, java.lang.Object value)
          Associates the specified value with the specified key in the property map for this object -- the equivalent of getMap().put(key,value).
 

Method Detail

getMap

public java.util.Map getMap()
                     throws java.lang.Exception
Return a Map of this object's public properties. The values may be of any type, though an implementation may choose to return only Strings. The keys for the entries may or may not exactly match the true public properties of the implementing object, as needed.

Throws:
Throws - Exception on any error. A subclass of ChainedException is recommended.
java.lang.Exception

setMap

public void setMap(java.util.Map map)
            throws java.lang.Exception
Set this object's public properties via a Map. The values may be of any type, though a subclass may choose to expect only Strings. The keys for the entries may or may not exactly match the true public properties, of the object, as required.

Throws:
Throws - Exception on any error. A subclass of ChainedException is recommended.
java.lang.Exception

getValue

public java.lang.Object getValue(java.lang.Object key)
                          throws java.lang.Exception
Returns the value to which this map maps the specified key -- the equivalent of Object getMap().get(key).

Parameters:
key - - key whose associated value is to be returned.
Throws:
Throws - Exception on any error. A subclass of ChainedException is recommended.
java.lang.Exception

setValue

public java.lang.Object setValue(java.lang.Object key,
                                 java.lang.Object value)
                          throws java.lang.Exception
Associates the specified value with the specified key in the property map for this object -- the equivalent of getMap().put(key,value).

Parameters:
key - - key with which the specified value is to be associated.
value - - value to be associated with the specified key.
Throws:
Throws - Exception on any error. A subclass of ChainedException is recommended.
java.lang.Exception


Copyright © 2002-2005 The Apache Software Foundation. All Rights Reserved.