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: 155464 $ $Date: 2005-02-26 13:26:54 +0000 (Sat, 26 Feb 2005) $
Author:
Ted Husted

Method Summary
 Map getMap()
          Return a Map of this object's public properties.
 Object getValue(Object key)
          Returns the value to which this map maps the specified key -- the equivalent of Object getMap().get(key).
 void setMap(Map map)
          Set this object's public properties via a Map.
 Object setValue(Object key, 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

Map getMap()
           throws 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.
Exception

setMap

void setMap(Map map)
            throws 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.
Exception

getValue

Object getValue(Object key)
                throws 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.
Exception

setValue

Object setValue(Object key,
                Object value)
                throws 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.
Exception


Copyright © 2001-2010 The Apache Software Foundation. All Rights Reserved.