org.apache.commons.dbutils.wrappers
クラス StringTrimmedResultSet

java.lang.Object
  上位を拡張 org.apache.commons.dbutils.wrappers.StringTrimmedResultSet
すべての実装されたインタフェース:
java.lang.reflect.InvocationHandler

public class StringTrimmedResultSet
extends java.lang.Object
implements java.lang.reflect.InvocationHandler

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);
 


コンストラクタの概要
StringTrimmedResultSet(java.sql.ResultSet rs)
          Constructs a new instance of StringTrimmedResultSet to wrap the specified ResultSet.
 
メソッドの概要
 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.
 
クラス java.lang.Object から継承されたメソッド
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

StringTrimmedResultSet

public StringTrimmedResultSet(java.sql.ResultSet rs)
Constructs a new instance of StringTrimmedResultSet to wrap the specified ResultSet.

パラメータ:
rs - ResultSet to wrap
メソッドの詳細

wrap

public static java.sql.ResultSet wrap(java.sql.ResultSet rs)
Wraps the ResultSet in an instance of this class. This is equivalent to:
 ProxyFactory.instance().createResultSet(new StringTrimmedResultSet(rs));
 

パラメータ:
rs - The ResultSet to wrap.
戻り値:
wrapped ResultSet

invoke

public java.lang.Object invoke(java.lang.Object proxy,
                               java.lang.reflect.Method method,
                               java.lang.Object[] args)
                        throws java.lang.Throwable
Intercept calls to the getString() and getObject() methods and trim any Strings before they're returned.

定義:
インタフェース java.lang.reflect.InvocationHandler 内の invoke
例外:
java.lang.Throwable
関連項目:
InvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])