DataTableContentProvider extends AbstractJrxmlContentProvider { @Override public void inspectInputParametersFromJrxml( Map<String, ParameterDescription> parameterDescriptions, List<JAXBElement<? extends ProcessletInputDefinition>> inputs, XMLAdapter jrxmlAdapter, Map<String, String> parameters, List<String> handledParameters ) { List<String> tableIds = new ArrayList<String>(); List<OMElement> fieldElements = jrxmlAdapter.getElements( jrxmlAdapter.getRootElement(), new XPath( "/jasper:jasperReport/jasper:field", nsContext ) ); for ( OMElement fieldElement : fieldElements ) { String fieldName = fieldElement.getAttributeValue( new QName( "name" ) ); if ( isTableParameter( fieldName ) ) { String identifier = getIdentifierFromParameter( fieldName ); if ( !tableIds.contains( identifier ) ) { tableIds.add( identifier ); } } } for ( String tableId : tableIds ) { LOG.debug( "Found table component with id " + tableId ); ComplexInputDefinition comp = new ComplexInputDefinition(); addInput( comp, parameterDescriptions, tableId, 1, 0 ); ComplexFormatType format = new ComplexFormatType(); format.setEncoding( "UTF-8" ); format.setMimeType( MIME_TYPE ); format.setSchema( SCHEMA ); comp.setDefaultFormat( format ); inputs.add( new JAXBElement<ComplexInputDefinition>( new QName( "ProcessInput" ), ComplexInputDefinition.class, comp ) ); this.tableId = tableId; } } DataTableContentProvider( Workspace workspace );  DataTableContentProvider( Workspace workspace, String datasourceParameterName ); @Override void inspectInputParametersFromJrxml( Map<String, ParameterDescription> parameterDescriptions,
                                                 List<JAXBElement<? extends ProcessletInputDefinition>> inputs,
                                                 XMLAdapter jrxmlAdapter, Map<String, String> parameters,
                                                 List<String> handledParameters ); @Override Pair<InputStream, Boolean> prepareJrxmlAndReadInputParameters( InputStream jrxml,
                                                                          Map<String, Object> params,
                                                                          ProcessletInputs in,
                                                                          List<CodeType> processedIds,
                                                                          Map<String, String> parameters ); static final String SCHEMA; final static String MIME_TYPE; }
@Test public void testInspectInputParametersFromJrxml() { DataTableContentProvider dataTableContentProvider = getProvider(); Map<String, String> parameters = new HashMap<String, String>(); List<JAXBElement<? extends ProcessletInputDefinition>> inputs = new ArrayList<JAXBElement<? extends ProcessletInputDefinition>>(); XMLAdapter adapter = new XMLAdapter( TestDataTableContentProviderTest.class.getResourceAsStream( "../templateWithTable.jrxml" ) ); List<String> handledParams = new ArrayList<String>(); dataTableContentProvider.inspectInputParametersFromJrxml( new HashMap<String, ParameterDescription>(), inputs, adapter, parameters, handledParams ); assertEquals( 0, parameters.size() ); assertEquals( 0, handledParams.size() ); assertEquals( 1, inputs.size() ); assertEquals( "REPORT", inputs.get( 0 ).getValue().getIdentifier().getValue() ); }