org.midao.jdbc.core.handlers.output
Class MapListLazyOutputHandler

java.lang.Object
  extended by org.midao.jdbc.core.handlers.output.MapListLazyOutputHandler
All Implemented Interfaces:
LazyOutputHandler<MapListLazyOutputHandler,java.util.Map<java.lang.String,java.lang.Object>>, OutputHandler<MapListLazyOutputHandler>

public class MapListLazyOutputHandler
extends java.lang.Object
implements LazyOutputHandler<MapListLazyOutputHandler,java.util.Map<java.lang.String,java.lang.Object>>

Converts query output into List of Maps

See Also:
LazyOutputHandler}

Constructor Summary
MapListLazyOutputHandler()
          Creates new MapListLazyOutputHandler instance.
MapListLazyOutputHandler(QueryOutputProcessor processor)
          Creates new MapListLazyOutputHandler instance.
 
Method Summary
 void close()
          Function closes all resources used by this Lazy output handler instance.
 java.util.Map<java.lang.String,java.lang.Object> getNext()
          Returns next element from lazy list
 MapListLazyOutputHandler 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

MapListLazyOutputHandler

public MapListLazyOutputHandler()
Creates new MapListLazyOutputHandler instance.


MapListLazyOutputHandler

public MapListLazyOutputHandler(QueryOutputProcessor processor)
Creates new MapListLazyOutputHandler instance.

Parameters:
processor - Query output processor
Method Detail

hasNext

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

Specified by:
hasNext in interface LazyOutputHandler<MapListLazyOutputHandler,java.util.Map<java.lang.String,java.lang.Object>>
Returns:
true if list has next element

getNext

public java.util.Map<java.lang.String,java.lang.Object> getNext()
Returns next element from lazy list

Specified by:
getNext in interface LazyOutputHandler<MapListLazyOutputHandler,java.util.Map<java.lang.String,java.lang.Object>>
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<MapListLazyOutputHandler,java.util.Map<java.lang.String,java.lang.Object>>

handle

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

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


Copyright © 2013. All Rights Reserved.