/** * Creates a new support instance. * * @param safeTags the tags that are safe for line breaks. * @param indentString the indent string. */ public XmlWriterSupport( final TagDescription safeTags, final String indentString ) { this( safeTags, indentString, StringUtils.getLineSeparator() ); }
public GlobalStyleManager() { this.styles = new HashMap<StoredStyle, String>(); this.stylesText = new HashSet<String>(); this.lineSeparator = StringUtils.getLineSeparator(); }
public DefaultStyleBuilder( final StyleBuilderFactory factory ) { this.factory = factory; this.lineSeparator = StringUtils.getLineSeparator(); this.cachedBorderStyle = new LFUMap<BorderEdge, String>( 30 ); this.cachedCornerStyle = new LFUMap<BorderCorner, String>( 30 ); this.buffer = new StringBuffer( 100 ); this.usedStyles = new StyleCarrier[CSSKeys.values().length]; if ( "true".equals( ClassicEngineBoot.getInstance().getGlobalConfig().getConfigProperty( "org.pentaho.reporting.engine.classic.core.modules.output.table.html.SafariLengthHack" ) ) ) { pointConverter = new DecimalFormat( "0", new DecimalFormatSymbols( Locale.US ) ); } else { pointConverter = new DecimalFormat( "0.####", new DecimalFormatSymbols( Locale.US ) ); } }
public DefaultStyleBuilder( ) { this.lineSeparator = StringUtils.getLineSeparator(); this.cachedBorderStyle = new LFUMap<BorderEdge, String>( 30 ); this.cachedCornerStyle = new LFUMap<BorderCorner, String>( 30 ); this.buffer = new StringBuffer( 100 ); this.usedStyles = new StyleCarrier[CSSKeys.values().length]; if ( "true".equals( ClassicEngineBoot.getInstance().getGlobalConfig().getConfigProperty( "org.pentaho.reporting.engine.classic.core.modules.output.table.html.SafariLengthHack" ) ) ) { pointConverter = new DecimalFormat( "0", new DecimalFormatSymbols( Locale.US ) ); } else { pointConverter = new DecimalFormat( "0.####", new DecimalFormatSymbols( Locale.US ) ); } }
public void print( final StringBuffer buffer, final boolean compact ) { final String lineSeparator = StringUtils.getLineSeparator(); boolean first = true; for ( final DefaultStyleBuilder.StyleCarrier sc : styles ) { if ( sc == null ) { continue; } if ( first == false ) { buffer.append( "; " ); } if ( compact == false ) { if ( first == false ) { buffer.append( lineSeparator ); } buffer.append( DefaultStyleBuilder.INDENT ); } buffer.append( sc.getKey() ); buffer.append( ": " ); buffer.append( sc.getValue() ); final String unit = sc.getUnit(); if ( unit != null ) { buffer.append( unit ); } first = false; } }
/** * Returns a string representation of this module. * * @return the string representation of this module for debugging purposes. * @see Object#toString() */ public String toString() { final String lineSeparator = StringUtils.getLineSeparator(); final StringBuilder buffer = new StringBuilder( 120 ); buffer.append( "Module : " ); buffer.append( getName() ); buffer.append( lineSeparator ); buffer.append( "ModuleClass : " ); buffer.append( getModuleClass() ); buffer.append( lineSeparator ); buffer.append( "Version: " ); buffer.append( getMajorVersion() ); buffer.append( '.' ); buffer.append( getMinorVersion() ); buffer.append( '.' ); buffer.append( getPatchLevel() ); buffer.append( lineSeparator ); buffer.append( "Producer: " ); buffer.append( getProducer() ); buffer.append( lineSeparator ); buffer.append( "Description: " ); buffer.append( getDescription() ); buffer.append( lineSeparator ); return buffer.toString(); }
public void print( final Writer writer, final boolean compact ) throws IOException { final String lineSeparator = StringUtils.getLineSeparator(); boolean first = true; for ( final DefaultStyleBuilder.StyleCarrier sc : styles ) { if ( sc == null ) { continue; } if ( first == false ) { writer.write( "; " ); } if ( compact == false ) { if ( first == false ) { writer.write( lineSeparator ); } writer.write( DefaultStyleBuilder.INDENT ); } writer.write( sc.getKey().getCssName() ); writer.write( ": " ); writer.write( sc.getValue() ); final String unit = sc.getUnit(); if ( unit != null ) { writer.write( unit ); } first = false; } }
final String lineSeparator = StringUtils.getLineSeparator(); final StringBuilder buffer = new StringBuilder(120); buffer.append("Module : ");
@Test public void testWriteImageMapAsString() throws Exception { ImageMap imageMap = mockImageMap(); StringBuilder expectedValue = new StringBuilder(); expectedValue.append( "<map xmlns=\"" ); expectedValue.append( LibXmlInfo.XHTML_NAMESPACE ); expectedValue.append( "\" " ); expectedValue.append( MAP_NAME ); expectedValue.append( "=\"" ); expectedValue.append( MAP_VALUE ); expectedValue.append( "\"><area " ); expectedValue.append( MAP_ENTRY_NAME ); expectedValue.append( "=\"" ); expectedValue.append( MAP_ENTRY_VALUE ); expectedValue.append( "\" shape=\"" ); expectedValue.append( DEFAULT_SHAPE ); expectedValue.append( "\" coords=\"5.0,10.0,20.0,50.0\" /></map>" ); expectedValue.append( org.pentaho.reporting.libraries.base.util.StringUtils.getLineSeparator() ); String result = ImageMapWriter.writeImageMapAsString( imageMap ); assertThat( result, is( equalTo( expectedValue.toString() ) ) ); }