1 22 package org.jboss.console.plugins.helpers.jmx; 23 24 import java.beans.PropertyEditor ; 25 26 31 public class AttrResultInfo 32 { 33 public String name; 34 public PropertyEditor editor; 35 public Object result; 36 public Throwable throwable; 37 38 public AttrResultInfo(String name, PropertyEditor editor, Object result, Throwable throwable) 39 { 40 this.name = name; 41 this.editor = editor; 42 this.result = result; 43 this.throwable = throwable; 44 } 45 46 public String getAsText() 47 { 48 if (throwable != null) 49 { 50 return throwable.toString(); 51 } 52 if( result != null ) 53 { 54 try 55 { 56 if( editor != null ) 57 { 58 editor.setValue(result); 59 return editor.getAsText(); 60 } 61 else 62 { 63 return result.toString(); 64 } 65 } 66 catch (Exception e) 67 { 68 return "String representation of " + name + "unavailable"; 69 } } 71 return null; 72 } 73 } 74 | Popular Tags |