public static Value convertFromJava ( Object o ) { if ( o instanceof Long ) { return new NumberValue ( new BigDecimal ( ( Long ) o ) ) ; } else if ( o instanceof Integer ) { return new NumberValue ( new BigDecimal ( ( Integer ) o ) ) ; } else if ( o instanceof Double ) { return new NumberValue ( new BigDecimal ( ( Double ) o ) ) ; } else if ( o instanceof Float ) { return new NumberValue ( new BigDecimal ( ( Float ) o ) ) ; } else if ( o instanceof String ) { return new StringValue ( ( String ) o ) ; } else if ( o instanceof Date ) { return new DateValue ( ( Date ) o ) ; } else if ( o instanceof Boolean ) { return BooleanValue . getInstance ( ( Boolean ) o ) ; } else if ( o == null ) { return NilValue . getInstance ( ) ; } throw new CommandExecutionException ( "Could not convert Java object " + o + " to an equivalent srec value" ) ; }
Converts a Java object to a srec value .