org.midao.jdbc.core.handlers.output
Class BeanListLazyOutputHandler<S>

java.lang.Object
  extended by org.midao.jdbc.core.handlers.output.BeanListLazyOutputHandler<S>
All Implemented Interfaces:
LazyOutputHandler<BeanListLazyOutputHandler,S>, OutputHandler<BeanListLazyOutputHandler>

public class BeanListLazyOutputHandler<S>
extends java.lang.Object
implements LazyOutputHandler<BeanListLazyOutputHandler,S>

Converts query output into lazy list of beans

See Also:
LazyOutputHandler}

Constructor Summary
BeanListLazyOutputHandler(java.lang.Class<S> type)
          Creates new BeanListLazyOutputHandler instance.
BeanListLazyOutputHandler(java.lang.Class<S> type, QueryOutputProcessor processor)
          Creates new BeanListLazyOutputHandler instance.
 
Method Summary
 void close()
          Function closes all resources used by this Lazy output handler instance.
 S getNext()
          Returns next element from lazy list
 BeanListLazyOutputHandler handle(java.util.List<QueryParameters> outputList)
          Reads query output and converts it into
 boolean hasNext()
          Checks if lazy list has next element
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanListLazyOutputHandler

public BeanListLazyOutputHandler(java.lang.Class<S> type)
Creates new BeanListLazyOutputHandler instance.

Parameters:
type - Bean Class description

BeanListLazyOutputHandler

public BeanListLazyOutputHandler(java.lang.Class<S> type,
                                 QueryOutputProcessor processor)
Creates new BeanListLazyOutputHandler instance.

Parameters:
type - Bean Class description
processor - Query output processor
Method Detail

hasNext

public boolean hasNext()
Checks if lazy list has next element

Specified by:
hasNext in interface LazyOutputHandler<BeanListLazyOutputHandler,S>
Returns:
true if list has next element

getNext

public S getNext()
Returns next element from lazy list

Specified by:
getNext in interface LazyOutputHandler<BeanListLazyOutputHandler,S>
Returns:
next element from list. Null is returned in no value is present

close

public void close()
Function closes all resources used by this Lazy output handler instance. Should be invoked every time you finished with reading data, otherwise resource leaks and/or errors might happen.

Specified by:
close in interface LazyOutputHandler<BeanListLazyOutputHandler,S>

handle

public BeanListLazyOutputHandler handle(java.util.List<QueryParameters> outputList)
                                 throws MidaoException
Reads query output and converts it into

Specified by:
handle in interface OutputHandler<BeanListLazyOutputHandler>
Parameters:
outputList - Query output
Returns:
Java type converted from query output
Throws:
MidaoException


Copyright © 2013. All Rights Reserved.