package org.jboss.console.plugins.helpers.jmx;
import java.beans.PropertyEditor;
public class AttrResultInfo
{
public String name;
public PropertyEditor editor;
public Object result;
public Throwable throwable;
public AttrResultInfo(String name, PropertyEditor editor, Object result, Throwable throwable)
{
this.name = name;
this.editor = editor;
this.result = result;
this.throwable = throwable;
}
public String getAsText()
{
if (throwable != null)
{
return throwable.toString();
}
if( result != null )
{
try
{
if( editor != null )
{
editor.setValue(result);
return editor.getAsText();
}
else
{
return result.toString();
}
}
catch (Exception e)
{
return "String representation of " + name + "unavailable";
} }
return null;
}
}