protected Object findObjectSymbol ( String name , ExecutionContext context ) { CommandSymbol s = context . findSymbol ( name ) ; if ( s == null ) throw new CommandExecutionException ( "Symbol cannot be null" ) ; if ( ! ( s instanceof VarCommand ) ) throw new CommandExecutionException ( "Symbol must be a variable" ) ; Value value = ( ( VarCommand ) s ) . getValue ( null ) ; if ( value == null ) throw new CommandExecutionException ( "Symbol cannot be null" ) ; if ( value . getType ( ) != Type . OBJECT ) throw new CommandExecutionException ( "Symbol must refer to a Java object" ) ; Object obj = value . get ( ) ; if ( obj instanceof JComponentOperator ) { // In case it was found by Jemmy, we want to get the source // TODO make this Jemmy independent obj = ( ( JComponentOperator ) obj ) . getSource ( ) ; } return obj ; }
Finds a symbol which should wrap a Java object .