|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object lumis.doui.source.AbstractObjectDataProvider<S,T>
S
- the source class using this provider. If there is no need
for source specialization, may be just TabularSource.T
- the class or interface the object's properties accessor methods
will be accessed through.@StableMinor(version="6.2", sinceVersion="4.0") public abstract class AbstractObjectDataProvider<S extends TabularSource,T>
Implements a provider for objects whose properties follows the java bean accessor methods convention.
The fields id in the source definition are used as the object's properties names. For each one, its getter method is queried in the loaded object, and the value is used to populate a tabular data for the source.
Field Summary |
---|
Fields inherited from interface lumis.doui.source.IDataProvider |
---|
INTERFACE_INSTANCE_PROPERTY_FIELDS, INTERFACE_INSTANCE_PROPERTY_FILTERS, INTERFACE_INSTANCE_PROPERTY_MAX_ROWS, INTERFACE_INSTANCE_PROPERTY_ORDER_BY, MAX_NUM_ORDER_BY_FIELDS |
Constructor Summary | |
---|---|
AbstractObjectDataProvider(Class<? extends T> objectClass)
Creates a new object data provider for objects of the given class or interface. |
Method Summary | |
---|---|
protected int |
getTotalRows(SessionConfig sessionConfig,
S source,
ITransaction transaction)
Returns the total rows to be set on the generated tabular data. |
void |
loadData(SessionConfig sessionConfig,
S source,
ITransaction transaction)
|
protected abstract List<T> |
loadObjects(SessionConfig sessionConfig,
S source,
ITransaction transaction)
Loads the objects. |
protected Object |
readProperty(T object,
String propertyName)
Reads the property value of an object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractObjectDataProvider(Class<? extends T> objectClass)
objectClass
- the class or interface that contains the methods to
read the object's properties.Method Detail |
---|
protected abstract List<T> loadObjects(SessionConfig sessionConfig, S source, ITransaction transaction) throws PortalException
sessionConfig
- the user session information.source
- the source that will be populated.transaction
- the transaction for persistence access.
PortalException
#getTotalRows(SessionConfig, TabularSource, ITransaction)}
protected int getTotalRows(SessionConfig sessionConfig, S source, ITransaction transaction) throws PortalException
If the value returned is a negative value, the total rows on the tabular data is not set. This is the default implementation.
sessionConfig
- the user session information.source
- the source that will be populated.transaction
- the transaction for persistence access.
PortalException
public void loadData(SessionConfig sessionConfig, S source, ITransaction transaction) throws PortalException
loadData
in interface IDataProvider<S extends TabularSource>
PortalException
protected Object readProperty(T object, String propertyName) throws UnexpectedException
If the propertyName is propertyName
, this method tries to read
the value from methods named getPropertyName
or isPropertyName
,
with no parameters.
object
- the object instance.propertyName
- the property name.
UnexpectedException
- if there was an exception thrown by the accessor method.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |