|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.dbutils.wrappers.StringTrimmedResultSet
Wraps a ResultSet
to trim strings returned by the
getString()
and getObject()
methods.
Usage Example:
This example shows how to decorate ResultSets so processing continues as
normal but all Strings are trimmed before being returned from the
ResultSet
.
ResultSet rs = // somehow get a ResultSet; // Substitute wrapped ResultSet with additional behavior for real ResultSet rs = StringTrimmedResultSet.wrap(rs); // Pass wrapped ResultSet to processor List list = new BasicRowProcessor().toBeanList(rs);
Constructor Summary | |
StringTrimmedResultSet(java.sql.ResultSet rs)
Constructs a new instance of StringTrimmedResultSet
to wrap the specified ResultSet . |
Method Summary | |
java.lang.Object |
invoke(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args)
Intercept calls to the getString() and
getObject() methods and trim any Strings before they're
returned. |
static java.sql.ResultSet |
wrap(java.sql.ResultSet rs)
Wraps the ResultSet in an instance of this class. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public StringTrimmedResultSet(java.sql.ResultSet rs)
StringTrimmedResultSet
to wrap the specified ResultSet
.
rs
- ResultSet to wrapMethod Detail |
public static java.sql.ResultSet wrap(java.sql.ResultSet rs)
ResultSet
in an instance of this class. This is
equivalent to:
ProxyFactory.instance().createResultSet(new StringTrimmedResultSet(rs));
rs
- The ResultSet
to wrap.
public java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args) throws java.lang.Throwable
getString()
and
getObject()
methods and trim any Strings before they're
returned.
invoke
in interface java.lang.reflect.InvocationHandler
java.lang.Throwable
InvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |