private void handleText( final ReportElement element, final String text ) throws ContentProcessingException { try { xmlWriter.writeText( characterEntityParser.encodeEntities( text ) ); if ( text.trim().length() > 0 ) { result = true; } } catch ( IOException e ) { throw new ContentProcessingException( e ); } }
/** * Writes the band's elements into the assigned Writer. * * @param b * the band that should be written. * @throws IOException * if an IO-Error occurs. */ private void writeBand( final Band b ) throws IOException { final Element[] elementBuffer = b.unsafeGetElementArray(); final int elementCount = elementBuffer.length; for ( int i = 0; i < elementCount; i++ ) { final Element e = elementBuffer[i]; if ( e instanceof Band ) { w.write( "<band>" ); writeBand( (Band) e ); w.write( "</band>" ); } else { w.write( "<element name=\"" ); w.write( entityParser.encodeEntities( e.getName() ) ); w.write( "\">" ); final String value = String.valueOf( e.getElementType().getValue( getRuntime(), e ) ); w.write( entityParser.encodeEntities( value ) ); w.write( "</element>" ); } } }
/** * Writes the header of the current group. * * @param event * the event. */ public void groupStarted( final ReportEvent event ) { if ( event.getState().isPrepareRun() ) { return; } try { final Group g = event.getReport().getGroup( event.getState().getCurrentGroupIndex() ); if ( g instanceof RelationalGroup ) { RelationalGroup rg = (RelationalGroup) g; w.write( "<groupheader name=\"" ); w.write( entityParser.encodeEntities( g.getName() ) ); w.write( "\">" ); writeBand( rg.getHeader() ); w.write( "</groupheader>" ); } } catch ( IOException ioe ) { XMLWriter.logger.error( "Error writing the band", ioe ); } }
/** * Writes the footer of the current group. * * @param event * the event. */ public void groupFinished( final ReportEvent event ) { if ( event.getState().isPrepareRun() ) { return; } try { final Group g = event.getReport().getGroup( event.getState().getCurrentGroupIndex() ); if ( g instanceof RelationalGroup ) { RelationalGroup rg = (RelationalGroup) g; w.write( "<groupfooter name=\"" ); w.write( entityParser.encodeEntities( g.getName() ) ); w.write( "\">" ); writeBand( rg.getFooter() ); w.write( "</groupfooter>" ); } } catch ( IOException ioe ) { XMLWriter.logger.error( "Error writing the band", ioe ); } }
protected void drawText( final RenderableText renderableText, final long contentX2 ) { try { if ( renderableText.getLength() == 0 ) { // This text is empty. return; } if ( renderableText.isNodeVisible( getParagraphBounds(), isOverflowX(), isOverflowY() ) == false ) { return; } final String text; final GlyphList gs = renderableText.getGlyphs(); final int maxLength = renderableText.computeMaximumTextSize( contentX2 ); text = gs.getText( renderableText.getOffset(), maxLength, getCodePointBuffer() ); if ( text.length() > 0 ) { xmlWriter.writeText( characterEntityParser.encodeEntities( text ) ); if ( text.trim().length() > 0 ) { result = true; } clearText(); } } catch ( final IOException ioe ) { throw new InvalidReportStateException( "Failed to write text", ioe ); } }
.encodeEntities( textResult ) ); } else if ( encodingResult.equals( "html" ) ) { return new TypeValuePair( TextType.TYPE, HtmlCharacterEntities.getEntityParser().encodeEntities( textResult ) ); } else if ( encodingResult.equals( "formula-string" ) ) { return new TypeValuePair( TextType.TYPE, FormulaUtil.quoteString( textResult ) );
if ( entry.getDescription() != null ) { dwriter.writeTag( ConfigEditorBoot.NAMESPACE, "description", XmlWriterSupport.OPEN ); //$NON-NLS-1$ writer.write( parser.encodeEntities( entry.getDescription() ) ); dwriter.writeCloseTag();
} else { String text = styledChunk.getText(); xmlWriter.writeText( characterEntityParser.encodeEntities( text ) ); if ( text.trim().length() > 0 ) { result = true;