org.omnaest.utils.beans
Interface AutowiredPropertyContainer

All Superinterfaces:
Iterable<Object>
All Known Implementing Classes:
TypeToAutowiredPropertyContainerAdapter

public interface AutowiredPropertyContainer
extends Iterable<Object>

An AutowiredPropertyContainer is a facade for autowired properties of a Java Bean class. It allows to put property objects into itself and translates the changes to an underlying Java Bean object.

Author:
Omnaest

Method Summary
<O> Map<String,O>
getPropertynameToValueMap(Class<O> clazz)
          Returns a Map for all properties which can be assigned to the given Class.
<O> O
getValue(Class<O> clazz)
          Returns the value of the property which can be assigned as value to the given Class type.
<O> Set<O>
getValueSet(Class<O> clazz)
          Returns a Set for all properties which can be assigned to the given Class.
 int put(Object object)
          Adds an Object to the AutowiredPropertyContainer.
 boolean put(String propertyname, Object object)
          Adds an Object to the AutowiredPropertyContainer.
 
Methods inherited from interface java.lang.Iterable
iterator
 

Method Detail

put

int put(Object object)
Adds an Object to the AutowiredPropertyContainer. This will update all properties of the underlying Java Bean object which can be assigned by the given Object.

Parameters:
object -
Returns:
the number of assigned properties

put

boolean put(String propertyname,
            Object object)
Adds an Object to the AutowiredPropertyContainer. This will update all properties of the underlying Java Bean object which can be assigned by the given Object.

Parameters:
propertyname -
object -
Returns:
true : assign was successful

getPropertynameToValueMap

<O> Map<String,O> getPropertynameToValueMap(Class<O> clazz)
Returns a Map for all properties which can be assigned to the given Class. The Map has the property names as key and the values of the properties as values.

Type Parameters:
O -
Parameters:
clazz -

getValueSet

<O> Set<O> getValueSet(Class<O> clazz)
Returns a Set for all properties which can be assigned to the given Class.

Type Parameters:
O -
Parameters:
clazz -

getValue

<O> O getValue(Class<O> clazz)
Returns the value of the property which can be assigned as value to the given Class type. If there are multiple properties available with fitting types null is returned.

Type Parameters:
O -
Parameters:
clazz -
Returns:


Copyright © 2011. All Rights Reserved.