public void close() throws IOException { // close all .. xmlWriter.writeCloseTag(); xmlWriter.close(); }
public void close() throws IOException { // close all .. xmlWriter.writeCloseTag(); xmlWriter.close(); }
public static String writeImageMapAsString( final ImageMap imageMap ) { try { final DefaultTagDescription tagDescription = new DefaultTagDescription(); tagDescription.setDefaultNamespace( LibXmlInfo.XHTML_NAMESPACE ); tagDescription.setNamespaceHasCData( LibXmlInfo.XHTML_NAMESPACE, false ); final StringWriter sbwriter = new StringWriter( 5000 ); final XmlWriter writer = new XmlWriter( sbwriter ); writer.setHtmlCompatiblityMode( true ); writer.setWriteFinalLinebreak( true ); writeImageMap( writer, imageMap, 1 ); writer.close(); return sbwriter.toString(); } catch ( IOException ioe ) { // now where does a StringWriter get its IO troubles from? throw new IllegalStateException( "Failed to write ImageMap - I am confused." ); } }
rootAttrs.addNamespaceDeclaration( "data", ExternalDataFactoryModule.NAMESPACE ); xmlWriter.writeTag( ExternalDataFactoryModule.NAMESPACE, "external-datasource", rootAttrs, XmlWriterSupport.CLOSE ); xmlWriter.close();
public String writeReport( final WriteableDocumentBundle bundle, final BundleWriterState state ) throws IOException, BundleWriterException { if ( bundle == null ) { throw new NullPointerException(); } if ( state == null ) { throw new NullPointerException(); } final OutputStream outputStream = new BufferedOutputStream( bundle.createEntry( "settings.xml", "text/xml" ) ); final DefaultTagDescription tagDescription = BundleWriterHandlerRegistry.getInstance().createWriterTagDescription(); final XmlWriter writer = new XmlWriter( new OutputStreamWriter( outputStream, "UTF-8" ), tagDescription, " ", "\n" ); writer.writeXmlDeclaration( "UTF-8" ); final AttributeList rootAttributes = new AttributeList(); rootAttributes.addNamespaceDeclaration( "", BundleNamespaces.SETTINGS ); writer.writeTag( BundleNamespaces.SETTINGS, "settings", rootAttributes, XmlWriterSupport.OPEN ); writeConfiguration( state, writer ); writeRuntimeInformation( state, writer ); writer.writeCloseTag(); writer.close(); return "settings.xml"; }
xmlWriter.writeTag( StaticDataFactoryModule.NAMESPACE, "direct-static-datasource", rootAttrs, XmlWriterSupport.CLOSE ); xmlWriter.close(); return fileName;
writeHandler.writeElement( bundle, layoutFileState, writer, report ); writer.close(); return layoutFileState.getFileName();
writer.close(); return contentFileState.getFileName();
xmlWriter.close(); return fileName;
xmlWriter.close(); return fileName;
xmlWriter.close(); return fileName; } catch ( BeanException e ) {
xmlWriter.close(); return fileName; } catch ( ReportDataFactoryException e ) {
xmlWriter.close();
writer.close();
public void write( final OutputStream outputStream, final ElementStyleDefinition styleDefinition ) throws IOException { final DefaultTagDescription tagDescription = BundleWriterHandlerRegistry.getInstance().createWriterTagDescription(); final XmlWriter writer = new XmlWriter( new OutputStreamWriter( new NoCloseOutputStream( outputStream ), "UTF-8" ), tagDescription, " ", "\n" ); writer.writeXmlDeclaration( "UTF-8" ); final AttributeList rootAttributes = new AttributeList(); rootAttributes.addNamespaceDeclaration( "", BundleNamespaces.STYLE ); rootAttributes.addNamespaceDeclaration( "layout", BundleNamespaces.LAYOUT ); rootAttributes.addNamespaceDeclaration( "core", AttributeNames.Core.NAMESPACE ); rootAttributes.addNamespaceDeclaration( "html", AttributeNames.Html.NAMESPACE ); rootAttributes.addNamespaceDeclaration( "swing", AttributeNames.Swing.NAMESPACE ); rootAttributes.addNamespaceDeclaration( "pdf", AttributeNames.Pdf.NAMESPACE ); rootAttributes.addNamespaceDeclaration( "designtime", AttributeNames.Designtime.NAMESPACE ); rootAttributes.addNamespaceDeclaration( "crosstab", AttributeNames.Crosstab.NAMESPACE ); rootAttributes.addNamespaceDeclaration( "pentaho", AttributeNames.Pentaho.NAMESPACE ); rootAttributes.addNamespaceDeclaration( "table", AttributeNames.Table.NAMESPACE ); rootAttributes.addNamespaceDeclaration( "page", ExtParserModule.NAMESPACE ); writer.writeTag( BundleNamespaces.STYLE, "style-definition", rootAttributes, XmlWriter.OPEN ); StyleFileWriter.writeStyleDefinition( writer, styleDefinition ); writer.writeCloseTag(); writer.flush(); writer.close(); } }
writer.close();
xmlWriter.close();
writer.close();