org.jtheque.core.managers.properties
Interface IPropertiesManager

All Superinterfaces:
ActivableManager, IManager
All Known Implementing Classes:
PropertiesManager

public interface IPropertiesManager
extends ActivableManager

A properties manager specification.

Author:
Baptiste Wicht

Method Summary
<T> T
createMemento(T bean)
          Create a memento for the bean.
 java.util.List<Property> getProperties(java.lang.Object bean)
          Return all the properties of a bean.
 java.lang.Object getProperty(java.lang.Object bean, Property property)
          Return the value of a property.
 java.lang.Object getProperty(java.lang.Object bean, java.lang.String property)
          Return the value of a property.
 int hashCode(java.lang.Object bean)
          Generate a hashcode for the bean.
 void restoreMemento(java.lang.Object bean, java.lang.Object memento)
          Restore the state of the memento.
 java.lang.String toString(java.lang.Object bean)
          Generate a toString() String based on all the properties of the bean.
 
Methods inherited from interface org.jtheque.core.managers.ActivableManager
isEnabled, setEnabled
 
Methods inherited from interface org.jtheque.core.managers.IManager
close, init, preInit
 

Method Detail

getProperties

java.util.List<Property> getProperties(java.lang.Object bean)
                                       throws PropertyException
Return all the properties of a bean. For better performance, the results are internally cached.

Parameters:
bean - The bean to extract the properties from.
Returns:
A List containing all the properties of the bean.
Throws:
PropertyException - If an errors occurs during the recuperation of the properties.

getProperty

java.lang.Object getProperty(java.lang.Object bean,
                             Property property)
Return the value of a property.

Parameters:
bean - The bean to get the property value from.
property - The property.
Returns:
the value of the property.

getProperty

java.lang.Object getProperty(java.lang.Object bean,
                             java.lang.String property)
Return the value of a property.

Parameters:
bean - The bean to get the property value from.
property - The property.
Returns:
the value of the property.

createMemento

<T> T createMemento(T bean)
Create a memento for the bean. A memento is a clone of all the properties of the bean.

Type Parameters:
T - The class of the bean.
Parameters:
bean - The bean to create the memento from.
Returns:
The memento.

toString

java.lang.String toString(java.lang.Object bean)
Generate a toString() String based on all the properties of the bean.

Parameters:
bean - The bean.
Returns:
A String representation of all the properties of the bean.

hashCode

int hashCode(java.lang.Object bean)
Generate a hashcode for the bean.

Parameters:
bean - The bean.
Returns:
A hash code based on all the properties of the bean.

restoreMemento

void restoreMemento(java.lang.Object bean,
                    java.lang.Object memento)
Restore the state of the memento. It seems to copy all the properties values from the memento to the bean.

Parameters:
bean - The bean.
memento - The memento.


Copyright © 2009 JTheque. All Rights Reserved.