FileDocCategorySizeDatePackage
ResultsForGetSetStringifier.javaAPI DocGlassfish v2 API3796Fri May 04 22:24:52 BST 2007com.sun.cli.jmx.support

ResultsForGetSetStringifier

public class ResultsForGetSetStringifier extends Object implements Stringifier

Fields Summary
final Options
mOptions
Constructors Summary
public ResultsForGetSetStringifier()

		mOptions	= Options.DEFAULT;
	
public ResultsForGetSetStringifier(Options options)

		mOptions	= options;
	
Methods Summary
public java.lang.Stringstringify(java.lang.Object o)

		final ResultsForGetSet	result	= (ResultsForGetSet)o;
		
		String	str	= "";
		
		if ( mOptions.mIncludeObjectName )
		{
			str	= "---" + result.getName().toString() + "---";
		}
		final boolean	pretty	= mOptions.mDisplayType == Options.DISPLAY_PRETTY;
		
		final Stringifier attrS	= new AttributeStringifier();
		final Object []	attrList	= result.getAttributes().toArray();
		
		if ( pretty )
		{
			str	= str + "\n";
		}

		if ( attrList.length == 0 )
		{
			str	= str + "<no attributes found>";
		}
		else
		{
			String	delim;
			
			if ( pretty )
				delim	= "\n";
			else
				delim	= ",";
				
			str	= str + ArrayStringifier.stringify( attrList , delim, attrS );
		}
		
		return( str );