Class LlmCrossTabAxes
A cross-tab is assembled by CrossTabExtractionController, which links a cell to its column and to its
row by the name of a returned column alone. The rules of that linking are what this class holds, so that the
loader of the DataSetType.LLM data set type is left with reading a query,
binding values and executing it.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddAxisValues(String axisName, List<?> rows, Map<String, Object> availableValues, List<String> requiredResultProperties, BiConsumer<String, Runnable> warnOnce) Offers the values of one cross-tab axis, one name per field of its rows, each bound as the whole list the axis holds for that field — which a query matches withIN.static booleanareReadBy(String dataSetName, @Nullable BandOrientation bandOrientation) Tells whether the axes a run put into its params are this data set's to read: only a cell of a cross-tab band sits between axes, and a data set named after an axis builds one instead of filling the matrix.static voidcheckAxesAreLinkable(String dataSetName, LlmDataQuery query, Map<String, Object> params, List<String> requiredResultProperties, @Nullable String bandName) Fails a query that cannot be placed into the matrix of a cross-tab band, because the controller drops every cell it cannot link and the band then renders empty with no error at all.static @Nullable StringfirstEmptyAxis(Map<String, Object> params, @Nullable String bandName) Returns the name of the first cross-tab axis of this band that produced no values, ornullwhen every axis has some.static booleanTells whether a params entry is an axis of this band rather than of another one.static booleanisAxisRows(@Nullable Object value) Tells the rows of a cross-tab axis from an ordinary parameter that merely happens to be named like one: an axis holds rows, so it is a list of maps, and an empty list is the axis that produced nothing.
-
Method Details
-
firstEmptyAxis
Returns the name of the first cross-tab axis of this band that produced no values, ornullwhen every axis has some. An axis is put into the params by the controller whether it produced rows or not.- Parameters:
bandName- name of the band the data set belongs to, ornullwhen it is unknown
-
isAxisOf
Tells whether a params entry is an axis of this band rather than of another one.The params of a run are one mutable map shared by every band of it:
ExtractionContextImplhands the same map to every band andCrossTabExtractionControlleradds its axes to it, so the axes of a cross-tab band stay in the params of every band extracted afterwards. An axis is named<band>_master_dataor<band>_dynamic_header, which is what tells whose it is.A data set whose band is unknown claims every axis, as it did before the band name was published: without a name there is nothing to compare, and a cross-tab cell that stopped seeing its own axes would be worse than one seeing a foreign one.
- Parameters:
name- params entry namebandName- name of the band the data set belongs to, ornullwhen it is unknown
-
areReadBy
Tells whether the axes a run put into its params are this data set's to read: only a cell of a cross-tab band sits between axes, and a data set named after an axis builds one instead of filling the matrix. Both halves matter because the params of a run are one map shared by every band — otherwise an ordinary band would read a parameter merely named like an axis, and an axis data set under a multi-row parent would find the axes of the previous row, its own among them.- Parameters:
dataSetName- name of the data set being loaded, which is what tells an axis from a cellbandOrientation- orientation of the band, ornullwhen unknown, which claims the axes as before the orientation was published
-
isAxisRows
Tells the rows of a cross-tab axis from an ordinary parameter that merely happens to be named like one: an axis holds rows, so it is a list of maps, and an empty list is the axis that produced nothing. A list of anything else belongs to the report run and stays a parameter of its own.- Parameters:
value- value of a run parameter, which isnullfor a parameter left unfilled
-
addAxisValues
public static void addAxisValues(String axisName, List<?> rows, Map<String, Object> availableValues, List<String> requiredResultProperties, BiConsumer<String, Runnable> warnOnce) Offers the values of one cross-tab axis, one name per field of its rows, each bound as the whole list the axis holds for that field — which a query matches withIN.Exactly one of those names is required back as a result column, the axis's first referenceable field: a cross-tab links a cell to its axis by the first returned column starting with the axis prefix, so requiring every field would let a caption column come first and the matrix link by caption text. A field with no values is required back all the same. Naming follows the band-field rules: a non-identifier name is skipped, and a name already taken is kept.
- Parameters:
axisName- name of the axis data set, which its fields are named afterrows- rows the axis producedavailableValues- values a query may bind, added to under the axis field namesrequiredResultProperties- columns a query must return, added to for this axiswarnOnce- says a thing once per report run, given a reason to tell repetitions by
-
checkAxesAreLinkable
public static void checkAxesAreLinkable(String dataSetName, LlmDataQuery query, Map<String, Object> params, List<String> requiredResultProperties, @Nullable String bandName) Fails a query that cannot be placed into the matrix of a cross-tab band, because the controller drops every cell it cannot link and the band then renders empty with no error at all. Failing here turns that silence into a message.An axis holding rows is checked whether or not it holds any value: a field that is empty in every row offers nothing to bind, but the matrix still has that column, and a cell query that cannot be linked would otherwise render an empty matrix with nothing said.
- Parameters:
dataSetName- data set the query belongs to, named in a failurequery- query whose columns are readparams- parameters of the run, which is where the axes arriverequiredResultProperties- columns the axes require the query to returnbandName- name of the band the data set belongs to, ornullwhen unknown
-