org.omnaest.utils.beans.result
Class BeanPropertyAccessors<B>

java.lang.Object
  extended by org.omnaest.utils.beans.result.BeanPropertyAccessors<B>
Type Parameters:
B - type of the Java Bean
All Implemented Interfaces:
Iterable<BeanPropertyAccessor<B>>

public class BeanPropertyAccessors<B>
extends Object
implements Iterable<BeanPropertyAccessor<B>>

Container for a ordered set of BeanPropertyAccessor instances.

Author:
Omnaest

Field Summary
protected  List<BeanPropertyAccessor<B>> beanPropertyAccessorList
           
 
Constructor Summary
BeanPropertyAccessors()
           
BeanPropertyAccessors(Collection<BeanPropertyAccessor<B>> beanPropertyAccessorCollection)
           
 
Method Summary
 boolean add(BeanPropertyAccessor<B> e)
          Adds a BeanPropertyAccessor to the BeanPropertyAccessors container
 boolean addAll(Collection<? extends BeanPropertyAccessor<B>> c)
          Adds BeanPropertyAccessor instances to the BeanPropertyAccessors container
 void clear()
          Clears the BeanPropertyAccessors container
 void copyPropertyValues(B beanSource, B beanDestination)
          Copies the values of all related properties of the given source Java Bean to the destination Java Bean.
 BeanPropertyAccessor<B> get(int index)
          Gets the BeanPropertyAccessor at the given index position
 boolean isEmpty()
          Returns true if the BeanPropertyAccessors container has no BeanPropertyAccessor instances
 Iterator<BeanPropertyAccessor<B>> iterator()
           
 boolean remove(BeanPropertyAccessor<B> beanPropertyAccessor)
          Removes a BeanPropertyAccessor instance from the BeanPropertyAccessors container
 BeanPropertyAccessor<B> remove(int index)
          Removes the BeanPropertyAccessor at the given index position
 int size()
          Returns the size of the BeanPropertyAccessors container
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

beanPropertyAccessorList

protected List<BeanPropertyAccessor<B>> beanPropertyAccessorList
Constructor Detail

BeanPropertyAccessors

public BeanPropertyAccessors()
See Also:
BeanPropertyAccessors

BeanPropertyAccessors

public BeanPropertyAccessors(Collection<BeanPropertyAccessor<B>> beanPropertyAccessorCollection)
Parameters:
beanPropertyAccessorCollection -
See Also:
BeanPropertyAccessors
Method Detail

copyPropertyValues

public void copyPropertyValues(B beanSource,
                               B beanDestination)
Copies the values of all related properties of the given source Java Bean to the destination Java Bean. The affected properties are based on the BeanPropertyAccessor instances within the BeanPropertyAccessors container.

Parameters:
beanSource -
beanDestination -

size

public int size()
Returns the size of the BeanPropertyAccessors container


isEmpty

public boolean isEmpty()
Returns true if the BeanPropertyAccessors container has no BeanPropertyAccessor instances

Returns:

add

public boolean add(BeanPropertyAccessor<B> e)
Adds a BeanPropertyAccessor to the BeanPropertyAccessors container

Parameters:
e -
Returns:

remove

public boolean remove(BeanPropertyAccessor<B> beanPropertyAccessor)
Removes a BeanPropertyAccessor instance from the BeanPropertyAccessors container

Parameters:
beanPropertyAccessor -
Returns:

addAll

public boolean addAll(Collection<? extends BeanPropertyAccessor<B>> c)
Adds BeanPropertyAccessor instances to the BeanPropertyAccessors container

Parameters:
c -
Returns:

clear

public void clear()
Clears the BeanPropertyAccessors container


iterator

public Iterator<BeanPropertyAccessor<B>> iterator()
Specified by:
iterator in interface Iterable<BeanPropertyAccessor<B>>

remove

public BeanPropertyAccessor<B> remove(int index)
Removes the BeanPropertyAccessor at the given index position

Parameters:
index -
Returns:

get

public BeanPropertyAccessor<B> get(int index)
Gets the BeanPropertyAccessor at the given index position

Parameters:
index -
Returns:


Copyright © 2011. All Rights Reserved.