com.univocity.parsers.remote
Interface PaginationContext

All Superinterfaces:
RemoteContext

public interface PaginationContext
extends RemoteContext

Contains information about the pagination process managed by a Paginator and made available to the user through the NextInputHandler callback.

Author:
uniVocity Software Pty Ltd - dev@univocity.com
See Also:
RemoteContext, Paginator, NextInputHandler, UrlReaderProvider

Method Summary
 Set<String> getFieldNames()
          Returns the available field names available from the current Paginator implementation.
 File getNextPageFile()
          Returns the local file which will contain the data of the next page to be visited, if reading from a remote location.
 com.univocity.parsers.common.record.Record getRecord()
          Returns a Record with the values parsed from the input and associated with the given user provided fields and request parameters of the Paginator.
 String readField(String fieldName)
          Returns the value parsed from the input and associated with a user provided fields and request parameters of the Paginator.
 String[] readFields(String... fieldNames)
          Returns the values parsed from the input and associated with the given user provided fields and request parameters of the Paginator.
 void stop()
          Stops the pagination and prevents attempts to read more pages.
 
Methods inherited from interface com.univocity.parsers.remote.RemoteContext
getCurrentPage, getCurrentPageNumber, getCurrentResponse, getNextPage, getNextPageNumber, getNextRequest, getPageCount, getRateLimiter, hasMorePages
 

Method Detail

readField

String readField(String fieldName)
Returns the value parsed from the input and associated with a user provided fields and request parameters of the Paginator.

Parameters:
fieldName - name of the user-provided field associated with the Paginator
Returns:
the content extracted from the input for the given field name.

readFields

String[] readFields(String... fieldNames)
Returns the values parsed from the input and associated with the given user provided fields and request parameters of the Paginator.

Parameters:
fieldNames - names of the user-provided field associated with the Paginator. If empty the values of all fields will be returned.
Returns:
the content extracted from the input for the given field names.

getFieldNames

Set<String> getFieldNames()
Returns the available field names available from the current Paginator implementation.

Returns:
the sequence of field names bound to the paginator.

getRecord

com.univocity.parsers.common.record.Record getRecord()
Returns a Record with the values parsed from the input and associated with the given user provided fields and request parameters of the Paginator.

Returns:
the content extracted from the input as a Record

getNextPageFile

File getNextPageFile()
Returns the local file which will contain the data of the next page to be visited, if reading from a remote location. If the parsing process is running on a set of already downloaded files, returns the file that is expected to contain information of the next page.

Returns:
the file with the next page of data.

stop

void stop()
Stops the pagination and prevents attempts to read more pages.

Specified by:
stop in interface RemoteContext


Copyright © 2018 uniVocity Software Pty Ltd. All rights reserved.