1 23 24 29 30 package com.sun.appserv.management.util.stringifier; 31 32 import java.util.Iterator ; 33 34 35 38 39 public final class IteratorStringifier extends IteratorStringifierBase 40 { 41 public 42 IteratorStringifier() 43 { 44 super(); 45 } 46 47 public 48 IteratorStringifier( String delim ) 49 { 50 super( delim ); 51 } 52 53 public 54 IteratorStringifier( Stringifier elementStringifier ) 55 { 56 super( elementStringifier ); 57 } 58 59 public 60 IteratorStringifier( String delim, Stringifier elementStringifier ) 61 { 62 super( delim, elementStringifier ); 63 } 64 65 66 public void 67 stringifyElement( 68 Object elem, 69 String delim, 70 StringBuffer buf) 71 { 72 if ( elem == null ) 73 { 74 buf.append( "null" ); 75 } 76 else 77 { 78 buf.append( mElementStringifier.stringify( elem ) ); 79 } 80 } 81 82 83 86 public static String 87 stringify( Iterator iter, String delim ) 88 { 89 final IteratorStringifier stringifier = new IteratorStringifier( delim ); 90 91 return( stringifier.stringify( iter, delim, SmartStringifier.DEFAULT ) ); 92 } 93 94 95 public final static IteratorStringifier DEFAULT = new IteratorStringifier( "," ); 96 } 97 98 | Popular Tags |