public Object visualize ( PMContext ctx , Operation operation , Entity entity ) throws PMException { debug ( "Converting [" + operation . getId ( ) + "]" + entity . getId ( ) + "." + getId ( ) ) ; try { Converter c = null ; if ( getConverters ( ) != null ) { c = getConverter ( operation . getId ( ) ) ; } if ( c == null ) { c = getDefaultConverter ( ) ; } final Object instance = ctx . getEntityInstance ( ) ; ctx . setField ( this ) ; // We only set the field value if instance is not null. // Some operations may use this value without an instance. if ( instance != null ) { ctx . setEntityInstanceWrapper ( ctx . buildInstanceWrapper ( instance ) ) ; ctx . setFieldValue ( getPm ( ) . get ( instance , getProperty ( ) ) ) ; } return c . visualize ( ctx ) ; } catch ( ConverterException e ) { throw e ; } catch ( Exception e ) { getPm ( ) . error ( e ) ; throw new ConverterException ( "Unable to convert " + entity . getId ( ) + "." + getProperty ( ) ) ; } }
Visualize the field using the given operation and entity