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

InspectResultStringifier

public final class InspectResultStringifier extends Object implements Stringifier

Fields Summary
Constructors Summary
public InspectResultStringifier()

	
Methods Summary
public java.lang.Stringstringify(java.lang.Object o)

		String			result	= "";
		final InspectResult	r	= (InspectResult)o;
	
		final MBeanFeatureInfoStringifierOptions options	= new MBeanFeatureInfoStringifierOptions( r.includeDescription, ",");
		
		result	= result + "--- " + r.objectInstance.getObjectName().toString() + " ---";

		if ( r.summary != null )
		{
			if ( result.length() != 0 )
			{
				result	= result + "\n";
			}

			result	= result + r.summary;
		}
		
		// Do formal terms like "Attributes" need to be I18n?  Probabably not as they are part of a specification.
		if ( r.attrInfo != null )
		{
			result	= result + "\n\n- Attributes -" +
						stringifyArray( r.attrInfo, new MBeanAttributeInfoStringifier(options) );
		}
		
		if ( r.operationsInfo != null )
		{
			result	= result + "\n\n- Operations -" +
						stringifyArray( r.operationsInfo, new MBeanOperationInfoStringifier(options) );
		}
		
		if ( r.constructorsInfo != null )
		{
			result	= result + "\n\n- Constructors -" +
						stringifyArray( r.constructorsInfo, new MBeanConstructorInfoStringifier(options) );
		}
		
		if ( r.notificationsInfo != null )
		{
			result	= result + "\n\n- Notifications -" + 
						stringifyArray( r.notificationsInfo, new MBeanNotificationInfoStringifier(options) );
		}
		
		return( result );
			
	
private java.lang.StringstringifyArray(java.lang.Object[] a, Stringifier stringifier)

		String	temp	= "";
		
		if ( Array.getLength( a ) != 0 )
		{
			temp	= "\n" + ArrayStringifier.stringify( a, "\n", stringifier);
		}
		return( temp );