@Test public void getValueIfVisible_True() { StyleKey[] keys = new StyleKey[] { StyleKey.getStyleKey( "string", String.class ) }; List<StyleKey> styleKeys = Collections.unmodifiableList( Arrays.asList( keys ) ); PowerMockito.mockStatic( BandDefaultStyleSheet.class ); when( BandDefaultStyleSheet.getBandDefaultStyle() ).thenReturn( PowerMockito.mock( BandDefaultStyleSheet.class ) ); Element mockElement = PowerMockito.mock( Element.class ); SimpleStyleSheet mockSimpleStyleSheet = PowerMockito.mock( SimpleStyleSheet.class ); doReturn( mockSimpleStyleSheet ).when( mockElement ).getComputedStyle(); doReturn( true ).when( mockSimpleStyleSheet ).getStyleProperty( ElementStyleKeys.VISIBLE, true ); when( mockFastExcelPrinter.getValueIfVisible( mockElement, "X" ) ).thenCallRealMethod(); assertEquals( "X", mockFastExcelPrinter.getValueIfVisible( mockElement, "X" ) ); }
protected Object getValueIfVisible( final ReportElement content, final Object value ) { if ( content instanceof Element ) { SimpleStyleSheet style = ( (Element) content ).getComputedStyle(); Boolean visible = (Boolean) style.getStyleProperty( ElementStyleKeys.VISIBLE, Boolean.TRUE ); return visible ? value : null; } return value; }
FastExcelPrinter extends ExcelPrinterBase { protected Object getValueIfVisible( final ReportElement content, final Object value ) { if ( content instanceof Element ) { SimpleStyleSheet style = ( (Element) content ).getComputedStyle(); Boolean visible = (Boolean) style.getStyleProperty( ElementStyleKeys.VISIBLE, Boolean.TRUE ); return visible ? value : null; } return value; } }
FastExcelPrinter extends ExcelPrinterBase { protected Object getValueIfVisible( final ReportElement content, final Object value ) { if ( content instanceof Element ) { SimpleStyleSheet style = ( (Element) content ).getComputedStyle(); Boolean visible = (Boolean) style.getStyleProperty( ElementStyleKeys.VISIBLE, Boolean.TRUE ); return visible ? value : null; } return value; } FastExcelPrinter( final SheetLayout sheetLayout ); }
FastExcelPrinter extends ExcelPrinterBase { protected Object getValueIfVisible( final ReportElement content, final Object value ) { if ( content instanceof Element ) { SimpleStyleSheet style = ( (Element) content ).getComputedStyle(); Boolean visible = (Boolean) style.getStyleProperty( ElementStyleKeys.VISIBLE, Boolean.TRUE ); return visible ? value : null; } return value; } FastExcelPrinter( final SheetLayout sheetLayout ); void init( final OutputProcessorMetaData metaData, final ResourceManager resourceManager,
      final ReportDefinition report ); Workbook getWorkbook(); void startSection( final Band band, final long[] cellHeights ); void endSection( final Band band, final ArrayList<CellLayoutInfo> backgroundCells ); void closeSheet(); void print( final CellLayoutInfo tableRectangle, final ReportElement element, final ExpressionRuntime runtime ); void closeWorkbook( final OutputStream outputStream ); }
FastExcelPrinter extends ExcelPrinterBase { protected Object getValueIfVisible( final ReportElement content, final Object value ) { if ( content instanceof Element ) { SimpleStyleSheet style = ( (Element) content ).getComputedStyle(); Boolean visible = (Boolean) style.getStyleProperty( ElementStyleKeys.VISIBLE, Boolean.TRUE ); return visible ? value : null; } return value; } FastExcelPrinter( final SheetLayout sheetLayout ); void init( final OutputProcessorMetaData metaData, final ResourceManager resourceManager,
      final ReportDefinition report ); Workbook getWorkbook(); void startSection( final Band band, final long[] cellHeights ); void endSection( final Band band, final ArrayList<CellLayoutInfo> backgroundCells ); void closeSheet(); void print( final CellLayoutInfo tableRectangle, final ReportElement element, final ExpressionRuntime runtime ); void closeWorkbook( final OutputStream outputStream );  }