1 23 24 29 30 package com.sun.cli.util.stringifier; 31 32 import java.lang.reflect.Array ; 33 import javax.management.*; 34 35 public class MBeanAttributeInfoStringifier extends MBeanFeatureInfoStringifier implements Stringifier 36 { 37 public final static MBeanAttributeInfoStringifier DEFAULT = 38 new MBeanAttributeInfoStringifier( ); 39 40 public 41 MBeanAttributeInfoStringifier( ) 42 { 43 super( ); 44 } 45 46 public 47 MBeanAttributeInfoStringifier( MBeanFeatureInfoStringifierOptions options ) 48 { 49 super( options ); 50 } 51 52 public String 53 stringify( Object o ) 54 { 55 MBeanAttributeInfo attr = (MBeanAttributeInfo)o; 56 String result = attr.getName() + ":"; 57 if ( attr.isReadable() ) 58 result = result + "r"; 59 if ( attr.isWritable() ) 60 result = result + "w"; 61 result = result + mOptions.mArrayDelimiter + getPresentationTypeString( attr.getType() ); 62 63 if ( mOptions.mIncludeDescription ) 64 { 65 result = result + ",\"" + attr.getDescription() + "\""; 66 } 67 68 return( result ); 69 } 70 } | Popular Tags |