FileDocCategorySizeDatePackage
StringBuilderNewLineAppender.javaAPI DocGlassfish v2 API3139Fri May 04 22:24:10 BST 2007com.sun.enterprise.admin.mbeans.jvm

StringBuilderNewLineAppender

public class StringBuilderNewLineAppender extends Object

Fields Summary
private StringBuilder
sb
private static final String
sep
Constructors Summary
StringBuilderNewLineAppender(StringBuilder sb)
Creates a new instance of StringBuilderNewLineAppender

           
       
        this.sb = sb;
    
Methods Summary
com.sun.enterprise.admin.mbeans.jvm.StringBuilderNewLineAppenderappend(java.lang.String s)

        sb.append(s);
        sb.append(sep);
        return ( this );
    
public java.lang.StringtoString()

        return ( sb.toString() );
    
public java.lang.StringtoString(java.lang.String filterOut)

        String sbString = sb.toString();
        BufferedReader in = new BufferedReader(new StringReader(sbString));
		sb = new StringBuilder();
		
		try
		{
			readloop:
			for(String s = in.readLine(); s != null; s = in.readLine()){
				for(String filter : filterOut){
					if(s.startsWith(filter))
						continue readloop; // continue to outer loop
				}
				append(s);
			}
		}
		catch(Exception e)
		{
			// bail
			return sbString;
		}
        
		return toString();