The PaginationUtils class provides a framework for consistent pagination across all JADX tools. It handles parameter validation and standardized response formatting.
Key Constants
DEFAULT_PAGE_SIZE = 100MAX_PAGE_SIZE = 10000MAX_OFFSET = 1000000
get_paginated_data()
This method fetches paginated data from a JADX endpoint. It accepts a data_extractor (to pull items from the response) and a fetch_function (typically get_from_jadx).
Response Format:
Returns a dictionary with type: "paginated-list", containing items and a pagination object with total, offset, limit, count, has_more, next_offset, and prev_offset.
# Example: Fetching first 50 classes
result = await PaginationUtils.get_paginated_data(
endpoint="all-classes",
offset=0,
count=50,
data_extractor=lambda resp: resp.get("classes", []),
fetch_function=get_from_jadx
)
print(f"Got {result['pagination']['count']} of {result['pagination']['total']} classes")
for class_name in result['items']:
print(class_name)
if result['pagination']['has_more']:
# Fetch next page using next_offset
next_result = await PaginationUtils.get_paginated_data(
endpoint="all-classes",
offset=result['pagination']['next_offset'],
count=50,
data_extractor=lambda resp: resp.get("classes", []),
fetch_function=get_from_jadx
)